This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=36ca123e50f45056f2638930de88612cf93d8497

commit 36ca123e50f45056f2638930de88612cf93d8497
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Dec 17 06:02:01 2022 +0100

    libdpkg: Rename functions with names containing record to stanza
    
    Apply the same «stanza» term usage unification matching the documentation
    fixes, to function names.
---
 dselect/pkginfo.cc   |  6 ++++--
 lib/dpkg/dbmodify.c  |  2 +-
 lib/dpkg/dpkg-db.h   | 13 ++++++++-----
 lib/dpkg/dump.c      | 20 ++++++++++----------
 lib/dpkg/libdpkg.map |  6 +++---
 src/main/enquiry.c   |  2 +-
 src/query/main.c     |  8 ++++----
 7 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/dselect/pkginfo.cc b/dselect/pkginfo.cc
index 672beaf49..0defc4e2d 100644
--- a/dselect/pkginfo.cc
+++ b/dselect/pkginfo.cc
@@ -139,7 +139,8 @@ void packagelist::itd_statuscontrol() {
     severalinfoblurb();
   } else {
     varbuf vb;
-    
varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->installed);
+    varbuf_stanza(&vb, table[cursorline]->pkg,
+                  &table[cursorline]->pkg->installed);
     debug(dbg_general, "packagelist[%p]::idt_statuscontrol(); '%s'",
           this, vb.string());
     waddstr(infopad,vb.string());
@@ -154,7 +155,8 @@ void packagelist::itd_availablecontrol() {
     severalinfoblurb();
   } else {
     varbuf vb;
-    
varbufrecord(&vb,table[cursorline]->pkg,&table[cursorline]->pkg->available);
+    varbuf_stanza(&vb, table[cursorline]->pkg,
+                  &table[cursorline]->pkg->available);
     debug(dbg_general, "packagelist[%p]::idt_availablecontrol(); '%s'",
           this, vb.string());
     waddstr(infopad,vb.string());
diff --git a/lib/dpkg/dbmodify.c b/lib/dpkg/dbmodify.c
index ab47a5df1..b95bb77a8 100644
--- a/lib/dpkg/dbmodify.c
+++ b/lib/dpkg/dbmodify.c
@@ -434,7 +434,7 @@ modstatdb_note_core(struct pkginfo *pkg)
     internerr("modstatdb status '%d' is not writable", cstatus);
 
   varbuf_reset(&uvb);
-  varbufrecord(&uvb, pkg, &pkg->installed);
+  varbuf_stanza(&uvb, pkg, &pkg->installed);
 
   if (fwrite(uvb.buf, 1, uvb.used, importanttmp) != uvb.used)
     ohshite(_("unable to write updated status of '%.250s'"),
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index 036b9e9b8..106edd29d 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -455,8 +455,9 @@ const char *pkg_priority_name(const struct pkginfo *pkg);
 
 /*** from dump.c ***/
 
-void writerecord(FILE*, const char*,
-                 const struct pkginfo *, const struct pkgbin *);
+void
+write_stanza(FILE *, const char *,
+             const struct pkginfo *, const struct pkgbin *);
 
 enum writedb_flags {
   /** Dump ‘available’ in-core structures, not ‘status’. */
@@ -465,13 +466,15 @@ enum writedb_flags {
   wdb_must_sync                        = DPKG_BIT(1),
 };
 
-void writedb_records(FILE *fp, const char *filename, enum writedb_flags flags);
+void
+writedb_stanzas(FILE *fp, const char *filename, enum writedb_flags flags);
 void writedb(const char *filename, enum writedb_flags flags);
 
 /* Note: The varbufs must have been initialized and will not be
  * NUL-terminated. */
-void varbufrecord(struct varbuf *, const struct pkginfo *,
-                  const struct pkgbin *);
+void
+varbuf_stanza(struct varbuf *, const struct pkginfo *,
+              const struct pkgbin *);
 void varbufdependency(struct varbuf *vb, struct dependency *dep);
 
 /*** from depcon.c ***/
diff --git a/lib/dpkg/dump.c b/lib/dpkg/dump.c
index 43f978061..05018baaf 100644
--- a/lib/dpkg/dump.c
+++ b/lib/dpkg/dump.c
@@ -463,8 +463,8 @@ varbuf_add_arbfield(struct varbuf *vb, const struct 
arbitraryfield *arbfield,
 }
 
 void
-varbufrecord(struct varbuf *vb,
-             const struct pkginfo *pkg, const struct pkgbin *pkgbin)
+varbuf_stanza(struct varbuf *vb,
+              const struct pkginfo *pkg, const struct pkgbin *pkgbin)
 {
   const struct fieldinfo *fip;
   const struct arbitraryfield *afp;
@@ -478,12 +478,12 @@ varbufrecord(struct varbuf *vb,
 }
 
 void
-writerecord(FILE *file, const char *filename,
-            const struct pkginfo *pkg, const struct pkgbin *pkgbin)
+write_stanza(FILE *file, const char *filename,
+             const struct pkginfo *pkg, const struct pkgbin *pkgbin)
 {
   struct varbuf vb = VARBUF_INIT;
 
-  varbufrecord(&vb, pkg, pkgbin);
+  varbuf_stanza(&vb, pkg, pkgbin);
   varbuf_end_str(&vb);
 
   if (fputs(vb.buf, file) < 0)
@@ -494,7 +494,7 @@ writerecord(FILE *file, const char *filename,
 }
 
 void
-writedb_records(FILE *fp, const char *filename, enum writedb_flags flags)
+writedb_stanzas(FILE *fp, const char *filename, enum writedb_flags flags)
 {
   static char writebuf[8192];
 
@@ -517,15 +517,15 @@ writedb_records(FILE *fp, const char *filename, enum 
writedb_flags flags)
     pkg = array.pkgs[i];
     pkgbin = (flags & wdb_dump_available) ? &pkg->available : &pkg->installed;
 
-    /* Don't dump records which have no useful content. */
+    /* Don't dump stanzas which have no useful content. */
     if (!pkg_is_informative(pkg, pkgbin))
       continue;
 
-    varbufrecord(&vb, pkg, pkgbin);
+    varbuf_stanza(&vb, pkg, pkgbin);
     varbuf_add_char(&vb, '\n');
     varbuf_end_str(&vb);
     if (fputs(vb.buf, fp) < 0)
-      ohshite(_("failed to write %s database record about '%.50s' to 
'%.250s'"),
+      ohshite(_("failed to write %s database stanza about '%s' to '%s'"),
               which, pkgbin_name(pkg, pkgbin, pnaw_nonambig), filename);
     varbuf_reset(&vb);
   }
@@ -546,7 +546,7 @@ writedb(const char *filename, enum writedb_flags flags)
   file = atomic_file_new(filename, atomic_flags);
   atomic_file_open(file);
 
-  writedb_records(file->fp, filename, flags);
+  writedb_stanzas(file->fp, filename, flags);
 
   if (flags & wdb_must_sync)
     atomic_file_sync(file);
diff --git a/lib/dpkg/libdpkg.map b/lib/dpkg/libdpkg.map
index 4ba1df167..75918e903 100644
--- a/lib/dpkg/libdpkg.map
+++ b/lib/dpkg/libdpkg.map
@@ -394,15 +394,15 @@ LIBDPKG_PRIVATE {
        wantinfos;              # XXX variable, do not export
        varbuf_add_arbfield;
        varbufdependency;
-       varbufrecord;
-       writerecord;
+       varbuf_stanza;
+       write_stanza;
        parsedb_new;
        parsedb_open;
        parsedb_load;
        parsedb_parse;
        parsedb_close;
        parsedb;
-       writedb_records;
+       writedb_stanzas;
        writedb;
 
        dpkg_db_set_dir;
diff --git a/src/main/enquiry.c b/src/main/enquiry.c
index 82edd67a3..cc605c2dc 100644
--- a/src/main/enquiry.c
+++ b/src/main/enquiry.c
@@ -582,7 +582,7 @@ predeppackage(const char *const *argv)
   } while (dep);
 
   /* OK, we've found it - pkg has no unsatisfied pre-dependencies! */
-  writerecord(stdout, _("<standard output>"), pkg, &pkg->available);
+  write_stanza(stdout, _("<standard output>"), pkg, &pkg->available);
 
   m_output(stdout, _("<standard output>"));
 
diff --git a/src/query/main.c b/src/query/main.c
index 6695b6b6e..5f1967930 100644
--- a/src/query/main.c
+++ b/src/query/main.c
@@ -401,7 +401,7 @@ print_status(const char *const *argv)
   modstatdb_open(msdbrw_readonly);
 
   if (!*argv) {
-    writedb_records(stdout, _("<standard output>"), 0);
+    writedb_stanzas(stdout, _("<standard output>"), 0);
   } else {
     while ((thisarg = *argv++) != NULL) {
       pkg = dpkg_options_parse_pkgname(cipaction, thisarg);
@@ -416,7 +416,7 @@ print_status(const char *const *argv)
                pkg_name(pkg, pnaw_nonambig));
         failures++;
       } else {
-        writerecord(stdout, _("<standard output>"), pkg, &pkg->installed);
+        write_stanza(stdout, _("<standard output>"), pkg, &pkg->installed);
       }
 
       if (*argv != NULL)
@@ -446,7 +446,7 @@ print_avail(const char *const *argv)
   modstatdb_open(msdbrw_readonly | msdbrw_available_readonly);
 
   if (!*argv) {
-    writedb_records(stdout, _("<standard output>"), wdb_dump_available);
+    writedb_stanzas(stdout, _("<standard output>"), wdb_dump_available);
   } else {
     while ((thisarg = *argv++) != NULL) {
       pkg = dpkg_options_parse_pkgname(cipaction, thisarg);
@@ -456,7 +456,7 @@ print_avail(const char *const *argv)
                pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
         failures++;
       } else {
-        writerecord(stdout, _("<standard output>"), pkg, &pkg->available);
+        write_stanza(stdout, _("<standard output>"), pkg, &pkg->available);
       }
 
       if (*argv != NULL)

-- 
Dpkg.Org's dpkg

Reply via email to