aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid M. Syzdek <david@syzdek.net>2019-12-02 01:29:50 -0900
committerDavid M. Syzdek <david@syzdek.net>2019-12-02 01:29:50 -0900
commitb83be616867f0dfefe9326001c3c001c9cf139b0 (patch)
treea7215723abeccc39cead6991545dbce3e3106214
parentdea82e05b8f07888dc31c243634411f33ed861c4 (diff)
downloadldap-utils-b83be616867f0dfefe9326001c3c001c9cf139b0.tar.gz
ldap-utils-b83be616867f0dfefe9326001c3c001c9cf139b0.tar.bz2
ldap-utils-b83be616867f0dfefe9326001c3c001c9cf139b0.tar.xz
ldap-utils-b83be616867f0dfefe9326001c3c001c9cf139b0.zip
oidspectool: replacing extern with static for struct ldapschema_spec declarations
-rw-r--r--src/utils/oidspectool/oidspeclexer.l1
-rw-r--r--src/utils/oidspectool/oidspectool.c5
2 files changed, 2 insertions, 4 deletions
diff --git a/src/utils/oidspectool/oidspeclexer.l b/src/utils/oidspectool/oidspeclexer.l
index 6ed02d2..2b91c93 100644
--- a/src/utils/oidspectool/oidspeclexer.l
+++ b/src/utils/oidspectool/oidspeclexer.l
@@ -49,6 +49,7 @@ int yylex();
49"#"[a-zA-Z0-9]+[^\n]*[\n] ; /* ignore C preprocessor directives */ 49"#"[a-zA-Z0-9]+[^\n]*[\n] ; /* ignore C preprocessor directives */
50 50
51"const "[^\n]+"="[^\n]*[\n] ; /* ignore non-code blocks (allows oidspectool to process its own output) */ 51"const "[^\n]+"="[^\n]*[\n] ; /* ignore non-code blocks (allows oidspectool to process its own output) */
52"static "[^\n]+"="[^\n]*[\n] ; /* ignore non-code blocks (allows oidspectool to process its own output) */
52"&"[_a-zA-Z0-9]+"," ; /* ignore pointer references (allows oidspectool to process its own output) */ 53"&"[_a-zA-Z0-9]+"," ; /* ignore pointer references (allows oidspectool to process its own output) */
53 54
54"("[ \t]*"const"[ \t][ \t*\[\]a-zA-Z0-9_]+")" { return(CONST_CAST); } 55"("[ \t]*"const"[ \t][ \t*\[\]a-zA-Z0-9_]+")" { return(CONST_CAST); }
diff --git a/src/utils/oidspectool/oidspectool.c b/src/utils/oidspectool/oidspectool.c
index 99aeea7..35a62a2 100644
--- a/src/utils/oidspectool/oidspectool.c
+++ b/src/utils/oidspectool/oidspectool.c
@@ -721,9 +721,6 @@ int my_save_header(FILE * fs)
721 fprintf(fs, "\n"); 721 fprintf(fs, "\n");
722 722
723 // save OID specs 723 // save OID specs
724 for(pos = 0; pos < oidspeclist_len; pos++)
725 fprintf(fs, "extern %s %s%zu;\n", cfg.type, cfg.name, pos);
726 fprintf(fs, "\n");
727 fprintf(fs, "extern const size_t %s_len;\n", cfg.name); 724 fprintf(fs, "extern const size_t %s_len;\n", cfg.name);
728 fprintf(fs, "extern %s * %s[];\n", cfg.type, cfg.name); 725 fprintf(fs, "extern %s * %s[];\n", cfg.type, cfg.name);
729 fprintf(fs, "\n\n#endif /* end of header */\n"); 726 fprintf(fs, "\n\n#endif /* end of header */\n");
@@ -796,7 +793,7 @@ int my_save_source_oidspec(FILE * fs, OIDSpec * oidspec, size_t idx)
796 793
797 fprintf(fs, "// %s\n", oidspec->oid[0]); 794 fprintf(fs, "// %s\n", oidspec->oid[0]);
798 fprintf(fs, "// %s:%i\n", my_fs_prunepath(oidspec->filename), oidspec->lineno); 795 fprintf(fs, "// %s:%i\n", my_fs_prunepath(oidspec->filename), oidspec->lineno);
799 fprintf(fs, "%s %s%zu =\n", cfg.type, cfg.name, idx); 796 fprintf(fs, "static %s %s%zu =\n", cfg.type, cfg.name, idx);
800 fprintf(fs, "{\n"); 797 fprintf(fs, "{\n");
801 my_save_source_oidspec_strs(fs, ".oid", oidspec->oid); 798 my_save_source_oidspec_strs(fs, ".oid", oidspec->oid);
802 my_save_source_oidspec_strs(fs, ".name", oidspec->name); 799 my_save_source_oidspec_strs(fs, ".name", oidspec->name);