diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-18 12:20:51 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-05-18 12:20:51 +0000 |
commit | add560e4e3c55b2481ab7c691be055f3095667a4 (patch) | |
tree | 0fda9abc2b39abde651470d705567f747808e45b /src/main.c | |
parent | 0891f1ede52fc72aaa77a8c0cc29951f8552b6d1 (diff) | |
download | cflow-add560e4e3c55b2481ab7c691be055f3095667a4.tar.gz cflow-add560e4e3c55b2481ab7c691be055f3095667a4.tar.bz2 |
Update for the recent gnulib
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -20,7 +20,6 @@ | |||
20 | #include <argp.h> | 20 | #include <argp.h> |
21 | #include <stdarg.h> | 21 | #include <stdarg.h> |
22 | #include <parser.h> | 22 | #include <parser.h> |
23 | #include <strndup.h> | ||
24 | 23 | ||
25 | const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION; | 24 | const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION; |
26 | const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; | 25 | const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; |
@@ -214,11 +213,13 @@ int omit_symbol_names_option; /* Omit symbol name from symbol declaration string | |||
214 | #define SM_STATIC 0x0004 | 213 | #define SM_STATIC 0x0004 |
215 | #define SM_UNDERSCORE 0x0008 | 214 | #define SM_UNDERSCORE 0x0008 |
216 | #define SM_TYPEDEF 0x0010 | 215 | #define SM_TYPEDEF 0x0010 |
216 | #define SM_UNDEFINED 0x0020 | ||
217 | 217 | ||
218 | #define CHAR_TO_SM(c) ((c)=='x' ? SM_DATA : \ | 218 | #define CHAR_TO_SM(c) ((c)=='x' ? SM_DATA : \ |
219 | (c)=='_' ? SM_UNDERSCORE : \ | 219 | (c)=='_' ? SM_UNDERSCORE : \ |
220 | (c)=='s' ? SM_STATIC : \ | 220 | (c)=='s' ? SM_STATIC : \ |
221 | (c)=='t' ? SM_TYPEDEF : 0) | 221 | (c)=='t' ? SM_TYPEDEF : \ |
222 | (c)=='u' ? SM_UNDEFINED : 0) | ||
222 | #define SYMBOL_INCLUDE(c) (symbol_map |= CHAR_TO_SM(c)) | 223 | #define SYMBOL_INCLUDE(c) (symbol_map |= CHAR_TO_SM(c)) |
223 | #define SYMBOL_EXCLUDE(c) (symbol_map &= ~CHAR_TO_SM(c)) | 224 | #define SYMBOL_EXCLUDE(c) (symbol_map &= ~CHAR_TO_SM(c)) |
224 | int symbol_map; /* A bitmap of symbols included in the graph. */ | 225 | 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) | |||
593 | case '_': | 594 | case '_': |
594 | case 's': | 595 | case 's': |
595 | case 't': | 596 | case 't': |
597 | case 'u': | ||
596 | if (num) | 598 | if (num) |
597 | SYMBOL_INCLUDE(*arg); | 599 | SYMBOL_INCLUDE(*arg); |
598 | else | 600 | else |
@@ -710,6 +712,10 @@ include_symbol(Symbol *sym) | |||
710 | type |= SM_DATA; | 712 | type |= SM_DATA; |
711 | else if (sym->arity >= 0) | 713 | else if (sym->arity >= 0) |
712 | type |= SM_FUNCTIONS; | 714 | type |= SM_FUNCTIONS; |
715 | |||
716 | if (!sym->source) | ||
717 | type |= SM_UNDEFINED; | ||
718 | |||
713 | } else if (sym->type == SymToken) { | 719 | } else if (sym->type == SymToken) { |
714 | if (sym->token_type == TYPE && sym->source) | 720 | if (sym->token_type == TYPE && sym->source) |
715 | type |= SM_TYPEDEF; | 721 | type |= SM_TYPEDEF; |
@@ -755,7 +761,7 @@ main(int argc, char **argv) | |||
755 | register_output("gnu", gnu_output_handler, NULL); | 761 | register_output("gnu", gnu_output_handler, NULL); |
756 | register_output("posix", posix_output_handler, NULL); | 762 | register_output("posix", posix_output_handler, NULL); |
757 | 763 | ||
758 | symbol_map = SM_FUNCTIONS|SM_STATIC; | 764 | symbol_map = SM_FUNCTIONS|SM_STATIC|SM_UNDEFINED; |
759 | 765 | ||
760 | if (getenv("POSIXLY_CORRECT")) { | 766 | if (getenv("POSIXLY_CORRECT")) { |
761 | if (select_output_driver("posix")) | 767 | if (select_output_driver("posix")) |