[BACK]Return to misc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / m4

Diff for /src/usr.bin/m4/misc.c between version 1.26 and 1.27

version 1.26, 2001/11/16 23:50:40 version 1.27, 2002/04/26 16:15:16
Line 76 
Line 76 
  * find the index of second str in the first str.   * find the index of second str in the first str.
  */   */
 ptrdiff_t  ptrdiff_t
 indx(s1, s2)  indx(const char *s1, const char *s2)
         const char *s1;  
         const char *s2;  
 {  {
         char *t;          char *t;
   
Line 92 
Line 90 
  *  putback - push character back onto input   *  putback - push character back onto input
  */   */
 void  void
 putback(c)  putback(int c)
         int c;  
 {  {
         if (c == EOF)          if (c == EOF)
                 return;                  return;
Line 108 
Line 105 
  *          performance.   *          performance.
  */   */
 void  void
 pbstr(s)  pbstr(const char *s)
         const char *s;  
 {  {
         size_t n;          size_t n;
   
Line 124 
Line 120 
  *  pbnum - convert number to string, push back on input.   *  pbnum - convert number to string, push back on input.
  */   */
 void  void
 pbnum(n)  pbnum(int n)
         int n;  
 {  {
         int num;          int num;
   
Line 143 
Line 138 
  *  pbunsigned - convert unsigned long to string, push back on input.   *  pbunsigned - convert unsigned long to string, push back on input.
  */   */
 void  void
 pbunsigned(n)  pbunsigned(unsigned long n)
         unsigned long n;  
 {  {
         do {          do {
                 putback(n % 10 + '0');                  putback(n % 10 + '0');
Line 211 
Line 205 
  *  chrsave - put single char on string space   *  chrsave - put single char on string space
  */   */
 void  void
 chrsave(c)  chrsave(int c)
         int c;  
 {  {
         if (ep >= endest)          if (ep >= endest)
                 enlarge_strspace();                  enlarge_strspace();
Line 223 
Line 216 
  * read in a diversion file, and dispose it.   * read in a diversion file, and dispose it.
  */   */
 void  void
 getdiv(n)  getdiv(int n)
         int n;  
 {  {
         int c;          int c;
   
Line 238 
Line 230 
 }  }
   
 void  void
 onintr(signo)  onintr(int signo)
         int signo;  
 {  {
 #define intrmessage     "m4: interrupted.\n"  #define intrmessage     "m4: interrupted.\n"
         write(STDERR_FILENO, intrmessage, sizeof(intrmessage)-1);          write(STDERR_FILENO, intrmessage, sizeof(intrmessage)-1);
Line 263 
Line 254 
 /*  /*
  * resizedivs: allocate more diversion files */   * resizedivs: allocate more diversion files */
 void  void
 resizedivs(n)  resizedivs(int n)
         int n;  
 {  {
         int i;          int i;
   
Line 277 
Line 267 
 }  }
   
 void *  void *
 xalloc(n)  xalloc(size_t n)
         size_t n;  
 {  {
         char *p = malloc(n);          char *p = malloc(n);
   
Line 288 
Line 277 
 }  }
   
 char *  char *
 xstrdup(s)  xstrdup(const char *s)
         const char *s;  
 {  {
         char *p = strdup(s);          char *p = strdup(s);
         if (p == NULL)          if (p == NULL)
Line 305 
Line 293 
 }  }
   
 int  int
 obtain_char(f)  obtain_char(struct input_file *f)
         struct input_file *f;  
 {  {
         if (f->c == EOF)          if (f->c == EOF)
                 return EOF;                  return EOF;
Line 318 
Line 305 
 }  }
   
 void  void
 set_input(f, real, name)  set_input(struct input_file *f, FILE *real, const char *name)
         struct input_file *f;  
         FILE *real;  
         const char *name;  
 {  {
         f->file = real;          f->file = real;
         f->lineno = 1;          f->lineno = 1;
Line 330 
Line 314 
 }  }
   
 void  void
 release_input(f)  release_input(struct input_file *f)
         struct input_file *f;  
 {  {
         if (f->file != stdin)          if (f->file != stdin)
             fclose(f->file);              fclose(f->file);
Line 343 
Line 326 
 }  }
   
 void  void
 doprintlineno(f)  doprintlineno(struct input_file *f)
         struct input_file *f;  
 {  {
         pbunsigned(f->lineno);          pbunsigned(f->lineno);
 }  }
   
 void  void
 doprintfilename(f)  doprintfilename(struct input_file *f)
         struct input_file *f;  
 {  {
         pbstr(rquote);          pbstr(rquote);
         pbstr(f->name);          pbstr(f->name);
Line 370 
Line 351 
   
   
 void  void
 dump_buffer(f, m)  dump_buffer(FILE *f, size_t m)
         FILE *f;  
         size_t m;  
 {  {
         char *s;          char *s;
   

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27