diff options
author | Lev Walkin <vlm@lionet.info> | 2005-11-26 11:25:14 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2005-11-26 11:25:14 +0000 |
commit | 59b176ee355b3e82e6a8649b164c187c7a17a28f (patch) | |
tree | 6d864f02cd16eb75f4ae6e40199d1879d8363152 /libasn1compiler/asn1c_fdeps.c | |
parent | 708530582f5ba965fb596c3e189eec23c52337d9 (diff) |
upgrade: PER related changes
Diffstat (limited to 'libasn1compiler/asn1c_fdeps.c')
-rw-r--r-- | libasn1compiler/asn1c_fdeps.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libasn1compiler/asn1c_fdeps.c b/libasn1compiler/asn1c_fdeps.c index 0066f51a..80ba2f68 100644 --- a/libasn1compiler/asn1c_fdeps.c +++ b/libasn1compiler/asn1c_fdeps.c @@ -66,7 +66,12 @@ asn1c_read_file_dependencies(arg_t *arg, const char *datadir) { asn1c_fdeps_t *cur; char buf[4096]; FILE *f; - int hit_COMMON_FILES = 0; + enum { + SS_DYNAMIC, /* Dynamic list of dependencies */ + SS_CODEC_PER, /* Use contents only if -gen-PER */ + SS_COMMON_FILES, /* Section for dependencies */ + SS_IGNORE /* Ignore contents of this section */ + } special_section = SS_DYNAMIC; (void)arg; @@ -91,17 +96,27 @@ asn1c_read_file_dependencies(arg_t *arg, const char *datadir) { for(p = strtok(buf, " \t\r\n"); p; p = strtok(NULL, " \t\r\n")) { asn1c_fdeps_t *d; + /* - * If hit "COMMON-FILES:", treat everything else - * as a huge dependency. + * Special "prefix" section. */ - if(strcmp(p, "COMMON-FILES:") == 0) { - hit_COMMON_FILES = 1; + if(strchr(p, ':')) { + special_section = SS_IGNORE; + if(strcmp(p, "COMMON-FILES:") == 0) { + special_section = SS_COMMON_FILES; + } else if((arg->flags & A1C_GEN_PER) + && strcmp(p, "CODEC-PER:") == 0) { + special_section = SS_CODEC_PER; + } break; } + + if(special_section == SS_IGNORE) + continue; + d = asn1c_new_dep(p); assert(d); - d->used_somewhere = hit_COMMON_FILES; + d->used_somewhere = special_section; if(asn1c_dep_add(cur, d) == 1) cur = d; |