2 * Copyright (c) 1997 Joerg Wunsch. All rights reserved.
4 * Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 *---------------------------------------------------------------------------
30 * i4b daemon - runtime configuration lexical analyzer
31 * ---------------------------------------------------
35 * last edit-date: [Thu May 20 14:04:13 1999]
37 *---------------------------------------------------------------------------*/
60 * Drop comment. NB: this prevents a hash
61 * sign from appearing inside a quoted string.
67 if ((str = malloc(yyleng - 1)) == 0)
68 errx(EX_OSERR, "Out of virtual memory");
69 memcpy(str, yytext + 1, yyleng - 2);
79 if ((str = malloc(128)) == 0)
80 errx(EX_OSERR, "Out of virtual memory");
81 while(*p == '-' || isdigit(*p) || *p == '*')
88 acctall { return ACCTALL; }
89 acctfile { return ACCTFILE; }
90 alert { return ALERT; }
91 aliasing { return ALIASING; }
92 aliasfile { return ALIASFNAME; }
93 answerprog { return ANSWERPROG; }
94 b1protocol { return B1PROTOCOL; }
95 beepconnect { return BEEPCONNECT; }
96 callbackwait { return CALLBACKWAIT; }
97 calledbackwait { return CALLEDBACKWAIT; }
98 connectprog { return CONNECTPROG; }
99 dialin-reaction { return REACTION; }
100 dialout-type { return DIALOUTTYPE; }
101 dialrandincr { return DIALRANDINCR; }
102 dialretries { return DIALRETRIES; }
103 direction { return DIRECTION; }
104 disconnectprog { return DISCONNECTPROG; }
105 downtries { return DOWNTRIES; }
106 downtime { return DOWNTIME; }
107 earlyhangup { return EARLYHANGUP; }
108 entry { return ENTRY; }
109 idletime-incoming { return IDLETIME_IN; }
110 idletime-outgoing { return IDLETIME_OUT; }
111 idle-algorithm-outgoing { return IDLE_ALG_OUT; }
112 isdncontroller { return ISDNCONTROLLER; }
113 isdnchannel { return ISDNCHANNEL; }
114 isdntime { return ISDNTIME; }
115 isdntxdel-incoming { return ISDNTXDELIN; }
116 isdntxdel-outgoing { return ISDNTXDELOUT; }
117 local-phone-dialout { return LOCAL_PHONE_DIALOUT; }
118 local-phone-incoming { return LOCAL_PHONE_INCOMING; }
119 monitor-allowed { return MONITORSW; }
120 monitor-port { return MONITORPORT; }
121 monitor { return MONITOR; }
122 monitor-access { return MONITORACCESS; }
123 fullcmd { return FULLCMD; }
124 restrictedcmd { return RESTRICTEDCMD; }
125 channelstate { return CHANNELSTATE; }
126 callin { return CALLIN; }
127 callout { return CALLOUT; }
128 logevents { return LOGEVENTS; }
129 name { return NAME; }
133 ratesfile { return RATESFILE; }
134 ratetype { return RATETYPE; }
135 recoverytime { return RECOVERYTIME; }
136 regexpr { return REGEXPR; }
137 regprog { return REGPROG; }
138 remdial-handling { return REMOTE_NUMBERS_HANDLING; }
139 remote-phone-dialout { return REMOTE_PHONE_DIALOUT; }
140 remote-phone-incoming { return REMOTE_PHONE_INCOMING; }
141 rotatesuffix { return ROTATESUFFIX; }
142 rtprio { return RTPRIO; }
143 system { return SYSTEM; }
144 tinainitprog { return TINAINITPROG; }
145 unitlength { return UNITLENGTH; }
146 unitlengthsrc { return UNITLENGTHSRC; }
147 useacctfile { return USEACCTFILE; }
148 usrdevicename { return USRDEVICENAME; }
149 usrdeviceunit { return USRDEVICEUNIT; }
150 usedown { return USEDOWN; }
153 \n { lineno++; return '\n'; }
155 [A-Za-z/.][-A-Za-z0-9_/.]* {
157 if ((str = strdup(yytext)) == 0)
158 err(EX_OSERR, "Out of virtual memory");
163 [ \t] { /* drop white space */ }
165 . { return yytext[0]; }
170 reset_scanner(FILE *infile)