/[pspp]/pspp/src/pfm-write.c
ViewVC logotype

Diff of /pspp/src/pfm-write.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by jmd, Fri Apr 29 01:02:15 2005 UTC revision 1.12 by blp, Mon May 2 06:21:20 2005 UTC
# Line 64  struct pfm_var Line 64  struct pfm_var
64  static int buf_write (struct pfm_writer *, const void *, size_t);  static int buf_write (struct pfm_writer *, const void *, size_t);
65  static int write_header (struct pfm_writer *);  static int write_header (struct pfm_writer *);
66  static int write_version_data (struct pfm_writer *);  static int write_version_data (struct pfm_writer *);
67  static int write_variables (struct pfm_writer *, const struct dictionary *);  static int write_variables (struct pfm_writer *, struct dictionary *);
68  static int write_value_labels (struct pfm_writer *, const struct dictionary *);  static int write_value_labels (struct pfm_writer *, const struct dictionary *);
69    
70  /* Writes the dictionary DICT to portable file HANDLE.  Returns  /* Writes the dictionary DICT to portable file HANDLE.  Returns
71     nonzero only if successful. */     nonzero only if successful.  DICT will not be modified, except
72       to assign short names. */
73  struct pfm_writer *  struct pfm_writer *
74  pfm_open_writer (struct file_handle *fh, const struct dictionary *dict)  pfm_open_writer (struct file_handle *fh, struct dictionary *dict)
75  {  {
76    struct pfm_writer *w = NULL;    struct pfm_writer *w = NULL;
77    size_t i;    size_t i;
# Line 368  write_value (struct pfm_writer *w, union Line 369  write_value (struct pfm_writer *w, union
369    
370  /* Write variable records, and return success. */  /* Write variable records, and return success. */
371  static int  static int
372  write_variables (struct pfm_writer *w, const struct dictionary *dict)  write_variables (struct pfm_writer *w, struct dictionary *dict)
373  {  {
374    int i;    int i;
375    
376      dict_assign_short_names (dict);
377        
378    if (!buf_write (w, "4", 1) || !write_int (w, dict_get_var_cnt (dict))    if (!buf_write (w, "4", 1) || !write_int (w, dict_get_var_cnt (dict))
379        || !write_int (w, 161))        || !write_int (w, 161))
# Line 389  write_variables (struct pfm_writer *w, c Line 392  write_variables (struct pfm_writer *w, c
392        struct variable *v = dict_get_var (dict, i);        struct variable *v = dict_get_var (dict, i);
393                
394        if (!buf_write (w, "7", 1) || !write_int (w, v->width)        if (!buf_write (w, "7", 1) || !write_int (w, v->width)
395            || !write_string (w, v->name)            || !write_string (w, v->short_name)
396            || !write_format (w, &v->print) || !write_format (w, &v->write))            || !write_format (w, &v->print) || !write_format (w, &v->write))
397          return 0;          return 0;
398    
# Line 422  write_value_labels (struct pfm_writer *w Line 425  write_value_labels (struct pfm_writer *w
425    
426        if (!buf_write (w, "D", 1)        if (!buf_write (w, "D", 1)
427            || !write_int (w, 1)            || !write_int (w, 1)
428            || !write_string (w, v->name)            || !write_string (w, v->short_name)
429            || !write_int (w, val_labs_count (v->val_labs)))            || !write_int (w, val_labs_count (v->val_labs)))
430          return 0;          return 0;
431    

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26