|
@@ -154,7 +154,7 @@ int symfilecnt = 0;
|
|
static void add_new_symbol(struct symfile *sym, char * symname)
|
|
static void add_new_symbol(struct symfile *sym, char * symname)
|
|
{
|
|
{
|
|
sym->symbollist =
|
|
sym->symbollist =
|
|
- realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
|
|
|
|
|
|
+ realloc(sym->symbollist, (sym->symbolcnt + 1) * sizeof(char *));
|
|
sym->symbollist[sym->symbolcnt++].name = strdup(symname);
|
|
sym->symbollist[sym->symbolcnt++].name = strdup(symname);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -215,7 +215,7 @@ static void find_export_symbols(char * filename)
|
|
char *p;
|
|
char *p;
|
|
char *e;
|
|
char *e;
|
|
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != NULL) ||
|
|
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != NULL) ||
|
|
- ((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) {
|
|
|
|
|
|
+ ((p = strstr(line, "EXPORT_SYMBOL")) != NULL)) {
|
|
/* Skip EXPORT_SYMBOL{_GPL} */
|
|
/* Skip EXPORT_SYMBOL{_GPL} */
|
|
while (isalnum(*p) || *p == '_')
|
|
while (isalnum(*p) || *p == '_')
|
|
p++;
|
|
p++;
|
|
@@ -291,28 +291,28 @@ static void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
|
|
static void singfunc(char * filename, char * line)
|
|
static void singfunc(char * filename, char * line)
|
|
{
|
|
{
|
|
char *vec[200]; /* Enough for specific functions */
|
|
char *vec[200]; /* Enough for specific functions */
|
|
- int i, idx = 0;
|
|
|
|
- int startofsym = 1;
|
|
|
|
|
|
+ int i, idx = 0;
|
|
|
|
+ int startofsym = 1;
|
|
vec[idx++] = KERNELDOC;
|
|
vec[idx++] = KERNELDOC;
|
|
vec[idx++] = DOCBOOK;
|
|
vec[idx++] = DOCBOOK;
|
|
vec[idx++] = SHOWNOTFOUND;
|
|
vec[idx++] = SHOWNOTFOUND;
|
|
|
|
|
|
- /* Split line up in individual parameters preceded by FUNCTION */
|
|
|
|
- for (i=0; line[i]; i++) {
|
|
|
|
- if (isspace(line[i])) {
|
|
|
|
- line[i] = '\0';
|
|
|
|
- startofsym = 1;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- if (startofsym) {
|
|
|
|
- startofsym = 0;
|
|
|
|
- vec[idx++] = FUNCTION;
|
|
|
|
- vec[idx++] = &line[i];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ /* Split line up in individual parameters preceded by FUNCTION */
|
|
|
|
+ for (i=0; line[i]; i++) {
|
|
|
|
+ if (isspace(line[i])) {
|
|
|
|
+ line[i] = '\0';
|
|
|
|
+ startofsym = 1;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (startofsym) {
|
|
|
|
+ startofsym = 0;
|
|
|
|
+ vec[idx++] = FUNCTION;
|
|
|
|
+ vec[idx++] = &line[i];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
for (i = 0; i < idx; i++) {
|
|
for (i = 0; i < idx; i++) {
|
|
- if (strcmp(vec[i], FUNCTION))
|
|
|
|
- continue;
|
|
|
|
|
|
+ if (strcmp(vec[i], FUNCTION))
|
|
|
|
+ continue;
|
|
consume_symbol(vec[i + 1]);
|
|
consume_symbol(vec[i + 1]);
|
|
}
|
|
}
|
|
vec[idx++] = filename;
|
|
vec[idx++] = filename;
|
|
@@ -460,14 +460,14 @@ static void parse_file(FILE *infile)
|
|
break;
|
|
break;
|
|
case 'D':
|
|
case 'D':
|
|
while (*s && !isspace(*s)) s++;
|
|
while (*s && !isspace(*s)) s++;
|
|
- *s = '\0';
|
|
|
|
- symbolsonly(line+2);
|
|
|
|
- break;
|
|
|
|
|
|
+ *s = '\0';
|
|
|
|
+ symbolsonly(line+2);
|
|
|
|
+ break;
|
|
case 'F':
|
|
case 'F':
|
|
/* filename */
|
|
/* filename */
|
|
while (*s && !isspace(*s)) s++;
|
|
while (*s && !isspace(*s)) s++;
|
|
*s++ = '\0';
|
|
*s++ = '\0';
|
|
- /* function names */
|
|
|
|
|
|
+ /* function names */
|
|
while (isspace(*s))
|
|
while (isspace(*s))
|
|
s++;
|
|
s++;
|
|
singlefunctions(line +2, s);
|
|
singlefunctions(line +2, s);
|
|
@@ -515,11 +515,11 @@ int main(int argc, char *argv[])
|
|
}
|
|
}
|
|
/* Open file, exit on error */
|
|
/* Open file, exit on error */
|
|
infile = fopen(argv[2], "r");
|
|
infile = fopen(argv[2], "r");
|
|
- if (infile == NULL) {
|
|
|
|
- fprintf(stderr, "docproc: ");
|
|
|
|
- perror(argv[2]);
|
|
|
|
- exit(2);
|
|
|
|
- }
|
|
|
|
|
|
+ if (infile == NULL) {
|
|
|
|
+ fprintf(stderr, "docproc: ");
|
|
|
|
+ perror(argv[2]);
|
|
|
|
+ exit(2);
|
|
|
|
+ }
|
|
|
|
|
|
if (strcmp("doc", argv[1]) == 0) {
|
|
if (strcmp("doc", argv[1]) == 0) {
|
|
/* Need to do this in two passes.
|
|
/* Need to do this in two passes.
|