summaryrefslogtreecommitdiffabout
path: root/src/main.c
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-18 12:20:51 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2007-05-18 12:20:51 (GMT)
commitadd560e4e3c55b2481ab7c691be055f3095667a4 (patch) (side-by-side diff)
tree0fda9abc2b39abde651470d705567f747808e45b /src/main.c
parent0891f1ede52fc72aaa77a8c0cc29951f8552b6d1 (diff)
downloadcflow-add560e4e3c55b2481ab7c691be055f3095667a4.tar.gz
cflow-add560e4e3c55b2481ab7c691be055f3095667a4.tar.bz2
Update for the recent gnulib
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 3e933d9..78f615d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -20,7 +20,6 @@
#include <argp.h>
#include <stdarg.h>
#include <parser.h>
-#include <strndup.h>
const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION;
const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
@@ -214,11 +213,13 @@ int omit_symbol_names_option; /* Omit symbol name from symbol declaration string
#define SM_STATIC 0x0004
#define SM_UNDERSCORE 0x0008
#define SM_TYPEDEF 0x0010
+#define SM_UNDEFINED 0x0020
#define CHAR_TO_SM(c) ((c)=='x' ? SM_DATA : \
(c)=='_' ? SM_UNDERSCORE : \
(c)=='s' ? SM_STATIC : \
- (c)=='t' ? SM_TYPEDEF : 0)
+ (c)=='t' ? SM_TYPEDEF : \
+ (c)=='u' ? SM_UNDEFINED : 0)
#define SYMBOL_INCLUDE(c) (symbol_map |= CHAR_TO_SM(c))
#define SYMBOL_EXCLUDE(c) (symbol_map &= ~CHAR_TO_SM(c))
int symbol_map; /* A bitmap of symbols included in the graph. */
@@ -593,6 +594,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
case '_':
case 's':
case 't':
+ case 'u':
if (num)
SYMBOL_INCLUDE(*arg);
else
@@ -710,6 +712,10 @@ include_symbol(Symbol *sym)
type |= SM_DATA;
else if (sym->arity >= 0)
type |= SM_FUNCTIONS;
+
+ if (!sym->source)
+ type |= SM_UNDEFINED;
+
} else if (sym->type == SymToken) {
if (sym->token_type == TYPE && sym->source)
type |= SM_TYPEDEF;
@@ -755,7 +761,7 @@ main(int argc, char **argv)
register_output("gnu", gnu_output_handler, NULL);
register_output("posix", posix_output_handler, NULL);
- symbol_map = SM_FUNCTIONS|SM_STATIC;
+ symbol_map = SM_FUNCTIONS|SM_STATIC|SM_UNDEFINED;
if (getenv("POSIXLY_CORRECT")) {
if (select_output_driver("posix"))

Return to:

Send suggestions and report system problems to the System administrator.