diff -r -c cshow-0.2-pre2/CHANGENOTES cshow-0.3/CHANGENOTES *** cshow-0.2-pre2/CHANGENOTES Fri Mar 10 09:38:50 2000 --- cshow-0.3/CHANGENOTES Mon Jul 15 15::53:00 2002 *************** *** 1,3 **** --- 1,10 ---- + cshow 0.3 + o Shankar Chakkere added following options + -i, --ignorecase : Ignore case. + -l, --taglength n : Check only the first 'n' characters of tag names. + -a, --all : List all tag matches. + -b, --brief : List in brief. + cshow 0.2-pre2: o documentation updates: a lot of new BUGS. In particular, discovery of a difficult bug (lines preceding the diff -r -c cshow-0.2-pre2/cshow.1 cshow-0.3/cshow.1 *** cshow-0.2-pre2/cshow.1 Sun Jan 30 17:37:46 2000 --- cshow-0.3/cshow.1 Mon Jul 15 15:50:000 2002 *************** *** 6,17 **** cshow - show the definition of a C-identifier .SH SYNOPSIS ! .B cshow [-r .I dir .B ][-o .I file .B ][-t .I type spec .B ] identifier .SH DESCRIPTION --- 6,19 ---- cshow - show the definition of a C-identifier .SH SYNOPSIS ! .B cshow [-i] [-a] [-b] [-r .I dir .B ][-o .I file .B ][-t .I type spec + .B ][-l + .I tag length .B ] identifier .SH DESCRIPTION *************** *** 25,30 **** --- 27,38 ---- print its definition to the output (optionnaly a file). .SH OPTIONS + .IP "-i, --ignorecase" + Ignore case. + .IP "-a, --all" + List all tag matches. + .IP "-b, --brief" + List in brief, does not prints the whole function. .IP "-r, --rootdir dir" The directory where the source files and the "tags" file reside. .IP "-o, --output filename" *************** *** 33,38 **** --- 41,48 ---- Indicates the type of identifier. This can either be a one character type specifier, or a string. See TYPE SPECIFIERS. + .IP "-l, --taglength n" + Check only the first 'n' characters of tag names. .IP "-h, --help" .IP "-v, --version" Show version and help information. *************** *** 110,113 **** .SH AUTHOR Ben De Rydt ! --- 120,124 ---- .SH AUTHOR Ben De Rydt ! .br ! Shankar Chakkere added the -i, -a, -b and -l options. diff -r -c cshow-0.2-pre2/cshow.c cshow-0.3/cshow.c *** cshow-0.2-pre2/cshow.c Sun Jan 30 16:40:00 2000 --- cshow-0.3/cshow.c Mon Jul 15 16:15:446 2002 *************** *** 15,20 **** --- 15,26 ---- char *rootdir; char *outputfilename; enum e_identifier_type id_type; + /* Jul 03, 2002 02:48 PM Shankar Chakkere */ + int tag_length; + enum icase case_type; + enum iall all; + /* Jul 15, 2002 02:57 PM for -b , --brief option */ + enum ibrief brief; }; /* returns an error value out of "error.h" */ int search_line (struct print_io *io, struct search_pattern *spat); *************** *** 27,85 **** struct params param; struct tag_entry entry; struct print_io io; int i; ! if (parse_commandline (argc, argv, ¶m) < 0) return EXIT_FAILURE; ! create_tag_entry (&entry, param.identifier, param.id_type); ! if (lookup_tags (&entry, param.rootdir) < 0) { ! return EXIT_FAILURE; ! } ! if ((io.in = fopen(entry.filename, "r")) == NULL) { ! fprintf(stderr, "Couldn't open file: %s\n", entry.filename); ! destroy_tag_entry (&entry); ! return EXIT_FAILURE; ! } ! if ((io.buffer = (char *)malloc(MAX_LINE)) == NULL) { ! fputs ("Malloc error\n", stderr); ! destroy_tag_entry (&entry); ! fclose(io.in); ! return EXIT_FAILURE; ! } ! io.buffer_len = MAX_LINE; ! if (param.outputfilename == NULL) ! io.out = stdout; ! else if ((io.out = fopen (param.outputfilename, "w")) == NULL) { ! fprintf (stderr, "Couldn't open %s for writing!\n", ! param.outputfilename); ! destroy_tag_entry (&entry); ! fclose(io.in); ! free(io.buffer); return EXIT_FAILURE; } ! ! if (search_line (&io, &entry.spat) < 0) { ! if (entry.spat.is_line_no) ! fprintf (stderr, "Couldn't find the line: %ld\n", ! entry.spat.pat.line_no); ! else ! fprintf (stderr, "Couldn't find the line: %s\n", ! entry.spat.pat.search_line); ! destroy_tag_entry(&entry); ! free_and_close_io(&io); return EXIT_FAILURE; } ! switch (entry.spat.delim) { ! case COMMA: i = print_comma_delimited (&io); ! break; ! case SEMICOLON: i = print_semicolon_delimited (&io); ! break; ! case EOL: i = print_definition (&io); ! break; ! case OPEN_CLOSE_BRACKET: i = print_function_body (&io); ! break; ! } ! destroy_tag_entry (&entry); free_and_close_io(&io); if (i < 0) return EXIT_FAILURE; else return EXIT_SUCCESS; --- 33,125 ---- struct params param; struct tag_entry entry; struct print_io io; + /* Jul 08, 2002 03:47 PM for linked list*/ + struct tag_entry list; + int i; ! /* Jul 09, 2002 02:25 PM */ ! io.out = NULL; ! if (parse_commandline (argc, argv, ¶m) < 0) return EXIT_FAILURE; ! /* Jul 10, 2002 10:50 AM Check for valid tag length ! */ ! if((param.tag_length < 0)||(param.tag_length > strlen(param.identifier))) { ! fprintf(stderr,"Invalid taglength: %d\n", param.tag_length); return EXIT_FAILURE; } ! create_tag_entry (&list, param.identifier, param.id_type,param.case_type, param.tag_length, param.all); ! if (lookup_tags (&list, param.rootdir) < 0) { return EXIT_FAILURE; } ! /* Jul 08, 2002 03:46 PM Shankar added for -a option */ ! entry = list; ! do ! { ! ! if ((io.in = fopen(entry.filename, "r")) == NULL) { ! fprintf(stderr, "Couldn't open file: %s\n", entry.filename); ! destroy_tag_entry (&entry); ! return EXIT_FAILURE; ! } ! if ((io.buffer = (char *)malloc(MAX_LINE)) == NULL) { ! fputs ("Malloc error\n", stderr); ! destroy_tag_entry (&entry); ! fclose(io.in); ! return EXIT_FAILURE; ! } ! io.buffer_len = MAX_LINE; ! /* Jul 09, 2002 02:26 PM */ ! if (io.out == NULL) ! /* do not open the file again */ ! { ! if (param.outputfilename == NULL) ! io.out = stdout; ! else if ((io.out = fopen (param.outputfilename, "w")) == NULL) { ! fprintf (stderr, "Couldn't open %s for writing!\n", ! param.outputfilename); ! destroy_tag_entry (&entry); ! fclose(io.in); ! free(io.buffer); ! return EXIT_FAILURE; ! } ! ! } ! if (search_line (&io, &entry.spat) < 0) { ! if (entry.spat.is_line_no) ! fprintf (stderr, "Couldn't find the line: %ld\n", ! entry.spat.pat.line_no); ! else ! fprintf (stderr, "Couldn't find the line: %s\n", ! entry.spat.pat.search_line); ! destroy_tag_entry(&entry); ! free_and_close_io(&io); ! return EXIT_FAILURE; ! } ! /* Jul 03, 2002 06:03 PM print file information */ ! fprintf(io.out,"\"%s\" %s:%d\n",entry.identifier,entry.filename, entry.spat.line_number); ! ! ! switch (entry.spat.delim) { ! case COMMA: i = print_comma_delimited (&io,param.brief); ! break; ! case SEMICOLON: i = print_semicolon_delimited (&io, param.brief); ! break; ! case EOL: i = print_definition (&io); ! break; ! case OPEN_CLOSE_BRACKET: i = print_function_body (&io,param.brief); ! break; ! } ! if ((param.all == YES) && (entry.next != NULL)) ! /* get next entry in linked list */ ! list=*entry.next; ! destroy_tag_entry (&entry); ! entry = list; ! /* seperate two listing */ ! if (entry.next !=NULL) ! fprintf(io.out, "-------------------------------------------------------------------------------\n"); ! }while(entry.next != NULL); ! free_and_close_io(&io); if (i < 0) return EXIT_FAILURE; else return EXIT_SUCCESS; *************** *** 105,140 **** NOTHING, OUTPUTFILE, ROOTDIR, ! TYPESPEC } prev_option = NOTHING; par->rootdir = NULL; par->identifier = NULL; par->outputfilename = NULL; par->id_type = IT_NONE; for (i = 1; i < argc; i++) { if (prev_option == NOTHING) { ! if (strcmp (argv[i], "-o") == 0 || ! strcmp (argv[i], "--output") == 0) prev_option = OUTPUTFILE; ! else if (strcmp (argv[i], "-r") == 0 || strcmp (argv[i], "--rootdir") == 0) prev_option = ROOTDIR; ! else if (strcmp (argv[i], "-t") == 0 || strcmp (argv[i], "--type") == 0) prev_option = TYPESPEC; ! else if (strcmp (argv[i], "-h") == 0 || strcmp (argv[i], "--help") == 0) { ! usage(); ! return -EILLEGAL; ! } ! else if (strcmp (argv[i], "-v") == 0 || strcmp (argv[i], "--version") == 0) { ! version(); ! return -EILLEGAL; ! } ! else if (par->identifier == NULL) par->identifier = argv[i]; ! else return ! wrong_commandline ("Only one C-identifier is allowed!\n"); } else { ! switch (prev_option) { case OUTPUTFILE: if (par->outputfilename == NULL) par->outputfilename = argv[i]; --- 145,201 ---- NOTHING, OUTPUTFILE, ROOTDIR, ! TYPESPEC, ! /* Jul 03, 2002 12:18 PM Shankar Chakkere */ ! TAGLENGTH } prev_option = NOTHING; par->rootdir = NULL; par->identifier = NULL; par->outputfilename = NULL; par->id_type = IT_NONE; + /* Jul 03, 2002 12:18 PM Shankar Chakkere */ + par->case_type = FALSE; + par->tag_length = 0; + par->all = NO; + par->brief = NOBRIEF; + for (i = 1; i < argc; i++) { if (prev_option == NOTHING) { ! if (strcmp (argv[i], "-o") == 0 || ! strcmp (argv[i], "--output") == 0) prev_option = OUTPUTFILE; ! else if (strcmp (argv[i], "-r") == 0 || strcmp (argv[i], "--rootdir") == 0) prev_option = ROOTDIR; ! else if (strcmp (argv[i], "-t") == 0 || strcmp (argv[i], "--type") == 0) prev_option = TYPESPEC; ! /* Jul 03, 2002 12:18 PM Shankar Chakkere ! * New options -i -l and -a ! */ ! else if (strcmp (argv[i], "-i") == 0 || ! strcmp (argv[i], "--ignorecase") == 0) par->case_type = TRUE; ! else if (strcmp (argv[i], "-l") == 0 || ! strcmp (argv[i], "--taglength") == 0) prev_option = TAGLENGTH; ! else if (strcmp (argv[i], "-a") == 0 || ! strcmp (argv[i], "--all") == 0) par->all = YES; ! else if (strcmp (argv[i], "-b") == 0 || ! strcmp (argv[i], "--brief") == 0) par->brief = BRIEF; ! /* .. */ ! else if (strcmp (argv[i], "-h") == 0 || strcmp (argv[i], "--help") == 0) { ! usage(); ! return -EILLEGAL; ! } ! else if (strcmp (argv[i], "-v") == 0 || strcmp (argv[i], "--version") == 0) { ! version(); ! return -EILLEGAL; ! } ! else if (par->identifier == NULL) par->identifier = argv[i]; ! else return ! wrong_commandline ("Only one C-identifier is allowed!\n"); } else { ! /* Get options */ ! switch (prev_option) { case OUTPUTFILE: if (par->outputfilename == NULL) par->outputfilename = argv[i]; *************** *** 161,167 **** } else return wrong_commandline ("Only one type specifier allowed!\n"); break; ! default: } prev_option = NOTHING; } --- 222,232 ---- } else return wrong_commandline ("Only one type specifier allowed!\n"); break; ! /* Jul 03, 2002 12:18 PM Shankar Chakkere */ ! case TAGLENGTH: ! if (par->tag_length == 0) par->tag_length = atoi(argv[i]); ! break; ! default: } prev_option = NOTHING; } *************** *** 174,189 **** --- 239,262 ---- int search_line (struct print_io *io, struct search_pattern *spat) { + /* Jul 03, 2002 05:54 PM to print line number */ + int line = 0; if (spat->is_line_no) { unsigned long i = spat->pat.line_no; while (i--) if (fgets (io->buffer, io->buffer_len, io->in) == NULL) return -ENOT_FOUND; + /* Jul 09, 2002 12:24 PM return line number for defines */ + spat->line_number = spat->pat.line_no; /* the line number */ return EOK; } else { while (fgets (io->buffer, io->buffer_len, io->in)) { + line++; if (strncmp (io->buffer, spat->pat.search_line, MAX_LINE) == 0) + { + spat->line_number = line; /* the line number */ return EOK; + } } return -ENOT_FOUND; } *************** *** 199,205 **** { version(); puts ("\ ! Usage: cshow [-r rootdir] [-o filename] [-t typespec] identifier\n\ cshow [-h|--help]\n\ cshow -v|--version\n\ identifier : A valid C-identifier who's \"definition\" should\n\ --- 272,279 ---- { version(); puts ("\ ! Usage: cshow [-i] [-a] [-b] [-r rootdir] [-o filename] [-t typespec]\n\ ! [-l taglength] identifier\n\ cshow [-h|--help]\n\ cshow -v|--version\n\ identifier : A valid C-identifier who's \"definition\" should\n\ *************** *** 212,217 **** --- 286,295 ---- output will be send to stdout.\n\ -t, --type typespec : a type specifier. For a list of valid type specifiers,\n\ type \"cshow -t help\".\n\ + -i, --ignorecase : Ignore case.\n\ + -l, --taglength n : Check only the first 'n' characters of tag names.\n\ + -a, --all : List all tag matches.\n\ + -b, --brief : List briefly.\n\ -h, --help : Show this information.\n\ -v, --version : Show the version info.\n\ \n\ diff -r -c cshow-0.2-pre2/identifiertype.h cshow-0.3/identifiertype.h *** cshow-0.2-pre2/identifiertype.h Sun Jan 30 16:27:02 2000 --- cshow-0.3/identifiertype.h Mon Jul 115 15:14:40 2002 *************** *** 25,29 **** void print_valid_identifier_types (FILE *fp); char *get_identifier_type_str (enum e_identifier_type id_type); ! #endif --- 25,35 ---- void print_valid_identifier_types (FILE *fp); char *get_identifier_type_str (enum e_identifier_type id_type); ! /*Jul 03, 2002 01:54 PM Shankar Chakkere */ ! enum icase { FALSE = 0, TRUE = 1}; ! /* Jul 08, 2002 04:52 PM for -a --all option */ ! enum iall { NO = 0, YES = 1}; ! /* Jul 15, 2002 02:57 PM for -b , --brief option enum ibrief{NOBRIEF, BRIEF} brief = NOBRIEF; ! */ ! enum ibrief{NOBRIEF, BRIEF}; #endif diff -r -c cshow-0.2-pre2/lookup.c cshow-0.3/lookup.c *** cshow-0.2-pre2/lookup.c Fri Mar 10 09:34:02 2000 --- cshow-0.3/lookup.c Tue Jul 16 14:17::42 2002 *************** *** 10,23 **** #define TAG_FILE_FORMAT_STRING "!_TAG_FILE_FORMAT" void create_tag_entry (struct tag_entry *entry, char *identifier, ! enum e_identifier_type id_type) { entry->identifier = identifier; entry->id_type = id_type; entry->filename = NULL; entry->spat.is_line_no = 0; entry->spat.pat.search_line = NULL; } void destroy_search_pattern (struct search_pattern *spat) --- 10,32 ---- #define TAG_FILE_FORMAT_STRING "!_TAG_FILE_FORMAT" + /* Shankar Chakkere Jul 03, 2002 01:47 PM + * void create_tag_entry (struct tag_entry *entry, char *identifier, + * enum e_identifier_type id_type) + */ void create_tag_entry (struct tag_entry *entry, char *identifier, ! enum e_identifier_type id_type, enum icase case_type, int tag_length, enum iall all) { entry->identifier = identifier; entry->id_type = id_type; entry->filename = NULL; entry->spat.is_line_no = 0; entry->spat.pat.search_line = NULL; + /* Jul 03, 2002 01:48 PM */ + entry->case_type = case_type; + entry->tag_length = tag_length; + /* Jul 08, 2002 04:54 PM */ + entry->all = all; } void destroy_search_pattern (struct search_pattern *spat) *************** *** 267,272 **** --- 276,289 ---- char *remainder; char *tagfilename; enum e_identifier_type foundtag_type; + /*Jul 03, 2002 02:16 PM */ + int match; + /* Jul 08, 2002 03:22 PM for linked list*/ + struct tag_entry *root; + enum tagfound {NO,YES} found; + root = entry; /* Get the root structure */ + root->next = NULL;/* No more links yet */ + found = NO; if (append_file_2_dir (rootdir, "tags", &tagfilename) < 0) return -EMALLOC; *************** *** 298,304 **** fputs ("Not enough tag-fields found in tagfile.\n", stderr); return close_and_return (fp, -ENOT_FOUND); } ! if (strcmp (fields[0], entry->identifier) == 0) { if (append_file_2_dir(rootdir, fields[1], &entry->filename) < 0) { return close_and_return (fp, -EMALLOC); } --- 315,346 ---- fputs ("Not enough tag-fields found in tagfile.\n", stderr); return close_and_return (fp, -ENOT_FOUND); } ! /* Jul 03, 2002 02:03 PM Chakkere Shankar ! * For case insensitive search and restricted tag length check ! */ ! ! if (entry->case_type == TRUE ){ ! match = 0; ! if(entry->tag_length){ /* RESTRICTED TAG LENGTH COMPARISION */ ! if (strncasecmp(fields[0],entry->identifier,entry->tag_length) == 0) ! match = 1; ! } else { ! if (strcasecmp (fields[0], entry->identifier) == 0) ! match = 1; ! } ! } else { /* CASE SENSITIVE COMPARISION */ ! match = 0; ! if(entry->tag_length){ ! if (strncmp(fields[0],entry->identifier,entry->tag_length) == 0) ! match = 1; ! } else { ! if (strcmp (fields[0], entry->identifier) == 0) ! match = 1; ! } ! } ! ! if (match == 1){ ! if (append_file_2_dir(rootdir, fields[1], &entry->filename) < 0) { return close_and_return (fp, -EMALLOC); } *************** *** 314,354 **** if (*(fields[0] + 1) != '\0' && *(fields[0] + 1) != '\n') { fprintf(stderr, "The field after the search pattern isn't the one-\ ! character-field I'm looking for: %s\n", fields[0]); destroy_search_pattern (&entry->spat); } foundtag_type = char_2_identifier_type (*fields[0]); if (foundtag_type == IT_NONE) { fprintf (stderr, "Unrecognized identifier-type: %c\n", ! *fields[0]); destroy_search_pattern (&entry->spat); return close_and_return (fp, -EILLEGAL); } /* there was no identifier type specified */ if (entry->id_type == IT_NONE || entry->id_type == foundtag_type) { if (identifier_type_2_delim (foundtag_type, &entry->spat.delim) < 0) { fputs( ! "Couldn't convert the identifier-type to a delimiter\n", ! stderr); destroy_search_pattern (&entry->spat); return close_and_return (fp, -EILLEGAL); } else { /* we found it */ entry->id_type = foundtag_type; ! return close_and_return (fp, EOK); } } else /* the tag we found is not the right one */ destroy_search_pattern(&entry->spat); ! /* and go on */ } } if (entry->id_type == IT_NONE) fprintf (stderr, "Tag \"%s\" not found.\n", entry->identifier); else fprintf (stderr, "%s \"%s\" not found.\n", get_identifier_type_str(entry->id_type), entry->identifier); return close_and_return (fp, -ENOT_FOUND); } --- 356,443 ---- if (*(fields[0] + 1) != '\0' && *(fields[0] + 1) != '\n') { fprintf(stderr, "The field after the search pattern isn't the one-\ ! character-field I'm looking for: %s\n", fields[0]); destroy_search_pattern (&entry->spat); } foundtag_type = char_2_identifier_type (*fields[0]); if (foundtag_type == IT_NONE) { + /* Jul 16, 2002 02:06 PM , there may be other identifier-type like, assembly labels + * It's common in mixed language environment, so continue searching + */ + #if 0 fprintf (stderr, "Unrecognized identifier-type: %c\n", ! *fields[0]); ! #endif destroy_search_pattern (&entry->spat); + continue; + #if 0 return close_and_return (fp, -EILLEGAL); + #endif } /* there was no identifier type specified */ if (entry->id_type == IT_NONE || entry->id_type == foundtag_type) { if (identifier_type_2_delim (foundtag_type, &entry->spat.delim) < 0) { fputs( ! "Couldn't convert the identifier-type to a delimiter\n", ! stderr); destroy_search_pattern (&entry->spat); return close_and_return (fp, -EILLEGAL); } else { /* we found it */ entry->id_type = foundtag_type; ! /* Jul 09, 2002 01:55 PM ! * Copy identifier, so that it can be printed along with file information ! */ ! entry->identifier = (char *) malloc(strlen(buffer)+1); ! strcpy(entry->identifier,buffer); ! ! /* Jul 08, 2002 01:02 PM add routine to create a linked list */ ! if(entry->all == YES){ ! found = YES; ! /* Jul 08, 2002 03:02 PM create a new link and add elements to it */ ! entry = (struct tag_entry *) malloc(sizeof(struct tag_entry)); ! root->next = entry; ! entry->next = NULL; ! entry->identifier = root->identifier; ! entry->id_type = root->id_type; ! entry->spat.is_line_no = 0; ! entry->spat.pat.search_line = NULL; ! entry->case_type = root->case_type; ! entry->tag_length = root->tag_length; ! entry->all = root->all; ! root = entry; /* root points to new node */ ! } else { ! return close_and_return (fp, EOK); ! } } } else /* the tag we found is not the right one */ destroy_search_pattern(&entry->spat); ! /* and go on */ } } + /* Jul 08, 2002 03:44 PM + * The following lines have to be fixed for -a option + */ + + if((entry->all == YES)&&(found == YES)) { + if(entry->id_type != IT_NONE) + return close_and_return(fp,EOK); + else { + if (entry->id_type == IT_NONE) + fprintf (stderr, "Tag \"%s\" not found.\n", entry->identifier); + else + fprintf (stderr, "%s \"%s\" not found.\n", + get_identifier_type_str(entry->id_type), entry->identifier); + } + } else { if (entry->id_type == IT_NONE) fprintf (stderr, "Tag \"%s\" not found.\n", entry->identifier); else fprintf (stderr, "%s \"%s\" not found.\n", get_identifier_type_str(entry->id_type), entry->identifier); + } return close_and_return (fp, -ENOT_FOUND); } diff -r -c cshow-0.2-pre2/lookup.h cshow-0.3/lookup.h *** cshow-0.2-pre2/lookup.h Sun Jan 30 15:43:18 2000 --- cshow-0.3/lookup.h Tue Jul 9 15:02::48 2002 *************** *** 27,47 **** int is_line_no; union u_pat pat; enum e_delimited_by delim; }; struct tag_entry { ! char *identifier; ! enum e_identifier_type id_type; ! char *filename; ! struct search_pattern spat; }; /* identifier may not be NULL, and may not be altered * we only keep a reference to the identifier-string. * ident_type can be IT_NONE */ void create_tag_entry (struct tag_entry *entry, char *identifier, ! enum e_identifier_type ident_type); /* destroy the previously allocated contents of the entry */ void destroy_tag_entry (struct tag_entry *entry); --- 27,60 ---- int is_line_no; union u_pat pat; enum e_delimited_by delim; + /* Jul 03, 2002 06:10 PM added for line number */ + int line_number; }; struct tag_entry { ! char *identifier; ! enum e_identifier_type id_type; ! char *filename; ! struct search_pattern spat; ! /*Jul 03, 2002 01:54 PM Shankar Chakkere */ ! int tag_length; ! enum icase case_type; ! /* Jul 08, 2002 04:53 PM Shankar Chakkere */ ! enum iall all; ! /* Jul 08, 2002 02:29 PM */ ! struct tag_entry *next; }; /* identifier may not be NULL, and may not be altered * we only keep a reference to the identifier-string. * ident_type can be IT_NONE */ + /* Jul 03, 2002 01:51 PM + * void create_tag_entry (struct tag_entry *entry, char *identifier, + * enum e_identifier_type ident_type); + */ void create_tag_entry (struct tag_entry *entry, char *identifier, ! enum e_identifier_type ident_type, enum icase case_type, int tag_length, enum iall all); /* destroy the previously allocated contents of the entry */ void destroy_tag_entry (struct tag_entry *entry); diff -r -c cshow-0.2-pre2/print.c cshow-0.3/print.c *** cshow-0.2-pre2/print.c Tue Feb 29 11:26:48 2000 --- cshow-0.3/print.c Mon Jul 15 16:21:444 2002 *************** *** 70,76 **** /* prints a function from the current file position till it's closing bracket. The buffer needs to be filled already. */ ! int print_function_body (struct print_io *io) { enum STATES state = STATE_NORMAL; unsigned char prev = '\0', str_delim; --- 70,79 ---- /* prints a function from the current file position till it's closing bracket. The buffer needs to be filled already. */ ! /* Jul 15, 2002 03:20 PM for -b --brief ! * int print_function_body (struct print_io *io) ! */ ! int print_function_body (struct print_io *io, enum ibrief brief) { enum STATES state = STATE_NORMAL; unsigned char prev = '\0', str_delim; *************** *** 84,89 **** --- 87,95 ---- case STATE_NORMAL: switch (*p) { case '{': open_brackets++; + /* Jul 15, 2002 03:21 PM */ + if (brief == BRIEF) done = 1; + *p = ' '; /* Do not print { */ break; case '}': open_brackets--; if (open_brackets == 0) done = 1; *************** *** 142,148 **** } else return EOK; } ! int print_character_delimited (struct print_io *io, char delim) { enum STATES state = STATE_NORMAL; unsigned char prev = '\0', str_delim; --- 148,157 ---- } else return EOK; } ! /* Jul 15, 2002 04:03 PM for -b, --brief ! * int print_character_delimited (struct print_io *io, char delim) ! */ ! int print_character_delimited (struct print_io *io, char delim, enum ibrief brief) { enum STATES state = STATE_NORMAL; unsigned char prev = '\0', str_delim; *************** *** 156,161 **** --- 165,175 ---- case STATE_NORMAL: switch (*p) { case '{': open_brackets++; + /* Jul 15, 2002 04:20 PM */ + if (brief == BRIEF) { + done = 1; + *p = ' ';/* Do not print { */ + } break; case '}': open_brackets--; break; *************** *** 215,228 **** return EOK; } ! int print_comma_delimited (struct print_io *io) { ! return print_character_delimited (io, ','); } ! int print_semicolon_delimited (struct print_io *io) { ! return print_character_delimited (io, ';'); } --- 229,242 ---- return EOK; } ! int print_comma_delimited (struct print_io *io, enum ibrief brief) { ! return print_character_delimited (io, ',', brief); } ! int print_semicolon_delimited (struct print_io *io, enum ibrief brief) { ! return print_character_delimited (io, ';', brief); } diff -r -c cshow-0.2-pre2/print.h cshow-0.3/print.h *** cshow-0.2-pre2/print.h Tue Jan 25 10:39:08 2000 --- cshow-0.3/print.h Mon Jul 15 16:07:448 2002 *************** *** 5,10 **** --- 5,13 ---- #define _PRINT_H #include + /* Jul 15, 2002 02:57 PM for -b , --brief option + */ + #include "identifiertype.h" struct print_io { FILE *in; *************** *** 15,27 **** int print_definition (struct print_io *io); ! int print_function_body (struct print_io *io); /* #define print_comma_delimited (io) print_character_delimited ((io), ',') #define print_semicolon_delimited (io) print_character_delimited ((io),';') */ ! int print_comma_delimited (struct print_io *io); ! int print_semicolon_delimited (struct print_io *io); #endif --- 18,34 ---- int print_definition (struct print_io *io); ! /*int print_function_body (struct print_io *io); ! */ ! int print_function_body (struct print_io *io, enum ibrief brief); /* #define print_comma_delimited (io) print_character_delimited ((io), ',') #define print_semicolon_delimited (io) print_character_delimited ((io),';') */ ! /* Jul 15, 2002 04:07 PM for -b,--brief option ! */ ! int print_comma_delimited (struct print_io *io, enum ibrief brief); ! int print_semicolon_delimited (struct print_io *io, enum ibrief brief); #endif