-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathl.l
More file actions
831 lines (667 loc) · 22.6 KB
/
Copy pathl.l
File metadata and controls
831 lines (667 loc) · 22.6 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
/*
* Copyright (C) 2011 Tildeslash Ltd. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
*
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. If you
* do not wish to do so, delete this exception statement from your
* version. If you delete this exception statement from all source
* files in the program, then also delete it here.
*/
%option noyywrap
%{
/*
* DESCRIPTION
* Lexical grammar for tokenizing the control file.
*
* AUTHOR
* Jan-Henrik Haukeland, <hauk@tildeslash.com>
* Olivier Beyssac, <ob@r14.freenix.org>
* Christian Hopp, <chopp@iei.tu-clausthal.de>
* Martin Pala, <martinp@tildeslash.com>
*
*/
#include <config.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_GLOB_H
#include <glob.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#include "monitor.h"
#include "tokens.h"
#define MAX_STACK_DEPTH 128
int buffer_stack_ptr=0;
struct buffer_stack_s {
int lineno;
char *currentfile;
YY_BUFFER_STATE buffer;
} buffer_stack[MAX_STACK_DEPTH];
int lineno= 1;
int arglineno= 1;
char *currentfile=NULL;
char *argcurrentfile=NULL;
char *argyytext=NULL;
/* Prototypes */
extern void yyerror(const char*,...);
extern void yywarning(const char *,...);
static void steplinenobycr(char *);
static void save_arg(void);
static void include_file(char *);
static char *handle_quoted_string(char *);
static void push_buffer_state(YY_BUFFER_STATE, char*);
static int pop_buffer_state(void);
static URL_T create_URL(char *proto);
%}
ws [ \r\t]+
wws [ \r\t;,()]+
number [0-9]+
real [0-9]+([.][0-9]+)?
str [^\000-\041@:{}"';(),%]+
hostname {str}(\.{str})*
greater ("greater"|"gt"|">")
less ("less"|"lt"|"<")
equal ("equal"|"eq"|"=="|"=")
notequal ("notequal"|"ne"|"!=")
loadavg1 load(avg)[ ]*(\([ ]*1[ ]*(m|min)?[ ]*\))?
loadavg5 load(avg)[ ]*\([ ]*5[ ]*(m|min)?[ ]*\)
loadavg15 load(avg)[ ]*\([ ]*15[ ]*(m|min)?[ ]*\)
cpuuser cpu[ ]*(usage)*[ ]*\([ ]*(us|usr|user)?[ ]*\)
cpusyst cpu[ ]*(usage)*[ ]*\([ ]*(sy|sys|system)?[ ]*\)
cpuwait cpu[ ]*(usage)*[ ]*\([ ]*(wa|wait)?[ ]*\)
startarg start{ws}?(program)?{ws}?([=]{ws})?["]
stoparg stop{ws}?(program)?{ws}?([=]{ws})?["]
execarg exec(ute)?{ws}?["]
percent ("percent"|"%")
byte ("byte"|"b")
kilobyte ("kilobyte"|"kb")
megabyte ("megabyte"|"mb")
gigabyte ("gigabyte"|"gb")
%x ARGUMENT_COND DEPEND_COND SERVICE_COND URL_COND STRING_COND INCLUDE
%%
{wws} { /* Wide white space */ }
(#.*)?\\?\n { lineno++; }
is {/* EMPTY */}
as {/* EMPTY */}
are {/* EMPTY */}
for {/* EMPTY */}
on(ly)? {/* EMPTY */}
with(in|out)? {/* EMPTY */}
program(s)? {/* EMPTY */}
and {/* EMPTY */}
has {/* EMPTY */}
using {/* EMPTY */}
use {/* EMPTY */}
the {/* EMPTY */}
sum {/* EMPTY */}
than {/* EMPTY */}
usage {/* EMPTY */}
was {/* EMPTY */}
times {/* EMPTY */}
but {/* EMPTY */}
of {/* EMPTY */}
does {/* EMPTY */}
{startarg} { BEGIN(ARGUMENT_COND); return START; }
{stoparg} { BEGIN(ARGUMENT_COND); return STOP; }
{execarg} { BEGIN(ARGUMENT_COND); return EXEC; }
if { return IF; }
or { return OR; }
then { return THEN; }
failed { return FAILED; }
ssl { return HTTPDSSL; }
enable { return ENABLE; }
disable { return DISABLE; }
set { return SET; }
daemon { return DAEMON; }
delay { return DELAY; }
logfile { return LOGFILE; }
syslog { return SYSLOG; }
facility { return FACILITY; }
httpd { return HTTPD; }
address { return ADDRESS; }
clientpemfile { return CLIENTPEMFILE; }
allowselfcertification { return ALLOWSELFCERTIFICATION; }
certmd5 { return CERTMD5; }
pemfile { return PEMFILE; }
init { return INIT; }
allow { return ALLOW; }
read[-]?only { return READONLY; }
pidfile { return PIDFILE; }
idfile { return IDFILE; }
statefile { return STATEFILE; }
path { return PATHTOK; }
start { return START; }
stop { return STOP; }
port(number)? { return PORT; }
unix(socket)? { return UNIXSOCKET; }
type { return TYPE; }
proto(col)? { return PROTOCOL; }
tcp { return TCP; }
tcpssl { return TCPSSL; }
udp { return UDP; }
alert { return ALERT; }
noalert { return NOALERT; }
mail-format { return MAILFORMAT; }
resource { return RESOURCE; }
restart(s)? { return RESTART; }
cycle(s)? { return CYCLE;}
timeout { return TIMEOUT; }
checksum { return CHECKSUM; }
mailserver { return MAILSERVER; }
every { return EVERY; }
host { return HOST; }
hostheader { return HOSTHEADER; }
system { return SYSTEM; }
default { return DEFAULT; }
http { return HTTP; }
apache-status { return APACHESTATUS; }
ftp { return FTP; }
smtp { return SMTP; }
postfix-policy { return POSTFIXPOLICY; }
pop { return POP; }
imap { return IMAP; }
clamav { return CLAMAV; }
dns { return DNS; }
mysql { return MYSQL; }
nntp { return NNTP; }
ntp3 { return NTP3; }
ssh { return SSH; }
dwp { return DWP; }
ldap2 { return LDAP2; }
ldap3 { return LDAP3; }
rdate { return RDATE; }
lmtp { return LMTP; }
rsync { return RSYNC; }
tns { return TNS; }
pgsql { return PGSQL; }
sip { return SIP; }
gps { return GPS; }
radius { return RADIUS; }
memcache { return MEMCACHE; }
target { return TARGET; }
maxforward { return MAXFORWARD; }
mode { return MODE; }
active { return ACTIVE; }
passive { return PASSIVE; }
manual { return MANUAL; }
uid { return UID; }
gid { return GID; }
request { return REQUEST; }
secret { return SECRET; }
loglimit { return LOGLIMIT; }
closelimit { return CLOSELIMIT; }
dnslimit { return DNSLIMIT; }
keepalivelimit { return KEEPALIVELIMIT; }
replylimit { return REPLYLIMIT; }
requestlimit { return REQUESTLIMIT; }
startlimit { return STARTLIMIT; }
waitlimit { return WAITLIMIT; }
gracefullimit { return GRACEFULLIMIT; }
cleanuplimit { return CLEANUPLIMIT; }
mem(ory)? { return MEMORY; }
swap { return SWAP; }
totalmem(ory)? { return TOTALMEMORY; }
cpu { return CPU; }
totalcpu { return TOTALCPU; }
child(ren) { return CHILDREN; }
timestamp { return TIMESTAMP; }
changed { return CHANGED; }
second(s)? { return SECOND; }
minute(s)? { return MINUTE; }
hour(s)? { return HOUR; }
day(s)? { return DAY; }
sslv2 { return SSLV2; }
sslv3 { return SSLV3; }
tlsv1 { return TLSV1; }
sslauto { return SSLAUTO; }
inode(s)? { return INODE; }
space { return SPACE; }
perm(ission)? { return PERMISSION; }
exec(ute)? { return EXEC; }
size { return SIZE; }
basedir { return BASEDIR; }
slot(s)? { return SLOT; }
eventqueue { return EVENTQUEUE; }
match(ing)? { return MATCH; }
not { return NOT; }
ignore { return IGNORE; }
connection { return CONNECTION; }
unmonitor { return UNMONITOR; }
action { return ACTION; }
icmp { return ICMP; }
echo { return ICMPECHO; }
send { return SEND; }
expect { return EXPECT; }
expectbuffer { return EXPECTBUFFER; }
cleartext { return CLEARTEXT; }
md5 { return MD5HASH; }
sha1 { return SHA1HASH; }
crypt { return CRYPT; }
signature { return SIGNATURE; }
nonexist { return NONEXIST; }
exist { return EXIST; }
invalid { return INVALID; }
data { return DATA; }
recovered { return RECOVERED; }
passed { return PASSED; }
succeeded { return SUCCEEDED; }
else { return ELSE; }
mmonit { return MMONIT; }
url { return URL; }
content { return CONTENT; }
pid { return PID; }
ppid { return PPID; }
count { return COUNT; }
reminder { return REMINDER; }
instance { return INSTANCE; }
hostname { return HOSTNAME; }
username { return USERNAME; }
password { return PASSWORD; }
credentials { return CREDENTIALS; }
register { return REGISTER; }
fsflag(s)? { return FSFLAG; }
fips { return FIPS; }
{byte} { return BYTE; }
{kilobyte} { return KILOBYTE; }
{megabyte} { return MEGABYTE; }
{gigabyte} { return GIGABYTE; }
{loadavg1} { return LOADAVG1; }
{loadavg5} { return LOADAVG5; }
{loadavg15} { return LOADAVG15; }
{cpuuser} { return CPUUSER; }
{cpusyst} { return CPUSYSTEM; }
{cpuwait} { return CPUWAIT; }
{greater} { return GREATER; }
{less} { return LESS; }
{equal} { return EQUAL; }
{notequal} { return NOTEQUAL; }
include { BEGIN(INCLUDE); }
depend(s)?[ \t]+(on[ \t]*)? {
BEGIN(DEPEND_COND);
return DEPENDS;
}
check[ \t]+(process[ \t])? {
BEGIN(SERVICE_COND);
return CHECKPROC;
}
check[ \t]+device { /* Filesystem alias for backward compatibility */
BEGIN(SERVICE_COND);
return CHECKFILESYS;
}
check[ \t]+filesystem {
BEGIN(SERVICE_COND);
return CHECKFILESYS;
}
check[ \t]+file {
BEGIN(SERVICE_COND);
return CHECKFILE;
}
check[ \t]+directory {
BEGIN(SERVICE_COND);
return CHECKDIR;
}
check[ \t]+host {
BEGIN(SERVICE_COND);
return CHECKHOST;
}
check[ \t]+system {
BEGIN(SERVICE_COND);
return CHECKSYSTEM;
}
check[ \t]+fifo {
BEGIN(SERVICE_COND);
return CHECKFIFO;
}
check[ \t]+status {
BEGIN(SERVICE_COND);
return CHECKSTATUS;
}
group[ \t]+ {
BEGIN(STRING_COND);
return GROUP;
}
[a-zA-Z0-9]+"://" {
yylval.url=
create_URL(xstrndup(yytext, strlen(yytext)-3));
BEGIN(URL_COND);
}
{number} {
yylval.number= atoi(yytext);
save_arg(); return NUMBER;
}
{real} {
yylval.real= atof(yytext);
save_arg(); return REAL;
}
{percent} {
return PERCENT;
}
[a-zA-Z0-9]{str} {
yylval.string= xstrdup(yytext);
save_arg(); return STRING;
}
\"[/][^\"\n]*\" {
yylval.string= handle_quoted_string(yytext);
save_arg(); return PATH;
}
\'[/][^\'\n]*\' {
yylval.string= handle_quoted_string(yytext);
save_arg(); return PATH;
}
\"[^\"]*\" {
steplinenobycr(yytext);
yylval.string= handle_quoted_string(yytext);
save_arg(); return STRING;
}
\'[^\']*\' {
steplinenobycr(yytext);
yylval.string= handle_quoted_string(yytext);
save_arg(); return STRING;
}
{str}[@]{str} {
yylval.string= xstrdup(yytext);
save_arg(); return MAILADDR;
}
[/]{str} {
yylval.string= xstrdup(yytext);
save_arg(); return PATH;
}
"/" {
yylval.string= xstrdup(yytext);
save_arg(); return PATH;
}
"from:"[ \t]*{str}[@]{str} {
char *p= yytext+strlen("from:");
yylval.string = Util_trim(xstrdup(p));
save_arg(); return MAILFROM;
}
"reply-to:"[ \t]*{str}[@]{str} {
char *p= yytext+strlen("reply-to:");
yylval.string = Util_trim(xstrdup(p));
save_arg(); return MAILREPLYTO;
}
"subject:"[^}\n]* {
char *p= yytext+strlen("subject:");
yylval.string = Util_trim(xstrdup(p));
save_arg(); return MAILSUBJECT;
}
"message:"[^}]* {
char *p= yytext+strlen("message:");
steplinenobycr(yytext);
yylval.string = Util_trim(xstrdup(p));
save_arg(); return MAILBODY;
}
{hostname} {
yylval.string = xstrdup(yytext);
save_arg(); return STRING;
}
[\"\'] {
yyerror("unbalanced quotes");
}
<SERVICE_COND>{
{ws} ;
[\n] {
lineno++;
}
{str} {
yylval.string= xstrdup(yytext);
BEGIN(INITIAL);
save_arg(); return SERVICENAME;
}
\"{str}\" {
yylval.string= handle_quoted_string(yytext);
BEGIN(INITIAL);
save_arg(); return SERVICENAME;
}
\'{str}\' {
yylval.string= handle_quoted_string(yytext);
BEGIN(INITIAL);
save_arg(); return SERVICENAME;
}
[\"\'] {
yyerror("unbalanced quotes");
}
}
<DEPEND_COND>{
{wws} ;
{wws}?[\n]{wws}? {
lineno++;
}
{str} {
yylval.string= xstrdup(yytext);
save_arg(); return SERVICENAME;
}
[ \r\n\t]+[^,] {
steplinenobycr(yytext);
unput(yytext[strlen(yytext)-1]);
BEGIN(INITIAL);
}
}
<ARGUMENT_COND>{
{ws} ;
[\n] {
lineno++;
}
\" {
BEGIN(INITIAL);
}
\'[^\']*\' {
steplinenobycr(yytext);
yylval.string= handle_quoted_string(yytext);
save_arg(); return STRING;
}
\' {
yyerror("unbalanced quotes");
}
[^ \t\n\"]+ {
yylval.string= xstrdup(yytext);
save_arg(); return STRING;
}
}
<URL_COND>{
{ws}|[\n] {
BEGIN(INITIAL);
if(!yylval.url->hostname)
yyerror("missing hostname in URL");
if(!yylval.url->path)
yylval.url->path= xstrdup("/");
yylval.url->url= Util_getString("%s://%s:%d%s%s%s",
yylval.url->protocol,
/* possible credentials are hidden */
yylval.url->hostname,
yylval.url->port,
yylval.url->path,
yylval.url->query?"?":"",
yylval.url->query?yylval.url->query:"");
save_arg(); return URLOBJECT;
}
[^:@ ]+/[:][^@: ]+[@] {
yylval.url->user= xstrdup(yytext);
}
[:][^@ ]+[@] {
yytext++;
yylval.url->password= xstrndup(yytext, strlen(yytext)-1);
}
[^/?:#\r\n ]+ {
yylval.url->hostname= xstrdup(yytext);
}
[:]{number} {
yylval.url->port= atoi(++yytext);
}
[/][^?#\r\n ]* {
yylval.url->path= Util_urlEncode(yytext);
}
[?][^#\r\n ]* {
yylval.url->query= Util_urlEncode(++yytext);
}
[#][^\r\n ]* {
/* EMPTY - reference is ignored */
}
}
<STRING_COND>{
{str} {
yylval.string= xstrdup(yytext);
BEGIN(INITIAL);
save_arg(); return STRINGNAME;
}
\"{str}\" {
yylval.string= handle_quoted_string(yytext);
BEGIN(INITIAL);
save_arg(); return STRINGNAME;
}
\'{str}\' {
yylval.string= handle_quoted_string(yytext);
BEGIN(INITIAL);
save_arg(); return STRINGNAME;
}
[\"\'] {
yyerror("unbalanced quotes");
}
}
<INITIAL,ARGUMENT_COND,SERVICE_COND,DEPEND_COND,URL_COND,STRING_COND>. {
return yytext[0];
}
<INCLUDE>[ \t]* /* eat the whitespace */
<INCLUDE>\"[^\"\r\n]+\" { /* got the include file name with double quotes */
char *temp=xstrdup(yytext);
Util_trimQuotes(temp);
include_file(temp);
FREE(temp);
BEGIN(INITIAL);
}
<INCLUDE>\'[^\'\r\n]+\' { /* got the include file name with single quotes*/
char *temp=xstrdup(yytext);
Util_trimQuotes(temp);
include_file(temp);
FREE(temp);
BEGIN(INITIAL);
}
<INCLUDE>[^ \t\r\n]+ { /* got the include file name without quotes*/
char *temp=xstrdup(yytext);
include_file(temp);
FREE(temp);
BEGIN(INITIAL);
}
<<EOF>> {
if ( !pop_buffer_state() )
{
yyterminate();
} else {
BEGIN(INITIAL);
}
}
%%
/*
* Do lineno++ for every occurrence of '\n' in a string. This is
* necessary whenever a yytext has an unknown number of CRs.
*/
static void steplinenobycr(char *string) {
char *pos= string;
while(*pos)
if('\n'==*pos++) {
lineno++;
}
}
static char *handle_quoted_string(char *string) {
char *buf= xstrdup(string);
Util_trimQuotes(buf);
Util_handleEscapes(buf);
return buf;
}
static void include_file(char *pattern) {
glob_t globbuf;
int i;
if ( glob(pattern, GLOB_MARK, NULL, &globbuf) != 0 ) {
yywarning("include files not found");
return;
}
for (i = 0; i < globbuf.gl_pathc; i++) {
FILE *yyin;
int filename_length = strlen(globbuf.gl_pathv[i]);
/* check whenever we have caught a directory
* or file backup copy */
if ((filename_length == 0) ||
(globbuf.gl_pathv[i][filename_length-1] == '~' ) ||
(globbuf.gl_pathv[i][filename_length-1] == '/' )) {
continue;
}
yyin = fopen( globbuf.gl_pathv[i], "r" );
if ( ! yyin ) {
yyerror( "failed to include file" );
} else {
push_buffer_state(yy_create_buffer( yyin, YY_BUF_SIZE ), globbuf.gl_pathv[i]);
}
}
globfree(&globbuf);
}
static void push_buffer_state(YY_BUFFER_STATE buffer, char *filename) {
if ( buffer_stack_ptr >= MAX_STACK_DEPTH )
{
yyerror("include files are nested too deeply" );
exit( 1 );
}
buffer_stack[buffer_stack_ptr].lineno = lineno;
buffer_stack[buffer_stack_ptr].currentfile = currentfile;
buffer_stack[buffer_stack_ptr].buffer = YY_CURRENT_BUFFER;
buffer_stack_ptr++;
lineno = 1;
currentfile = xstrdup(filename);
yy_switch_to_buffer(buffer);
BEGIN(INITIAL);
}
static int pop_buffer_state(void) {
if ( --buffer_stack_ptr < 0 ) {
return 0;
} else {
fclose(yyin);
lineno=buffer_stack[buffer_stack_ptr].lineno;
FREE(currentfile);
currentfile=buffer_stack[buffer_stack_ptr].currentfile;
yy_delete_buffer( YY_CURRENT_BUFFER );
yy_switch_to_buffer( buffer_stack[buffer_stack_ptr].buffer );
}
return 1;
}
static void save_arg(void) {
arglineno=lineno;
argcurrentfile=currentfile;
FREE(argyytext);
argyytext=xstrdup(yytext);
}
static URL_T create_URL(char *proto) {
URL_T url;
ASSERT(proto);
NEW(url);
url->protocol= proto;
if(IS(url->protocol, "https")) {
url->port= 443;
if(!have_ssl())
yyerror("HTTPS protocol not supported -- SSL support disabled" );
} else if(IS(url->protocol, "http")) {
url->port= 80;
} else {
yyerror("URL protocol not supported -- ");
}
return url;
}