/[m4]/m4/m4/output.c
ViewVC logotype

Diff of /m4/m4/output.c

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

revision 1.3 by gary, Sun Aug 19 10:53:56 2001 UTC revision 1.4 by gary, Mon Aug 20 19:42:38 2001 UTC
# Line 103  M4_GLOBAL_DATA int m4_output_current_lin Line 103  M4_GLOBAL_DATA int m4_output_current_lin
103  /* --- OUTPUT INITIALISATION --- */  /* --- OUTPUT INITIALISATION --- */
104    
105  void  void
106  m4_output_init ()  m4_output_init (void)
107  {  {
108    diversion_table = (struct diversion *) xmalloc (sizeof (struct diversion));    diversion_table = (struct diversion *) xmalloc (sizeof (struct diversion));
109    diversions = 1;    diversions = 1;
# Line 128  m4_output_init () Line 128  m4_output_init ()
128    
129  #include <fcntl.h>  #include <fcntl.h>
130    
 static int mkstemp M4_PARAMS((const char *tmpl));  
   
131  static int  static int
132  mkstemp (tmpl)  mkstemp (const char *tmpl)
      const char *tmpl;  
133  {  {
134    mktemp (tmpl);    mktemp (tmpl);
135    return open (tmpl, O_RDWR | O_TRUNC | O_CREAT, 0600);    return open (tmpl, O_RDWR | O_TRUNC | O_CREAT, 0600);
# Line 149  mkstemp (tmpl) Line 146  mkstemp (tmpl)
146   */   */
147  #include <fcntl.h>  #include <fcntl.h>
148    
 char   *mktemp          M4_PARAMS((char *tmpl));  
 int     mkstemp         M4_PARAMS((char *tmpl));  
   
149  int  int
150  mkstemp (tmpl)  mkstemp (char *tmpl)
      char *tmpl;  
151  {  {
152    char *xes;    char *xes;
153    pid_t pid;    pid_t pid;
# Line 191  mkstemp (tmpl) Line 184  mkstemp (tmpl)
184  }  }
185    
186  char *  char *
187  mktemp (tmpl)  mktemp (char *tmpl)
      char *tmpl;  
188  {  {
189    int fd;    int fd;
190    
# Line 212  mktemp (tmpl) Line 204  mktemp (tmpl)
204    
205  /* Implement tmpfile(3) for non-USG systems.  */  /* Implement tmpfile(3) for non-USG systems.  */
206    
 static FILE *tmpfile M4_PARAMS((void));  
   
207  static FILE *  static FILE *
208  tmpfile ()  tmpfile (void)
209  {  {
210    char buf[32];    char buf[32];
211    int fd;    int fd;
# Line 238  tmpfile () Line 228  tmpfile ()
228     to be flushed to a newly created temporary file.  This flushed buffer     to be flushed to a newly created temporary file.  This flushed buffer
229     might well be the current one.  */     might well be the current one.  */
230  static void  static void
231  make_room_for (length)  make_room_for (int length)
      int length;  
232  {  {
233    int wanted_size;    int wanted_size;
234    
# Line 348  make_room_for (length) Line 337  make_room_for (length)
337      (output_unused--, *output_cursor++ = (Char))      (output_unused--, *output_cursor++ = (Char))
338    
339  static void  static void
340  output_character_helper (character)  output_character_helper (int character)
      int character;  
341  {  {
342    make_room_for (1);    make_room_for (1);
343    
# Line 365  output_character_helper (character) Line 353  output_character_helper (character)
353  /* Output one TEXT having LENGTH characters, when it is known that it goes  /* Output one TEXT having LENGTH characters, when it is known that it goes
354     to a diversion file or an in-memory diversion buffer.  */     to a diversion file or an in-memory diversion buffer.  */
355  static void  static void
356  output_text (text, length)  output_text (const char *text, int length)
      const char *text;  
      int length;  
357  {  {
358    int count;    int count;
359    
# Line 398  output_text (text, length) Line 384  output_text (text, length)
384     sync lines are output whenever a single input lines generates several     sync lines are output whenever a single input lines generates several
385     output lines, or when several input lines does not generate any output.  */     output lines, or when several input lines does not generate any output.  */
386  void  void
387  m4_shipout_text (obs, text, length)  m4_shipout_text (struct obstack *obs, const char *text, int length)
      struct obstack *obs;  
      const char *text;  
      int length;  
388  {  {
389    static boolean start_of_output_line = TRUE;    static boolean start_of_output_line = TRUE;
390    char line[20];    char line[20];
# Line 483  m4_shipout_text (obs, text, length) Line 466  m4_shipout_text (obs, text, length)
466            start_of_output_line = TRUE;            start_of_output_line = TRUE;
467        }        }
468  }  }
469    
470  /* Format an int VAL, and stuff it into an obstack OBS.  Used for macros  /* Format an int VAL, and stuff it into an obstack OBS.  Used for macros
471     expanding to numbers.  */     expanding to numbers.  */
472  void  void
# Line 495  m4_shipout_int (struct obstack *obs, int Line 479  m4_shipout_int (struct obstack *obs, int
479  }  }
480    
481  void  void
482  m4_shipout_string (struct obstack *obs, const char *s, int len, boolean quoted)  m4_shipout_string (struct obstack *obs, const char *s, int len,
483                       boolean quoted)
484  {  {
485    if (s == NULL)    if (s == NULL)
486      s = "";      s = "";

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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