Просмотр исходного кода

Rename struct pkginfoperfile to struct pkgbin

Guillem Jover лет назад: 15
Родитель
Сommit
de553e2746

+ 8 - 5
dselect/pkgdepcon.cc

@@ -48,11 +48,14 @@ packagelist::useavailable(pkginfo *pkg)
     return false;
     return false;
 }
 }
 
 
-pkginfoperfile *packagelist::findinfo(pkginfo *pkg) {
-  pkginfoperfile *r;
+pkgbin *
+packagelist::find_pkgbin(pkginfo *pkg)
+{
+  pkgbin *r;
   r= useavailable(pkg) ? &pkg->available : &pkg->installed;
   r= useavailable(pkg) ? &pkg->available : &pkg->installed;
   if (debug)
   if (debug)
-    fprintf(debug,"packagelist[%p]::findinfo(%s) useavailable=%d\n",this,pkg->name,useavailable(pkg));
+    fprintf(debug, "packagelist[%p]::find_pkgbin(%s) useavailable=%d\n",
+            this, pkg->name, useavailable(pkg));
 
 
   return r;
   return r;
 }
 }
@@ -91,13 +94,13 @@ int packagelist::resolvesuggest() {
         fprintf(debug,"packagelist[%p]::resolvesuggest() loop[%i] %s / %d\n",
         fprintf(debug,"packagelist[%p]::resolvesuggest() loop[%i] %s / %d\n",
                 this, index, table[index]->pkg->name, changemade);
                 this, index, table[index]->pkg->name, changemade);
       dependency *depends;
       dependency *depends;
-      for (depends= findinfo(table[index]->pkg)->depends;
+      for (depends = find_pkgbin(table[index]->pkg)->depends;
            depends;
            depends;
            depends= depends->next) {
            depends= depends->next) {
         changemade = max(changemade, resolvedepcon(depends));
         changemade = max(changemade, resolvedepcon(depends));
       }
       }
       changemade= checkdependers(table[index]->pkg,changemade);
       changemade= checkdependers(table[index]->pkg,changemade);
-      for (depends= findinfo(table[index]->pkg)->depends;
+      for (depends = find_pkgbin(table[index]->pkg)->depends;
            depends;
            depends;
            depends= depends->next) {
            depends= depends->next) {
         if (depends->type != dep_provides) continue;
         if (depends->type != dep_provides) continue;

+ 1 - 1
dselect/pkglist.cc

@@ -151,7 +151,7 @@ void packagelist::sortinplace() {
   sortpackagelist= this;
   sortpackagelist= this;
 
 
   if (debug) fprintf(debug,"packagelist[%p]::sortinplace()\n",this);
   if (debug) fprintf(debug,"packagelist[%p]::sortinplace()\n",this);
-  qsort(table,nitems,sizeof(struct pkginfoperfile*),qsort_compareentries);
+  qsort(table, nitems, sizeof(struct pkgbin *), qsort_compareentries);
 }
 }
 
 
 void packagelist::ensurestatsortinfo() {
 void packagelist::ensurestatsortinfo() {

+ 1 - 1
dselect/pkglist.h

@@ -206,7 +206,7 @@ protected:
   bool add(dependency *, showpriority displayimportance);
   bool add(dependency *, showpriority displayimportance);
   void addunavailable(deppossi*);
   void addunavailable(deppossi*);
   bool useavailable(pkginfo *);
   bool useavailable(pkginfo *);
-  pkginfoperfile *findinfo(pkginfo*);
+  pkgbin *find_pkgbin(pkginfo *);
 
 
   int resolvesuggest();
   int resolvesuggest();
   int deletelessimp_anyleft(showpriority than);
   int deletelessimp_anyleft(showpriority than);

+ 1 - 1
dselect/pkgtop.cc

@@ -139,7 +139,7 @@ void packagelist::redraw1itemsel(int index, int selected) {
   int i, indent, j;
   int i, indent, j;
   const char *p;
   const char *p;
   const struct pkginfo *pkg= table[index]->pkg;
   const struct pkginfo *pkg= table[index]->pkg;
-  const struct pkginfoperfile *info= &pkg->available;
+  const struct pkgbin *info = &pkg->available;
   int screenline = index - topofscreen;
   int screenline = index - topofscreen;
 
 
   wattrset(listpad, selected ? listsel_attr : list_attr);
   wattrset(listpad, selected ? listsel_attr : list_attr);

+ 4 - 4
lib/dpkg/database.c

@@ -77,12 +77,12 @@ pkg_blank(struct pkginfo *pigp)
   pigp->trigaw.head = pigp->trigaw.tail = NULL;
   pigp->trigaw.head = pigp->trigaw.tail = NULL;
   pigp->othertrigaw_head = NULL;
   pigp->othertrigaw_head = NULL;
   pigp->trigpend_head = NULL;
   pigp->trigpend_head = NULL;
-  pkg_perfile_blank(&pigp->installed);
-  pkg_perfile_blank(&pigp->available);
+  pkgbin_blank(&pigp->installed);
+  pkgbin_blank(&pigp->available);
 }
 }
 
 
 void
 void
-pkg_perfile_blank(struct pkginfoperfile *pifp)
+pkgbin_blank(struct pkgbin *pifp)
 {
 {
   pifp->essential = false;
   pifp->essential = false;
   pifp->depends= NULL;
   pifp->depends= NULL;
@@ -103,7 +103,7 @@ static int nes(const char *s) { return s && *s; }
  * display things, and by dump to decide whether to write them out.
  * display things, and by dump to decide whether to write them out.
  */
  */
 bool
 bool
-pkg_is_informative(struct pkginfo *pkg, struct pkginfoperfile *info)
+pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info)
 {
 {
   if (info == &pkg->installed &&
   if (info == &pkg->installed &&
       (pkg->want != want_unknown ||
       (pkg->want != want_unknown ||

+ 16 - 9
lib/dpkg/dpkg-db.h

@@ -101,8 +101,14 @@ struct filedetails {
   const char *md5sum;
   const char *md5sum;
 };
 };
 
 
-/* pif */
-struct pkginfoperfile {
+/**
+ * Node describing a binary package file.
+ *
+ * This structure holds information contained on each binary package.
+ *
+ * Note: Usually referred in the code as ‘pif’ for historical reasons.
+ */
+struct pkgbin {
   struct dependency *depends;
   struct dependency *depends;
   struct deppossi *depended;
   struct deppossi *depended;
   /* The ‘essential’ flag, true = yes, false = no (absent). */
   /* The ‘essential’ flag, true = yes, false = no (absent). */
@@ -181,8 +187,8 @@ struct pkginfo {
   const char *section;
   const char *section;
   struct versionrevision configversion;
   struct versionrevision configversion;
   struct filedetails *files;
   struct filedetails *files;
-  struct pkginfoperfile installed;
-  struct pkginfoperfile available;
+  struct pkgbin installed;
+  struct pkgbin available;
   struct perpackagestate *clientdata;
   struct perpackagestate *clientdata;
 
 
   struct {
   struct {
@@ -224,9 +230,9 @@ const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);
 /*** from database.c ***/
 /*** from database.c ***/
 
 
 void pkg_blank(struct pkginfo *pp);
 void pkg_blank(struct pkginfo *pp);
-void pkg_perfile_blank(struct pkginfoperfile *pifp);
+void pkgbin_blank(struct pkgbin *pifp);
 void blankversion(struct versionrevision*);
 void blankversion(struct versionrevision*);
-bool pkg_is_informative(struct pkginfo *pkg, struct pkginfoperfile *info);
+bool pkg_is_informative(struct pkginfo *pkg, struct pkgbin *info);
 
 
 struct pkginfo *pkg_db_find(const char *name);
 struct pkginfo *pkg_db_find(const char *name);
 int pkg_db_count(void);
 int pkg_db_count(void);
@@ -284,18 +290,19 @@ const char *versiondescribe(const struct versionrevision*,
 /*** from dump.c ***/
 /*** from dump.c ***/
 
 
 void writerecord(FILE*, const char*,
 void writerecord(FILE*, const char*,
-                 const struct pkginfo*, const struct pkginfoperfile*);
+                 const struct pkginfo *, const struct pkgbin *);
 
 
 void writedb(const char *filename, bool available, bool mustsync);
 void writedb(const char *filename, bool available, bool mustsync);
 
 
 /* Note: The varbufs must have been initialized and will not be
 /* Note: The varbufs must have been initialized and will not be
  * NUL-terminated. */
  * NUL-terminated. */
-void varbufrecord(struct varbuf*, const struct pkginfo*, const struct pkginfoperfile*);
+void varbufrecord(struct varbuf *, const struct pkginfo *,
+                  const struct pkgbin *);
 void varbufdependency(struct varbuf *vb, struct dependency *dep);
 void varbufdependency(struct varbuf *vb, struct dependency *dep);
 
 
 /*** from vercmp.c ***/
 /*** from vercmp.c ***/
 
 
-bool versionsatisfied(struct pkginfoperfile *it, struct deppossi *against);
+bool versionsatisfied(struct pkgbin *it, struct deppossi *against);
 bool versionsatisfied3(const struct versionrevision *it,
 bool versionsatisfied3(const struct versionrevision *it,
                        const struct versionrevision *ref,
                        const struct versionrevision *ref,
                        enum depverrel verrel);
                        enum depverrel verrel);

+ 71 - 43
lib/dpkg/dump.c

@@ -42,9 +42,11 @@
 #include <dpkg/dir.h>
 #include <dpkg/dir.h>
 #include <dpkg/parsedump.h>
 #include <dpkg/parsedump.h>
 
 
-void w_name(struct varbuf *vb,
-            const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-            enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_name(struct varbuf *vb,
+       const struct pkginfo *pigp, const struct pkgbin *pifp,
+       enum fwriteflags flags, const struct fieldinfo *fip)
+{
   assert(pigp->name);
   assert(pigp->name);
   if (flags&fw_printheader)
   if (flags&fw_printheader)
     varbuf_add_str(vb, "Package: ");
     varbuf_add_str(vb, "Package: ");
@@ -53,9 +55,11 @@ void w_name(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_version(struct varbuf *vb,
-               const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-               enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_version(struct varbuf *vb,
+          const struct pkginfo *pigp, const struct pkgbin *pifp,
+          enum fwriteflags flags, const struct fieldinfo *fip)
+{
   if (!informativeversion(&pifp->version)) return;
   if (!informativeversion(&pifp->version)) return;
   if (flags&fw_printheader)
   if (flags&fw_printheader)
     varbuf_add_str(vb, "Version: ");
     varbuf_add_str(vb, "Version: ");
@@ -64,9 +68,11 @@ void w_version(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_configversion(struct varbuf *vb,
-                     const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-                     enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_configversion(struct varbuf *vb,
+                const struct pkginfo *pigp, const struct pkgbin *pifp,
+                enum fwriteflags flags, const struct fieldinfo *fip)
+{
   if (pifp != &pigp->installed) return;
   if (pifp != &pigp->installed) return;
   if (!informativeversion(&pigp->configversion)) return;
   if (!informativeversion(&pigp->configversion)) return;
   if (pigp->status == stat_installed ||
   if (pigp->status == stat_installed ||
@@ -81,14 +87,18 @@ void w_configversion(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_null(struct varbuf *vb,
-            const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-            enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_null(struct varbuf *vb,
+       const struct pkginfo *pigp, const struct pkgbin *pifp,
+       enum fwriteflags flags, const struct fieldinfo *fip)
+{
 }
 }
 
 
-void w_section(struct varbuf *vb,
-               const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-               enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_section(struct varbuf *vb,
+          const struct pkginfo *pigp, const struct pkgbin *pifp,
+          enum fwriteflags flags, const struct fieldinfo *fip)
+{
   const char *value= pigp->section;
   const char *value= pigp->section;
   if (!value || !*value) return;
   if (!value || !*value) return;
   if (flags&fw_printheader)
   if (flags&fw_printheader)
@@ -98,9 +108,11 @@ void w_section(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_charfield(struct varbuf *vb,
-                 const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-                 enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_charfield(struct varbuf *vb,
+            const struct pkginfo *pigp, const struct pkgbin *pifp,
+            enum fwriteflags flags, const struct fieldinfo *fip)
+{
   const char *value = PKGPFIELD(pifp, fip->integer, const char *);
   const char *value = PKGPFIELD(pifp, fip->integer, const char *);
   if (!value || !*value) return;
   if (!value || !*value) return;
   if (flags&fw_printheader) {
   if (flags&fw_printheader) {
@@ -112,9 +124,11 @@ void w_charfield(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_filecharf(struct varbuf *vb,
-                 const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-                 enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_filecharf(struct varbuf *vb,
+            const struct pkginfo *pigp, const struct pkgbin *pifp,
+            enum fwriteflags flags, const struct fieldinfo *fip)
+{
   struct filedetails *fdp;
   struct filedetails *fdp;
 
 
   if (pifp != &pigp->available) return;
   if (pifp != &pigp->available) return;
@@ -136,9 +150,11 @@ void w_filecharf(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_booleandefno(struct varbuf *vb,
-                    const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-                    enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_booleandefno(struct varbuf *vb,
+               const struct pkginfo *pigp, const struct pkgbin *pifp,
+               enum fwriteflags flags, const struct fieldinfo *fip)
+{
   bool value = PKGPFIELD(pifp, fip->integer, bool);
   bool value = PKGPFIELD(pifp, fip->integer, bool);
   if (!(flags&fw_printheader)) {
   if (!(flags&fw_printheader)) {
     varbuf_add_str(vb, value ? "yes" : "no");
     varbuf_add_str(vb, value ? "yes" : "no");
@@ -150,9 +166,11 @@ void w_booleandefno(struct varbuf *vb,
   varbuf_add_str(vb, ": yes\n");
   varbuf_add_str(vb, ": yes\n");
 }
 }
 
 
-void w_priority(struct varbuf *vb,
-                const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-                enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_priority(struct varbuf *vb,
+           const struct pkginfo *pigp, const struct pkgbin *pifp,
+           enum fwriteflags flags, const struct fieldinfo *fip)
+{
   if (pigp->priority == pri_unknown) return;
   if (pigp->priority == pri_unknown) return;
   assert(pigp->priority <= pri_unknown);
   assert(pigp->priority <= pri_unknown);
   if (flags&fw_printheader)
   if (flags&fw_printheader)
@@ -164,9 +182,11 @@ void w_priority(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_status(struct varbuf *vb,
-              const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-              enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_status(struct varbuf *vb,
+         const struct pkginfo *pigp, const struct pkgbin *pifp,
+         enum fwriteflags flags, const struct fieldinfo *fip)
+{
   if (pifp != &pigp->installed) return;
   if (pifp != &pigp->installed) return;
   assert(pigp->want <= want_purge);
   assert(pigp->want <= want_purge);
   assert(pigp->eflag <= eflag_reinstreq);
   assert(pigp->eflag <= eflag_reinstreq);
@@ -250,9 +270,11 @@ void varbufdependency(struct varbuf *vb, struct dependency *dep) {
   }
   }
 }
 }
 
 
-void w_dependency(struct varbuf *vb,
-                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-                  enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_dependency(struct varbuf *vb,
+             const struct pkginfo *pigp, const struct pkgbin *pifp,
+             enum fwriteflags flags, const struct fieldinfo *fip)
+{
   char fnbuf[50];
   char fnbuf[50];
   const char *depdel;
   const char *depdel;
   struct dependency *dyp;
   struct dependency *dyp;
@@ -274,9 +296,11 @@ void w_dependency(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void w_conffiles(struct varbuf *vb,
-                 const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
-                 enum fwriteflags flags, const struct fieldinfo *fip) {
+void
+w_conffiles(struct varbuf *vb,
+            const struct pkginfo *pigp, const struct pkgbin *pifp,
+            enum fwriteflags flags, const struct fieldinfo *fip)
+{
   struct conffile *i;
   struct conffile *i;
 
 
   if (!pifp->conffiles || pifp == &pigp->available)
   if (!pifp->conffiles || pifp == &pigp->available)
@@ -299,7 +323,7 @@ void w_conffiles(struct varbuf *vb,
 
 
 void
 void
 w_trigpend(struct varbuf *vb,
 w_trigpend(struct varbuf *vb,
-           const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
+           const struct pkginfo *pigp, const struct pkgbin *pifp,
            enum fwriteflags flags, const struct fieldinfo *fip)
            enum fwriteflags flags, const struct fieldinfo *fip)
 {
 {
   struct trigpend *tp;
   struct trigpend *tp;
@@ -322,7 +346,7 @@ w_trigpend(struct varbuf *vb,
 
 
 void
 void
 w_trigaw(struct varbuf *vb,
 w_trigaw(struct varbuf *vb,
-         const struct pkginfo *pigp, const struct pkginfoperfile *pifp,
+         const struct pkginfo *pigp, const struct pkgbin *pifp,
          enum fwriteflags flags, const struct fieldinfo *fip)
          enum fwriteflags flags, const struct fieldinfo *fip)
 {
 {
   struct trigaw *ta;
   struct trigaw *ta;
@@ -343,8 +367,10 @@ w_trigaw(struct varbuf *vb,
     varbuf_add_char(vb, '\n');
     varbuf_add_char(vb, '\n');
 }
 }
 
 
-void varbufrecord(struct varbuf *vb,
-                  const struct pkginfo *pigp, const struct pkginfoperfile *pifp) {
+void
+varbufrecord(struct varbuf *vb,
+             const struct pkginfo *pigp, const struct pkgbin *pifp)
+{
   const struct fieldinfo *fip;
   const struct fieldinfo *fip;
   const struct arbitraryfield *afp;
   const struct arbitraryfield *afp;
 
 
@@ -359,8 +385,10 @@ void varbufrecord(struct varbuf *vb,
   }
   }
 }
 }
 
 
-void writerecord(FILE *file, const char *filename,
-                 const struct pkginfo *pigp, const struct pkginfoperfile *pifp) {
+void
+writerecord(FILE *file, const char *filename,
+            const struct pkginfo *pigp, const struct pkgbin *pifp)
+{
   struct varbuf vb = VARBUF_INIT;
   struct varbuf vb = VARBUF_INIT;
 
 
   varbufrecord(&vb,pigp,pifp);
   varbufrecord(&vb,pigp,pifp);
@@ -378,7 +406,7 @@ writedb(const char *filename, bool available, bool mustsync)
 
 
   struct pkgiterator *it;
   struct pkgiterator *it;
   struct pkginfo *pigp;
   struct pkginfo *pigp;
-  struct pkginfoperfile *pifp;
+  struct pkgbin *pifp;
   char *oldfn, *newfn;
   char *oldfn, *newfn;
   const char *which;
   const char *which;
   FILE *file;
   FILE *file;

+ 58 - 36
lib/dpkg/fields.c

@@ -61,7 +61,7 @@ convert_string(struct parsedb_state *ps, const struct pkginfo *pigp,
 }
 }
 
 
 void
 void
-f_name(struct pkginfo *pigp, struct pkginfoperfile *pifp,
+f_name(struct pkginfo *pigp, struct pkgbin *pifp,
        struct parsedb_state *ps,
        struct parsedb_state *ps,
        const char *value, const struct fieldinfo *fip)
        const char *value, const struct fieldinfo *fip)
 {
 {
@@ -74,9 +74,11 @@ f_name(struct pkginfo *pigp, struct pkginfoperfile *pifp,
   pigp->name = pkg_db_find(value)->name;
   pigp->name = pkg_db_find(value)->name;
 }
 }
 
 
-void f_filecharf(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-                 struct parsedb_state *ps,
-                 const char *value, const struct fieldinfo *fip) {
+void
+f_filecharf(struct pkginfo *pigp, struct pkgbin *pifp,
+            struct parsedb_state *ps,
+            const char *value, const struct fieldinfo *fip)
+{
   struct filedetails *fdp, **fdpp;
   struct filedetails *fdp, **fdpp;
   char *cpos, *space;
   char *cpos, *space;
   int allowextend;
   int allowextend;
@@ -116,15 +118,19 @@ void f_filecharf(struct pkginfo *pigp, struct pkginfoperfile *pifp,
                   "(compared to others)"), fip->name);
                   "(compared to others)"), fip->name);
 }
 }
 
 
-void f_charfield(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-                 struct parsedb_state *ps,
-                 const char *value, const struct fieldinfo *fip) {
+void
+f_charfield(struct pkginfo *pigp, struct pkgbin *pifp,
+            struct parsedb_state *ps,
+            const char *value, const struct fieldinfo *fip)
+{
   if (*value) PKGPFIELD(pifp,fip->integer,char*)= nfstrsave(value);
   if (*value) PKGPFIELD(pifp,fip->integer,char*)= nfstrsave(value);
 }
 }
 
 
-void f_boolean(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-               struct parsedb_state *ps,
-               const char *value, const struct fieldinfo *fip) {
+void
+f_boolean(struct pkginfo *pigp, struct pkgbin *pifp,
+          struct parsedb_state *ps,
+          const char *value, const struct fieldinfo *fip)
+{
   bool boolean;
   bool boolean;
 
 
   if (!*value)
   if (!*value)
@@ -135,25 +141,31 @@ void f_boolean(struct pkginfo *pigp, struct pkginfoperfile *pifp,
   PKGPFIELD(pifp, fip->integer, bool) = boolean;
   PKGPFIELD(pifp, fip->integer, bool) = boolean;
 }
 }
 
 
-void f_section(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-               struct parsedb_state *ps,
-               const char *value, const struct fieldinfo *fip) {
+void
+f_section(struct pkginfo *pigp, struct pkgbin *pifp,
+          struct parsedb_state *ps,
+          const char *value, const struct fieldinfo *fip)
+{
   if (!*value) return;
   if (!*value) return;
   pigp->section= nfstrsave(value);
   pigp->section= nfstrsave(value);
 }
 }
 
 
-void f_priority(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-                struct parsedb_state *ps,
-                const char *value, const struct fieldinfo *fip) {
+void
+f_priority(struct pkginfo *pigp, struct pkgbin *pifp,
+           struct parsedb_state *ps,
+           const char *value, const struct fieldinfo *fip)
+{
   if (!*value) return;
   if (!*value) return;
   pigp->priority = convert_string(ps, pigp, _("word in `priority' field"),
   pigp->priority = convert_string(ps, pigp, _("word in `priority' field"),
                                   priorityinfos, value, NULL, pri_other);
                                   priorityinfos, value, NULL, pri_other);
   if (pigp->priority == pri_other) pigp->otherpriority= nfstrsave(value);
   if (pigp->priority == pri_other) pigp->otherpriority= nfstrsave(value);
 }
 }
 
 
-void f_status(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-              struct parsedb_state *ps,
-              const char *value, const struct fieldinfo *fip) {
+void
+f_status(struct pkginfo *pigp, struct pkgbin *pifp,
+         struct parsedb_state *ps,
+         const char *value, const struct fieldinfo *fip)
+{
   const char *ep;
   const char *ep;
 
 
   if (ps->flags & pdb_rejectstatus)
   if (ps->flags & pdb_rejectstatus)
@@ -173,16 +185,20 @@ void f_status(struct pkginfo *pigp, struct pkginfoperfile *pifp,
                                 statusinfos, ep, NULL, -1);
                                 statusinfos, ep, NULL, -1);
 }
 }
 
 
-void f_version(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-               struct parsedb_state *ps,
-               const char *value, const struct fieldinfo *fip) {
+void
+f_version(struct pkginfo *pigp, struct pkgbin *pifp,
+          struct parsedb_state *ps,
+          const char *value, const struct fieldinfo *fip)
+{
   parse_db_version(ps, pigp, &pifp->version, value,
   parse_db_version(ps, pigp, &pifp->version, value,
                    _("error in Version string '%.250s'"), value);
                    _("error in Version string '%.250s'"), value);
 }
 }
 
 
-void f_revision(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-                struct parsedb_state *ps,
-                const char *value, const struct fieldinfo *fip) {
+void
+f_revision(struct pkginfo *pigp, struct pkgbin *pifp,
+           struct parsedb_state *ps,
+           const char *value, const struct fieldinfo *fip)
+{
   char *newversion;
   char *newversion;
 
 
   parse_warn(ps, pigp,
   parse_warn(ps, pigp,
@@ -196,9 +212,11 @@ void f_revision(struct pkginfo *pigp, struct pkginfoperfile *pifp,
   pifp->version.revision= nfstrsave(value);
   pifp->version.revision= nfstrsave(value);
 }
 }
 
 
-void f_configversion(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-                     struct parsedb_state *ps,
-                     const char *value, const struct fieldinfo *fip) {
+void
+f_configversion(struct pkginfo *pigp, struct pkgbin *pifp,
+                struct parsedb_state *ps,
+                const char *value, const struct fieldinfo *fip)
+{
   if (ps->flags & pdb_rejectstatus)
   if (ps->flags & pdb_rejectstatus)
     parse_error(ps, pigp,
     parse_error(ps, pigp,
                 _("value for `config-version' field not allowed in this context"));
                 _("value for `config-version' field not allowed in this context"));
@@ -237,9 +255,11 @@ malformed:
               (int)min(endent - value, 250), value);
               (int)min(endent - value, 250), value);
 }
 }
 
 
-void f_conffiles(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-                 struct parsedb_state *ps,
-                 const char *value, const struct fieldinfo *fip) {
+void
+f_conffiles(struct pkginfo *pigp, struct pkgbin *pifp,
+            struct parsedb_state *ps,
+            const char *value, const struct fieldinfo *fip)
+{
   static const char obsolete_str[]= "obsolete";
   static const char obsolete_str[]= "obsolete";
   struct conffile **lastp, *newlink;
   struct conffile **lastp, *newlink;
   const char *endent, *endfn, *hashstart;
   const char *endent, *endfn, *hashstart;
@@ -287,9 +307,11 @@ void f_conffiles(struct pkginfo *pigp, struct pkginfoperfile *pifp,
   }
   }
 }
 }
 
 
-void f_dependency(struct pkginfo *pigp, struct pkginfoperfile *pifp,
-                  struct parsedb_state *ps,
-                  const char *value, const struct fieldinfo *fip) {
+void
+f_dependency(struct pkginfo *pigp, struct pkgbin *pifp,
+             struct parsedb_state *ps,
+             const char *value, const struct fieldinfo *fip)
+{
   char c1, c2;
   char c1, c2;
   const char *p, *emsg;
   const char *p, *emsg;
   const char *depnamestart, *versionstart;
   const char *depnamestart, *versionstart;
@@ -491,7 +513,7 @@ scan_word(const char **valp)
 }
 }
 
 
 void
 void
-f_trigpend(struct pkginfo *pend, struct pkginfoperfile *pifp,
+f_trigpend(struct pkginfo *pend, struct pkgbin *pifp,
            struct parsedb_state *ps,
            struct parsedb_state *ps,
            const char *value, const struct fieldinfo *fip)
            const char *value, const struct fieldinfo *fip)
 {
 {
@@ -515,7 +537,7 @@ f_trigpend(struct pkginfo *pend, struct pkginfoperfile *pifp,
 }
 }
 
 
 void
 void
-f_trigaw(struct pkginfo *aw, struct pkginfoperfile *pifp,
+f_trigaw(struct pkginfo *aw, struct pkgbin *pifp,
          struct parsedb_state *ps,
          struct parsedb_state *ps,
          const char *value, const struct fieldinfo *fip)
          const char *value, const struct fieldinfo *fip)
 {
 {

+ 1 - 1
lib/dpkg/libdpkg.Versions

@@ -169,7 +169,7 @@ LIBDPKG_PRIVATE {
 
 
 	# Package struct handling
 	# Package struct handling
 	pkg_blank;
 	pkg_blank;
-	pkg_perfile_blank;
+	pkgbin_blank;
 	pkg_name_is_illegal;
 	pkg_name_is_illegal;
 	pkg_is_informative;
 	pkg_is_informative;
 	copy_dependency_links;
 	copy_dependency_links;

+ 4 - 4
lib/dpkg/parse.c

@@ -94,7 +94,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
 {
 {
   static int fd;
   static int fd;
   struct pkginfo newpig, *pigp;
   struct pkginfo newpig, *pigp;
-  struct pkginfoperfile *newpifp, *pifp;
+  struct pkgbin *newpifp, *pifp;
   struct arbitraryfield *arp, **larpp;
   struct arbitraryfield *arp, **larpp;
   struct trigaw *ta;
   struct trigaw *ta;
   int pdone;
   int pdone;
@@ -365,7 +365,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
     newpifp->depended= pifp->depended;
     newpifp->depended= pifp->depended;
 
 
     /* Copy across data. */
     /* Copy across data. */
-    memcpy(pifp,newpifp,sizeof(struct pkginfoperfile));
+    memcpy(pifp, newpifp, sizeof(struct pkgbin));
     if (!(flags & pdb_recordavailable)) {
     if (!(flags & pdb_recordavailable)) {
       pigp->want= newpig.want;
       pigp->want= newpig.want;
       pigp->eflag= newpig.eflag;
       pigp->eflag= newpig.eflag;
@@ -421,7 +421,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
  *        This starts out containing the old forwards info, which we use to
  *        This starts out containing the old forwards info, which we use to
  *        unthread the old reverse links. After we're done it is updated.
  *        unthread the old reverse links. After we're done it is updated.
  * @param newdepends The value that we ultimately want to have in updateme.
  * @param newdepends The value that we ultimately want to have in updateme.
- * @param available The pkginfoperfile to modify, available or installed.
+ * @param available The pkgbin to modify, available or installed.
  *
  *
  * It is likely that the backward pointer for the package in question
  * It is likely that the backward pointer for the package in question
  * (‘depended’) will be updated by this routine, but this will happen by
  * (‘depended’) will be updated by this routine, but this will happen by
@@ -436,7 +436,7 @@ void copy_dependency_links(struct pkginfo *pkg,
 {
 {
   struct dependency *dyp;
   struct dependency *dyp;
   struct deppossi *dop;
   struct deppossi *dop;
-  struct pkginfoperfile *addtopifp;
+  struct pkgbin *addtopifp;
 
 
   /* Delete ‘backward’ (‘depended’) links from other packages to
   /* Delete ‘backward’ (‘depended’) links from other packages to
    * dependencies listed in old version of this one. We do this by
    * dependencies listed in old version of this one. We do this by

+ 3 - 3
lib/dpkg/parsedump.h

@@ -30,13 +30,13 @@ struct parsedb_state {
 	int lno;
 	int lno;
 };
 };
 
 
-#define PKGIFPOFF(f) (offsetof(struct pkginfoperfile, f))
+#define PKGIFPOFF(f) (offsetof(struct pkgbin, f))
 #define PKGPFIELD(pifp,of,type) (*(type*)((char*)(pifp)+(of)))
 #define PKGPFIELD(pifp,of,type) (*(type*)((char*)(pifp)+(of)))
 
 
 #define FILEFOFF(f) (offsetof(struct filedetails, f))
 #define FILEFOFF(f) (offsetof(struct filedetails, f))
 #define FILEFFIELD(filedetail,of,type) (*(type*)((char*)(filedetail)+(of)))
 #define FILEFFIELD(filedetail,of,type) (*(type*)((char*)(filedetail)+(of)))
 
 
-typedef void freadfunction(struct pkginfo *pigp, struct pkginfoperfile *pifp,
+typedef void freadfunction(struct pkginfo *pigp, struct pkgbin *pifp,
                            struct parsedb_state *ps,
                            struct parsedb_state *ps,
                            const char *value, const struct fieldinfo *fip);
                            const char *value, const struct fieldinfo *fip);
 freadfunction f_name, f_charfield, f_priority, f_section, f_status, f_filecharf;
 freadfunction f_name, f_charfield, f_priority, f_section, f_status, f_filecharf;
@@ -50,7 +50,7 @@ enum fwriteflags {
 };
 };
 
 
 typedef void fwritefunction(struct varbuf*,
 typedef void fwritefunction(struct varbuf*,
-			    const struct pkginfo*, const struct pkginfoperfile*,
+                            const struct pkginfo *, const struct pkgbin *,
 			    enum fwriteflags flags, const struct fieldinfo*);
 			    enum fwriteflags flags, const struct fieldinfo*);
 fwritefunction w_name, w_charfield, w_priority, w_section, w_status, w_configversion;
 fwritefunction w_name, w_charfield, w_priority, w_section, w_status, w_configversion;
 fwritefunction w_version, w_null, w_booleandefno, w_dependency, w_conffiles;
 fwritefunction w_version, w_null, w_booleandefno, w_dependency, w_conffiles;

+ 1 - 1
lib/dpkg/pkg-format.c

@@ -202,7 +202,7 @@ pkg_format_parse(const char *fmt)
 
 
 void
 void
 pkg_format_show(const struct pkg_format_node *head,
 pkg_format_show(const struct pkg_format_node *head,
-                struct pkginfo *pkg, struct pkginfoperfile *pif)
+                struct pkginfo *pkg, struct pkgbin *pif)
 {
 {
 	struct varbuf vb = VARBUF_INIT, fb = VARBUF_INIT, wb = VARBUF_INIT;
 	struct varbuf vb = VARBUF_INIT, fb = VARBUF_INIT, wb = VARBUF_INIT;
 
 

+ 1 - 1
lib/dpkg/pkg-format.h

@@ -31,7 +31,7 @@ struct pkg_format_node;
 struct pkg_format_node *pkg_format_parse(const char *fmt);
 struct pkg_format_node *pkg_format_parse(const char *fmt);
 void pkg_format_free(struct pkg_format_node *head);
 void pkg_format_free(struct pkg_format_node *head);
 void pkg_format_show(const struct pkg_format_node *head,
 void pkg_format_show(const struct pkg_format_node *head,
-                     struct pkginfo *pkg, struct pkginfoperfile *pif);
+                     struct pkginfo *pkg, struct pkgbin *pif);
 
 
 DPKG_END_DECLS
 DPKG_END_DECLS
 
 

+ 1 - 1
lib/dpkg/vercmp.c

@@ -113,7 +113,7 @@ versionsatisfied3(const struct versionrevision *it,
 }
 }
 
 
 bool
 bool
-versionsatisfied(struct pkginfoperfile *it, struct deppossi *against)
+versionsatisfied(struct pkgbin *it, struct deppossi *against)
 {
 {
   return versionsatisfied3(&it->version,&against->version,against->verrel);
   return versionsatisfied3(&it->version,&against->version,against->verrel);
 }
 }

+ 2 - 2
src/archives.c

@@ -211,8 +211,8 @@ struct pkg_deconf_list *deconfigure = NULL;
 static time_t currenttime;
 static time_t currenttime;
 
 
 static int
 static int
-does_replace(struct pkginfo *newpigp, struct pkginfoperfile *newpifp,
-             struct pkginfo *oldpigp, struct pkginfoperfile *oldpifp)
+does_replace(struct pkginfo *newpigp, struct pkgbin *newpifp,
+             struct pkginfo *oldpigp, struct pkgbin *oldpifp)
 {
 {
   struct dependency *dep;
   struct dependency *dep;
 
 

+ 1 - 1
src/cleanup.c

@@ -188,7 +188,7 @@ void cu_preinstverynew(int argc, void **argv) {
                         "abort-install", NULL);
                         "abort-install", NULL);
   pkg->status= stat_notinstalled;
   pkg->status= stat_notinstalled;
   pkg->eflag &= ~eflag_reinstreq;
   pkg->eflag &= ~eflag_reinstreq;
-  pkg_perfile_blank(&pkg->installed);
+  pkgbin_blank(&pkg->installed);
   modstatdb_note(pkg);
   modstatdb_note(pkg);
   cleanup_pkg_failed--;
   cleanup_pkg_failed--;
 }
 }

+ 1 - 1
src/help.c

@@ -252,7 +252,7 @@ static void setexecute(const char *path, struct stat *stab) {
 }
 }
 
 
 static int
 static int
-do_script(struct pkginfo *pkg, struct pkginfoperfile *pif,
+do_script(struct pkginfo *pkg, struct pkgbin *pif,
           struct command *cmd, struct stat *stab, int warn)
           struct command *cmd, struct stat *stab, int warn)
 {
 {
   int c1, r;
   int c1, r;

+ 1 - 1
src/processarc.c

@@ -1169,7 +1169,7 @@ void process_archive(const char *filename) {
     otherpkg->eflag = eflag_ok;
     otherpkg->eflag = eflag_ok;
 
 
     blankversion(&otherpkg->configversion);
     blankversion(&otherpkg->configversion);
-    pkg_perfile_blank(&otherpkg->installed);
+    pkgbin_blank(&otherpkg->installed);
 
 
     otherpkg->clientdata->fileslistvalid = false;
     otherpkg->clientdata->fileslistvalid = false;
 
 

+ 1 - 1
src/remove.c

@@ -577,7 +577,7 @@ void removal_bulk(struct pkginfo *pkg) {
 
 
     /* This will mess up reverse links, but if we follow them
     /* This will mess up reverse links, but if we follow them
      * we won't go back because pkg->status is stat_notinstalled. */
      * we won't go back because pkg->status is stat_notinstalled. */
-    pkg_perfile_blank(&pkg->installed);
+    pkgbin_blank(&pkg->installed);
   }
   }
 
 
   pkg->eflag = eflag_ok;
   pkg->eflag = eflag_ok;