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

libdpkg: Rename package blank functions to pkg_blank and pkg_perfile_blank

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

+ 9 - 5
lib/dpkg/database.c

@@ -61,7 +61,9 @@ void blankversion(struct versionrevision *version) {
   version->version= version->revision= NULL;
 }
 
-void blankpackage(struct pkginfo *pigp) {
+void
+pkg_blank(struct pkginfo *pigp)
+{
   pigp->name= NULL;
   pigp->status= stat_notinstalled;
   pigp->eflag = eflag_ok;
@@ -75,11 +77,13 @@ void blankpackage(struct pkginfo *pigp) {
   pigp->trigaw.head = pigp->trigaw.tail = NULL;
   pigp->othertrigaw_head = NULL;
   pigp->trigpend_head = NULL;
-  blankpackageperfile(&pigp->installed);
-  blankpackageperfile(&pigp->available);
+  pkg_perfile_blank(&pigp->installed);
+  pkg_perfile_blank(&pigp->available);
 }
 
-void blankpackageperfile(struct pkginfoperfile *pifp) {
+void
+pkg_perfile_blank(struct pkginfoperfile *pifp)
+{
   pifp->essential = false;
   pifp->depends= NULL;
   pifp->depended= NULL;
@@ -135,7 +139,7 @@ pkg_db_find(const char *inname)
   if (*pointerp) { free(name); return *pointerp; }
 
   newpkg= nfmalloc(sizeof(struct pkginfo));
-  blankpackage(newpkg);
+  pkg_blank(newpkg);
   newpkg->name= nfstrsave(name);
   newpkg->next= NULL;
   *pointerp= newpkg;

+ 2 - 2
lib/dpkg/dpkg-db.h

@@ -213,8 +213,8 @@ const char *pkgadminfile(struct pkginfo *pkg, const char *whichfile);
 
 /*** from database.c ***/
 
-void blankpackage(struct pkginfo *pp);
-void blankpackageperfile(struct pkginfoperfile *pifp);
+void pkg_blank(struct pkginfo *pp);
+void pkg_perfile_blank(struct pkginfoperfile *pifp);
 void blankversion(struct versionrevision*);
 bool pkg_is_informative(struct pkginfo *pkg, struct pkginfoperfile *info);
 

+ 2 - 2
lib/dpkg/libdpkg.Versions

@@ -163,8 +163,8 @@ LIBDPKG_PRIVATE {
 	parseversion;
 
 	# Package struct handling
-	blankpackage;
-	blankpackageperfile;
+	pkg_blank;
+	pkg_perfile_blank;
 	pkg_name_is_illegal;
 	pkg_is_informative;
 	copy_dependency_links;

+ 1 - 1
lib/dpkg/parse.c

@@ -144,7 +144,7 @@ int parsedb(const char *filename, enum parsedbflags flags,
 
   for (;;) { /* loop per package */
     memset(fieldencountered, 0, sizeof(fieldencountered));
-    blankpackage(&newpig);
+    pkg_blank(&newpig);
 
 /* Skip adjacent new lines */
     while(!EOF_mmap(dataptr, endptr)) {

+ 1 - 1
lib/dpkg/test/t-pkg-queue.c

@@ -54,7 +54,7 @@ test_pkg_queue_push_pop(void)
 	struct pkg_list *l1, *l2, *l3;
 	struct pkginfo pkg, *pkgp;
 
-	blankpackage(&pkg);
+	pkg_blank(&pkg);
 
 	test_pass(pkg_queue_is_empty(&q));
 

+ 2 - 2
lib/dpkg/test/t-pkginfo.c

@@ -29,13 +29,13 @@ test_pkginfo_informative(void)
 {
 	struct pkginfo pkg;
 
-	blankpackage(&pkg);
+	pkg_blank(&pkg);
 	test_fail(pkg_is_informative(&pkg, &pkg.installed));
 
 	pkg.want = want_purge;
 	test_pass(pkg_is_informative(&pkg, &pkg.installed));
 
-	blankpackage(&pkg);
+	pkg_blank(&pkg);
 	pkg.installed.description = "test description";
 	test_pass(pkg_is_informative(&pkg, &pkg.installed));
 

+ 1 - 1
src/cleanup.c

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

+ 1 - 1
src/processarc.c

@@ -1142,7 +1142,7 @@ void process_archive(const char *filename) {
     otherpkg->eflag = eflag_ok;
 
     blankversion(&otherpkg->configversion);
-    blankpackageperfile(&otherpkg->installed);
+    pkg_perfile_blank(&otherpkg->installed);
 
     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
      * we won't go back because pkg->status is stat_notinstalled.
      */
-    blankpackageperfile(&pkg->installed);
+    pkg_perfile_blank(&pkg->installed);
   }
       
   pkg->eflag = eflag_ok;