This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / source3 / aparser / util.awk
1 function isaptr(elem) 
2 {
3         if (substr(elem, 1, 1) == "*") {
4                 return 1;
5         }
6         return 0;
7 }
8
9 function noptr(elem) 
10 {
11         if (!isaptr(elem)) return elem;
12         return substr(elem, 2);
13 }
14
15 function xprintf(f, fmt, v1, v2, v3, v4, v5, v6, v7)
16 {
17         printf(fmt, v1, v2, v3, v4, v5, v6) > f;
18 }
19
20 function fatal(why)
21 {
22         printf("FATAL: %s\n", why);
23         exit 1;
24 }
25
26 function numlines(fname,
27                   LOCAL, line, count)
28 {
29         count=0;
30         while ((getline line < fname) > 0) count++;
31         close(fname);
32         return count;
33 }
34
35 # return 1 if the string is a constant
36 function is_constant(s) 
37 {
38     return match(s,"^[0-9]+$");
39 }