head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.32 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.30 pkgsrc-2012Q4-base:1.6 pkgsrc-2011Q4:1.6.0.28 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q2:1.6.0.26 pkgsrc-2011Q2-base:1.6 pkgsrc-2009Q4:1.6.0.24 pkgsrc-2009Q4-base:1.6 pkgsrc-2008Q4:1.6.0.22 pkgsrc-2008Q4-base:1.6 pkgsrc-2008Q3:1.6.0.20 pkgsrc-2008Q3-base:1.6 cube-native-xorg:1.6.0.18 cube-native-xorg-base:1.6 pkgsrc-2008Q2:1.6.0.16 pkgsrc-2008Q2-base:1.6 pkgsrc-2008Q1:1.6.0.14 pkgsrc-2008Q1-base:1.6 pkgsrc-2007Q4:1.6.0.12 pkgsrc-2007Q4-base:1.6 pkgsrc-2007Q3:1.6.0.10 pkgsrc-2007Q3-base:1.6 pkgsrc-2007Q2:1.6.0.8 pkgsrc-2007Q2-base:1.6 pkgsrc-2007Q1:1.6.0.6 pkgsrc-2007Q1-base:1.6 pkgsrc-2006Q4:1.6.0.4 pkgsrc-2006Q4-base:1.6 pkgsrc-2006Q3:1.6.0.2 pkgsrc-2006Q3-base:1.6 pkgsrc-2006Q2:1.4.0.24 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.22 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.20 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.18 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.16 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.14 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.12 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.10 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.8 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.6 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.4 pkgsrc-2003Q4-base:1.4 netbsd-1-6-1:1.4.0.2 netbsd-1-6-1-base:1.4 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.2 netbsd-1-5-RELEASE:1.2 netbsd-1-4-PATCH003:1.2; locks; strict; comment @# @; 1.6 date 2006.08.05.19.54.26; author wiz; state dead; branches; next 1.5; 1.5 date 2006.08.04.19.23.39; author christos; state Exp; branches; next 1.4; 1.4 date 2003.01.08.02.36.00; author thorpej; state Exp; branches; next 1.3; 1.3 date 2002.01.31.13.49.21; author mrg; state Exp; branches; next 1.2; 1.2 date 2000.05.27.01.23.05; author sommerfeld; state Exp; branches; next 1.1; 1.1 date 2000.03.22.13.55.32; author mrg; state Exp; branches; next ; desc @@ 1.6 log @Complete move of id-utils to its new home, idutils. @ text @$NetBSD: patch-ac,v 1.5 2006/08/04 19:23:39 christos Exp $ --- libidu/idread.c.orig 2005-12-27 00:23:18.000000000 -0500 +++ libidu/idread.c 2006-08-03 12:27:38.779542243 -0400 @@@@ -211,12 +211,12 @@@@ #define TOK_COUNT_ADDR(buf) ((unsigned char const *)(TOK_FLAGS_ADDR (buf) + 1)) #define TOK_HITS_ADDR(buf) ((unsigned char const *)(TOK_COUNT_ADDR (buf) + 2)) -unsigned short +unsigned int token_count (char const *buf) { unsigned char const *flags = (unsigned char const *)&buf[strlen (buf) + 1]; unsigned char const *addr = flags + 1; - unsigned short count = *addr; + unsigned int count = *addr; if (*flags & TOK_SHORT_COUNT) count += (*++addr << 8); return count; @ 1.5 log @welcome to idutils-4.1 @ text @d1 1 a1 1 $NetBSD$ @ 1.4 log @#include statements in asm files that did not match the form: #include "foo.h" ..or.. #include would cause mkid to happily loop forever. Fix this, making the scanner properly detect EOL/EOF and defined name tokens in #include statements, as well. Merge all libidu/scanners.c patches into a single patch file. Bump package revision to nb3. @ text @d3 9 a11 210 --- libidu/scanners.c.orig Tue Jan 7 18:24:27 2003 +++ libidu/scanners.c Tue Jan 7 18:24:29 2003 @@@@ -44,6 +44,19 @@@@ extern void usage __P((void)); extern char *program_name; +static char *id_0; +static size_t id_0_len; +#define APPEND_CHAR(C) do { \ + if(id_0 == NULL || id == id_0 + id_0_len) { \ + size_t __pos = id_0 ? id - id_0 : 0; \ + id_0 = xrealloc(id_0, id_0_len + BUFSIZ); \ + id_0_len += BUFSIZ; \ + id = id_0 + __pos; \ + } \ + *id++ = (C); \ + } while(0); + + /****************************************************************************/ struct lang_args **parse_language_map_file __P((char const *file_name, struct lang_args **next_ptr)); @@@@ -65,8 +78,14 @@@@ struct language languages_0[] = { { "C", parse_args_c, get_token_c, help_me_c }, + { "C++", parse_args_c, get_token_c, help_me_c }, + { "cpp", parse_args_c, get_token_c, help_me_c }, + { "cc", parse_args_c, get_token_c, help_me_c }, { "asm", parse_args_asm, get_token_asm, help_me_asm }, + { "S", parse_args_asm, get_token_asm, help_me_asm }, + { "s", parse_args_asm, get_token_asm, help_me_asm }, { "text", parse_args_text, get_token_text, help_me_text }, + { "make", parse_args_text, get_token_text, help_me_text }, }; struct language const *languages_N = &languages_0[cardinalityof (languages_0)]; @@@@ -482,7 +501,6 @@@@ #define ARGS ((struct args_c const *) args) static int new_line = 1; unsigned short const *rct = &ARGS->ctype[1]; - char id_0[BUFSIZ]; char *id = id_0; int c; @@@@ -501,10 +519,10 @@@@ if (!ISID1ST (c)) goto next; id = id_0; - *id++ = c; + APPEND_CHAR(c); while (ISIDREST (c = getc (in_FILE))) - *id++ = c; - *id = '\0'; + APPEND_CHAR(c); + APPEND_CHAR('\0'); if (strequ (id_0, "include")) { while (c == ' ' || c == '\t') @@@@ -520,7 +538,7 @@@@ c = getc (in_FILE); while (c != '\n' && c != EOF && c != '"') { - *id++ = c; + APPEND_CHAR(c); c = getc (in_FILE); } *flags = TOK_STRING; @@@@ -530,16 +548,16 @@@@ c = getc (in_FILE); while (c != '\n' && c != EOF && c != '>') { - *id++ = c; + APPEND_CHAR(c); c = getc (in_FILE); } *flags = TOK_STRING; } else if (ISID1ST (c)) { - *id++ = c; + APPEND_CHAR(c); while (ISIDREST (c = getc (in_FILE))) - *id++ = c; + APPEND_CHAR(c); *flags = TOK_NAME; } else @@@@ -574,14 +592,14 @@@@ { case '"': id = id_0; - *id++ = c = getc (in_FILE); + APPEND_CHAR(c = getc (in_FILE)); for (;;) { while (ISQ2BORING (c)) - *id++ = c = getc (in_FILE); + APPEND_CHAR(c = getc (in_FILE)); if (c == '\\') { - *id++ = c = getc (in_FILE); + APPEND_CHAR(c = getc (in_FILE)); continue; } else if (c != '"') @@@@ -662,18 +680,18 @@@@ return 0; } id = id_0; - *id++ = c; + APPEND_CHAR(c); if (ISID1ST (c)) { *flags = TOK_NAME; while (ISIDREST (c = getc (in_FILE))) - *id++ = c; + APPEND_CHAR(c); } else if (ISDIGIT (c)) { *flags = TOK_NUMBER; while (ISNUMBER (c = getc (in_FILE))) - *id++ = c; + APPEND_CHAR(c); } else { @@@@ -868,7 +886,6 @@@@ #define ARGS ((struct args_asm const *) args) static int new_line = 1; unsigned char const *rct = &ARGS->ctype[1]; - char id_0[BUFSIZ]; char *id = id_0; int c; @@@@ -886,18 +903,25 @@@@ if (!ISID1ST (c)) goto next; id = id_0; - *id++ = c; + APPEND_CHAR(c); while (ISIDREST (c = getc (in_FILE))) - *id++ = c; - *id = '\0'; + APPEND_CHAR(c); + APPEND_CHAR('\0'); if (strequ (id_0, "include")) { - while (c != '"' && c != '<') + while (c == ' ' || c == '\t') c = getc (in_FILE); + if (c == '\n' || ISEOF(c)) + { + new_line = 1; + goto top; + } + if (c != '"' && c != '<') + goto next; id = id_0; - *id++ = c = getc (in_FILE); + APPEND_CHAR(c = getc (in_FILE)); while ((c = getc (in_FILE)) != '"' && c != '>') - *id++ = c; + APPEND_CHAR(c); *flags = TOK_STRING; obstack_grow0 (&tokens_obstack, id_0, id - id_0); return (struct token *) obstack_finish (&tokens_obstack); @@@@ -906,7 +930,7 @@@@ || strequ (id_0, "define") || strequ (id_0, "undef")) goto next; - while (c != '\n') + while ((c != '\n') && !ISEOF(c)) c = getc (in_FILE); new_line = 1; goto top; @@@@ -967,18 +991,18 @@@@ obstack_grow0 (&tokens_obstack, "_", 1); return (struct token *) obstack_finish (&tokens_obstack); } - *id++ = c; + APPEND_CHAR(c); if (ISID1ST (c)) { *flags = TOK_NAME; while (ISIDREST (c = getc (in_FILE))) - *id++ = c; + APPEND_CHAR(c); } else if (ISNUMBER (c)) { *flags = TOK_NUMBER; while (ISNUMBER (c = getc (in_FILE))) - *id++ = c; + APPEND_CHAR(c); } else { @@@@ -989,7 +1013,7 @@@@ goto next; } - *id = '\0'; + APPEND_CHAR('\0'); for (id = id_0; *id; id++) if (ISIGNORE (*id)) goto next; @@@@ -1153,7 +1177,6 @@@@ get_token_text (FILE *in_FILE, void const *args, int *flags) d13 7 a19 28 #define ARGS ((struct args_text const *) args) - static char id_0[BUFSIZ]; unsigned char const *rct = &ARGS->ctype[1]; int c; char *id = id_0; @@@@ -1170,19 +1193,19 @@@@ return 0; } id = id_0; - *id++ = c; + APPEND_CHAR(c); if (ISID1ST (c)) { *flags = TOK_NAME; while (ISIDREST (c = getc (in_FILE))) if (!ISIDSQUEEZE (c)) - *id++ = c; + APPEND_CHAR(c); } else if (ISNUMBER (c)) { *flags = TOK_NUMBER; while (ISNUMBER (c = getc (in_FILE))) - *id++ = c; + APPEND_CHAR(c); } else { @ 1.3 log @eat more asm and c++ files. *chomp* *chomp* @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.2 2000/05/27 01:23:05 sommerfeld Exp $ d3 23 a25 3 --- libidu/scanners.c.orig Thu Jul 18 07:45:52 1996 +++ libidu/scanners.c Fri Feb 1 00:20:36 2002 @@@@ -65,8 +65,14 @@@@ d40 132 a171 1 @@@@ -906,7 +910,7 @@@@ d180 62 @ 1.2 log @Prevent infinite loop in mkid if it encounters an assembly source file which ends in a preprocessor directive not followed by a newline. (test case: rev 1.1 of syssrc/sys/lib/libkern/arch/arm26/byte_swap_2.S) Patch mailed to GNU maintainer; however, last release of this package was ~4 years ago, so.. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- libidu/scanners.c.orig Wed Jul 17 17:45:52 1996 +++ libidu/scanners.c Fri May 26 21:07:43 2000 @@@@ -65,8 +65,10 @@@@ d10 2 d13 2 d20 1 a20 1 @@@@ -906,7 +908,7 @@@@ @ 1.1 log @actually *do* something for C++ and Makefile files, like the docs say (XXX: many more still missing). @ text @d3 2 a4 2 --- libidu/scanners.c.orig Thu Jul 18 07:45:52 1996 +++ libidu/scanners.c Thu Mar 23 00:42:05 2000 d16 9 @