瀏覽代碼

libdpkg: Move nicknames table from parsehelp.c to parse.c

This table is only ever going to be used at parse time when normalizing
the input.
Guillem Jover 15 年之前
父節點
當前提交
d2ee3fdccf
共有 3 個文件被更改,包括 11 次插入12 次删除
  1. 11 1
      lib/dpkg/parse.c
  2. 0 1
      lib/dpkg/parsedump.h
  3. 0 10
      lib/dpkg/parsehelp.c

+ 11 - 1
lib/dpkg/parse.c

@@ -79,10 +79,20 @@ const struct fieldinfo fieldinfos[]= {
   { "Description",      f_charfield,       w_charfield,      PKGIFPOFF(description)   },
   { "Triggers-Pending", f_trigpend,        w_trigpend                                 },
   { "Triggers-Awaited", f_trigaw,          w_trigaw                                   },
-  /* Note that aliases are added to the nicknames table in parsehelp.c. */
+  /* Note that aliases are added to the nicknames table. */
   {  NULL                                                                             }
 };
 
+static const struct nickname nicknames[] = {
+  /* Note: Capitalization of these strings is important. */
+  { .nick = "Recommended",      .canon = "Recommends" },
+  { .nick = "Optional",         .canon = "Suggests" },
+  { .nick = "Class",            .canon = "Priority" },
+  { .nick = "Package-Revision", .canon = "Revision" },
+  { .nick = "Package_Revision", .canon = "Revision" },
+  { .nick = NULL }
+};
+
 struct field_state {
   const char *fieldstart;
   const char *valuestart;

+ 0 - 1
lib/dpkg/parsedump.h

@@ -87,6 +87,5 @@ struct nickname {
 };
 
 extern const struct fieldinfo fieldinfos[];
-extern const struct nickname nicknames[];
 
 #endif /* LIBDPKG_PARSEDUMP_H */

+ 0 - 10
lib/dpkg/parsehelp.c

@@ -140,16 +140,6 @@ pkg_name_is_illegal(const char *p, const char **ep)
   return buf;
 }
 
-const struct nickname nicknames[]= {
-  /* Note: Capitalization of these strings is important. */
-  { .nick = "Recommended",      .canon = "Recommends" },
-  { .nick = "Optional",         .canon = "Suggests" },
-  { .nick = "Class",            .canon = "Priority" },
-  { .nick = "Package-Revision", .canon = "Revision" },
-  { .nick = "Package_Revision", .canon = "Revision" },
-  { .nick = NULL }
-};
-
 bool
 informativeversion(const struct versionrevision *version)
 {