File: vargs.h

package info (click to toggle)
mawk 1.3.3-17
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 1,484 kB
  • ctags: 1,506
  • sloc: ansic: 13,008; yacc: 994; awk: 629; makefile: 113; sh: 107
file content (74 lines) | stat: -rw-r--r-- 1,725 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

/********************************************
vargs.h
copyright 1992 Michael D. Brennan

This is a source file for mawk, an implementation of
the AWK programming language.

Mawk is distributed without warranty under the terms of
the GNU General Public License, version 2, 1991.
********************************************/

/*
$Log: vargs.h,v $
 * Revision 1.4  1994/12/14  14:36:54  mike
 * sometimes stdarg.h exists, but depending on compiler flags it is
 * unusable -- assume NO_PROTOS => NO_STDARG_H
 *
 * Revision 1.3  1994/10/08  19:18:38  mike
 * trivial change
 *
 * Revision 1.2  1993/07/04  12:52:19  mike
 * start on autoconfig changes
 *
 * Revision 1.1.1.1  1993/07/03  18:58:22  mike
 * move source to cvs
 *
 * Revision 1.1  1992/10/02  23:23:41  mike
 * Initial revision
 *
*/

/* provides common interface to <stdarg.h> or <varargs.h> 
   only used for error messages
*/

#ifdef     NO_PROTOS
#ifndef    NO_STDARG_H   
#define    NO_STDARG_H  1
#endif
#endif

#if     NO_STDARG_H
#include <varargs.h>

#ifndef  VA_ALIST

#define  VA_ALIST(type, arg)  (va_alist) va_dcl { type arg ;
#define  VA_ALIST2(t1,a1,t2,a2) (va_alist) va_dcl { t1 a1 ; t2 a2 ;

#endif

#define  VA_START(p,type, last)  va_start(p) ;\
                                 last = va_arg(p,type)


#define  VA_START2(p,t1,a1,t2,a2)  va_start(p) ;\
                                  a1 = va_arg(p,t1);\
                                  a2 = va_arg(p,t2)

#else  /* have stdarg.h */
#include <stdarg.h>

#ifndef  VA_ALIST
#define  VA_ALIST(type, arg)  (type arg, ...) {
#define  VA_ALIST2(t1,a1,t2,a2)  (t1 a1,t2 a2,...) {
#endif

#define  VA_START(p,type,last)   va_start(p,last)

#define  VA_START2(p,t1,a1,t2,a2)  va_start(p,a2)

#endif