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

Diff for /src/usr.bin/m4/eval.c between version 1.43 and 1.44

version 1.43, 2002/02/16 21:27:48 version 1.44, 2002/04/26 16:15:16
Line 109 
Line 109 
  * argc is 3 for macro-or-builtin() and 2 for macro-or-builtin   * argc is 3 for macro-or-builtin() and 2 for macro-or-builtin
  */   */
 void  void
 eval(argv, argc, td)  eval(const char *argv[], int argc, int td)
         const char *argv[];  
         int argc;  
         int td;  
 {  {
         ssize_t mark = -1;          ssize_t mark = -1;
   
Line 134 
Line 131 
  * expand_builtin - evaluate built-in macros.   * expand_builtin - evaluate built-in macros.
  */   */
 void  void
 expand_builtin(argv, argc, td)  expand_builtin(const char *argv[], int argc, int td)
         const char *argv[];  
         int argc;  
         int td;  
 {  {
         int c, n;          int c, n;
         int ac;          int ac;
Line 501 
Line 495 
  * expand_macro - user-defined macro expansion   * expand_macro - user-defined macro expansion
  */   */
 void  void
 expand_macro(argv, argc)  expand_macro(const char *argv[], int argc)
         const char *argv[];  
         int argc;  
 {  {
         const char *t;          const char *t;
         const char *p;          const char *p;
Line 576 
Line 568 
  * dodefine - install definition in the table   * dodefine - install definition in the table
  */   */
 void  void
 dodefine(name, defn)  dodefine(const char *name, const char *defn)
         const char *name;  
         const char *defn;  
 {  {
         ndptr p;          ndptr p;
         int n;          int n;
Line 614 
Line 604 
  *      the given name.   *      the given name.
  */   */
 static void  static void
 dodefn(name)  dodefn(const char *name)
         const char *name;  
 {  {
         ndptr p;          ndptr p;
         char *real;          char *real;
Line 640 
Line 629 
  *      lookup.   *      lookup.
  */   */
 static void  static void
 dopushdef(name, defn)  dopushdef(const char *name, const char *defn)
         const char *name;  
         const char *defn;  
 {  {
         ndptr p;          ndptr p;
   
Line 663 
Line 650 
  * dump_one_def - dump the specified definition.   * dump_one_def - dump the specified definition.
  */   */
 static void  static void
 dump_one_def(p)  dump_one_def(ndptr p)
         ndptr p;  
 {  {
         char *real;          char *real;
   
Line 687 
Line 673 
  *      hash table is dumped.   *      hash table is dumped.
  */   */
 static void  static void
 dodump(argv, argc)  dodump(const char *argv[], int argc)
         const char *argv[];  
         int argc;  
 {  {
         int n;          int n;
         ndptr p;          ndptr p;
Line 709 
Line 693 
  * dotrace - mark some macros as traced/untraced depending upon on.   * dotrace - mark some macros as traced/untraced depending upon on.
  */   */
 static void  static void
 dotrace(argv, argc, on)  dotrace(const char *argv[], int argc, int on)
         const char *argv[];  
         int argc;  
         int on;  
 {  {
         int n;          int n;
   
Line 727 
Line 708 
  * doifelse - select one of two alternatives - loop.   * doifelse - select one of two alternatives - loop.
  */   */
 static void  static void
 doifelse(argv, argc)  doifelse(const char *argv[], int argc)
         const char *argv[];  
         int argc;  
 {  {
         cycle {          cycle {
                 if (STREQ(argv[2], argv[3]))                  if (STREQ(argv[2], argv[3]))
Line 749 
Line 728 
  * doinclude - include a given file.   * doinclude - include a given file.
  */   */
 static int  static int
 doincl(ifile)  doincl(const char *ifile)
         const char *ifile;  
 {  {
         if (ilevel + 1 == MAXINP)          if (ilevel + 1 == MAXINP)
                 errx(1, "%s at line %lu: too many include files.",                  errx(1, "%s at line %lu: too many include files.",
Line 769 
Line 747 
  *           macro processing.   *           macro processing.
  */   */
 static int  static int
 dopaste(pfile)  dopaste(const char *pfile)
         const char *pfile;  
 {  {
         FILE *pf;          FILE *pf;
         int c;          int c;
Line 786 
Line 763 
 #endif  #endif
   
 static void  static void
 gnu_dochq(argv, ac)  gnu_dochq(const char *argv[], int ac)
         const char *argv[];  
         int ac;  
 {  {
         /* In gnu-m4 mode, the only way to restore quotes is to have no          /* In gnu-m4 mode, the only way to restore quotes is to have no
          * arguments at all. */           * arguments at all. */
Line 808 
Line 783 
  * dochq - change quote characters   * dochq - change quote characters
  */   */
 static void  static void
 dochq(argv, argc)  dochq(const char *argv[], int argc)
         const char *argv[];  
         int argc;  
 {  {
         if (argc > 2) {          if (argc > 2) {
                 if (*argv[2])                  if (*argv[2])
Line 831 
Line 804 
 }  }
   
 static void  static void
 gnu_dochc(argv, ac)  gnu_dochc(const char *argv[], int ac)
         const char *argv[];  
         int ac;  
 {  {
         /* In gnu-m4 mode, no arguments mean no comment          /* In gnu-m4 mode, no arguments mean no comment
          * arguments at all. */           * arguments at all. */
Line 855 
Line 826 
  * dochc - change comment characters   * dochc - change comment characters
  */   */
 static void  static void
 dochc(argv, argc)  dochc(const char *argv[], int argc)
         const char *argv[];  
         int argc;  
 {  {
         if (argc > 2) {          if (argc > 2) {
                 if (*argv[2])                  if (*argv[2])
Line 879 
Line 848 
  * dodivert - divert the output to a temporary file   * dodivert - divert the output to a temporary file
  */   */
 static void  static void
 dodiv(n)  dodiv(int n)
         int n;  
 {  {
         int fd;          int fd;
   
Line 911 
Line 879 
  *              other outputs, in numerical order.   *              other outputs, in numerical order.
  */   */
 static void  static void
 doundiv(argv, argc)  doundiv(const char *argv[], int argc)
         const char *argv[];  
         int argc;  
 {  {
         int ind;          int ind;
         int n;          int n;
Line 936 
Line 902 
  * dosub - select substring   * dosub - select substring
  */   */
 static void  static void
 dosub(argv, argc)  dosub(const char *argv[], int argc)
         const char *argv[];  
         int argc;  
 {  {
         const char *ap, *fc, *k;          const char *ap, *fc, *k;
         int nc;          int nc;
Line 987 
Line 951 
  * destination string.   * destination string.
  */   */
 static void  static void
 map(dest, src, from, to)  map(char *dest, const char *src, const char *from, const char *to)
         char *dest;  
         const char *src;  
         const char *from;  
         const char *to;  
 {  {
         const char *tmp;          const char *tmp;
         unsigned char sch, dch;          unsigned char sch, dch;
Line 1063 
Line 1023 
  * on the way.   * on the way.
  */   */
 static const char *  static const char *
 handledash(buffer, end, src)  handledash(char *buffer, char *end, const char *src)
         char *buffer;  
         char *end;  
         const char *src;  
 {  {
         char *p;          char *p;
   
Line 1091 
Line 1048 
         *p = '\0';          *p = '\0';
         return buffer;          return buffer;
 }  }
   

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44