aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-05-18 12:20:51 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-05-18 12:20:51 +0000
commitadd560e4e3c55b2481ab7c691be055f3095667a4 (patch)
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')
-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 @@
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
25const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION; 24const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION;
26const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; 25const 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))
224int symbol_map; /* A bitmap of symbols included in the graph. */ 225int 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"))

Return to:

Send suggestions and report system problems to the System administrator.