~ubuntu-branches/ubuntu/raring/xfig/raring

« back to all changes in this revision

Viewing changes to f_save.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2007-05-20 23:33:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070520233359-4ejk0ave70m2ihlz
Tags: 1:3.2.5-rel-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu change:
  - .desktop added.
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "w_setup.h"
31
31
#include "w_util.h"
32
32
#include "w_zoom.h"
33
 
#ifdef I18N
34
 
#include <locale.h>
35
 
#endif  /* I18N */
 
33
 
 
34
#include "e_compound.h"
 
35
#include "f_load.h"
 
36
#include "u_bound.h"
36
37
 
37
38
static int      write_tmpfile = 0;
38
39
static char     save_cur_dir[PATH_MAX];
41
42
 
42
43
static void write_arrows(FILE *fp, F_arrow *f, F_arrow *b);
43
44
 
44
 
init_write_tmpfile()
 
45
 
 
46
int write_objects (FILE *fp);
 
47
void write_fig_header (FILE *fp);
 
48
void write_arc (FILE *fp, F_arc *a);
 
49
void write_compound (FILE *fp, F_compound *com);
 
50
void write_ellipse (FILE *fp, F_ellipse *e);
 
51
void write_line (FILE *fp, F_line *l);
 
52
void write_spline (FILE *fp, F_spline *s);
 
53
void write_text (FILE *fp, F_text *t);
 
54
void write_comments (FILE *fp, char *com);
 
55
void write_colordefs (FILE *fp);
 
56
 
 
57
void init_write_tmpfile(void)
45
58
{
46
59
  write_tmpfile=1;
47
60
  /* save current file directory */
50
63
  strcpy(cur_file_dir, TMPDIR);
51
64
}
52
65
 
53
 
end_write_tmpfile()
 
66
void end_write_tmpfile(void)
54
67
{
55
68
  write_tmpfile=0;
56
69
  /* restore current file directory */
57
70
  strcpy(cur_file_dir, save_cur_dir);
58
71
}
59
72
 
60
 
write_file(file_name, update_recent)
61
 
    char           *file_name;
62
 
    Boolean         update_recent;
 
73
int write_file(char *file_name, Boolean update_recent)
63
74
{
64
75
    FILE           *fp;
65
76
 
93
104
 
94
105
 
95
106
int
96
 
write_objects(fp)
97
 
    FILE           *fp;
 
107
write_objects(FILE *fp)
98
108
{
99
109
    F_arc          *a;
100
110
    F_compound     *c;
154
164
    return (0);
155
165
}
156
166
 
157
 
write_fig_header(fp)
158
 
    FILE           *fp;
 
167
void write_fig_header(FILE *fp)
159
168
{
160
169
    char            str[40], *com;
161
170
    int             i, len;
221
230
}
222
231
 
223
232
/* write the user color definitions (if any) */
224
 
write_colordefs(fp)
225
 
    FILE           *fp;
 
233
void write_colordefs(FILE *fp)
226
234
{
227
235
    int             i;
228
236
 
243
251
        fprintf(fp, "}\n");
244
252
}
245
253
 
246
 
write_arc(fp, a)
247
 
    FILE           *fp;
248
 
    F_arc          *a;
 
254
void write_arc(FILE *fp, F_arc *a)
249
255
{
250
256
    /* any comments first */
251
257
    write_comments(fp, a->comments);
296
302
    } /* V4.0/3.2 */
297
303
}
298
304
 
299
 
write_compound(fp, com)
300
 
    FILE           *fp;
301
 
    F_compound     *com;
 
305
void write_compound(FILE *fp, F_compound *com)
302
306
{
303
307
    F_arc          *a;
304
308
    F_compound     *c;
341
345
    }
342
346
}
343
347
 
344
 
write_ellipse(fp, e)
345
 
    FILE           *fp;
346
 
    F_ellipse      *e;
 
348
void write_ellipse(FILE *fp, F_ellipse *e)
347
349
{
348
350
    /* get rid of any evil ellipses which have either radius = 0 */
349
351
    if (e->radiuses.x == 0 || e->radiuses.y == 0)
381
383
    } /* V4.0/3.2 */
382
384
}
383
385
 
384
 
write_line(fp, l)
385
 
    FILE           *fp;
386
 
    F_line         *l;
 
386
void write_line(FILE *fp, F_line *l)
387
387
{
388
388
    F_point        *p;
389
389
    int             npts;
464
464
    } /* if V4.0 */
465
465
}
466
466
 
467
 
write_spline(fp, s)
468
 
    FILE           *fp;
469
 
    F_spline       *s;
 
467
void write_spline(FILE *fp, F_spline *s)
470
468
{
471
469
    F_sfactor      *cp;
472
470
    F_point        *p;
517
515
}
518
516
 
519
517
 
520
 
write_text(fp, t)
521
 
    FILE           *fp;
522
 
    F_text         *t;
 
518
void write_text(FILE *fp, F_text *t)
523
519
{
524
520
    int             l, len;
525
521
    unsigned char   c;
571
567
    } /* V4.0/V3.2 */
572
568
}
573
569
 
574
 
write_comments(fp, com)
575
 
    FILE           *fp;
576
 
    char           *com;
 
570
void write_comments(FILE *fp, char *com)
577
571
{
578
572
    char           last;
579
573
 
592
586
        fputc('\n',fp);
593
587
}
594
588
 
595
 
emergency_save(file_name)
596
 
    char           *file_name;
 
589
int emergency_save(char *file_name)
597
590
{
598
591
    FILE           *fp;
599
592