version 1.10, 2003/06/03 02:56:21 |
version 1.11, 2003/06/30 18:37:48 |
|
|
/* $OpenBSD$ */ |
/* $OpenBSD$ */ |
/* |
/* |
|
* Copyright (c) 2002, 2003 Tony Finch <dot@dotat.at> |
* Copyright (c) 1985, 1993 |
* Copyright (c) 1985, 1993 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
* |
* |
|
|
{ |
{ |
int opt; |
int opt; |
|
|
while ((opt = getopt(argc, argv, "i:D:U:cdeklst")) != -1) |
while ((opt = getopt(argc, argv, "i:D:U:I:cdeklst")) != -1) |
switch (opt) { |
switch (opt) { |
case 'i': /* treat stuff controlled by these symbols as text */ |
case 'i': /* treat stuff controlled by these symbols as text */ |
/* |
/* |
|
|
case 'U': /* undef a symbol */ |
case 'U': /* undef a symbol */ |
addsym(false, false, optarg); |
addsym(false, false, optarg); |
break; |
break; |
|
case 'I': |
|
/* no-op for compatibility with cpp */ |
|
break; |
case 'c': /* treat -D as -U and vice versa */ |
case 'c': /* treat -D as -U and vice versa */ |
complement = true; |
complement = true; |
break; |
break; |
|
|
|
|
/* |
/* |
* Skip over comments and stop at the next character position that is |
* Skip over comments and stop at the next character position that is |
* not whitespace. Between calls we keep the comment state in a global |
* not whitespace. Between calls we keep the comment state in the |
* variable, and we also make a note when we get a proper end-of-line. |
* global variable incomment, and we also adjust the global variable |
|
* linestate when we see a newline. |
* XXX: doesn't cope with the buffer splitting inside a state transition. |
* XXX: doesn't cope with the buffer splitting inside a state transition. |
*/ |
*/ |
static const char * |
static const char * |
skipcomment(const char *cp) |
skipcomment(const char *cp) |
{ |
{ |
if (text || ignoring[depth]) { |
if (text || ignoring[depth]) { |
while (isspace((unsigned char)*cp)) |
for (; isspace((unsigned char)*cp); cp++) |
cp += 1; |
if (*cp == '\n') |
|
linestate = LS_START; |
return (cp); |
return (cp); |
} |
} |
while (*cp != '\0') |
while (*cp != '\0') |