Welcome to little lamb

Code » qmdoc » commit c23250f

Update to latest limb

author Olivier Brunel
2023-07-05 07:44:58 UTC
committer Olivier Brunel
2023-07-07 16:59:36 UTC
parent 858479e5f2fd6e1415bbaf016130d6d7e5389b57

Update to latest limb

src/qmdoc/qmdoc.c +7 -8

diff --git a/src/qmdoc/qmdoc.c b/src/qmdoc/qmdoc.c
index b6530af..80675f5 100644
--- a/src/qmdoc/qmdoc.c
+++ b/src/qmdoc/qmdoc.c
@@ -16,7 +16,6 @@
 #include <limb/posixplz.h>
 #include <limb/samisc.h>
 #include <limb/u32.h>
-#include <limb/unix-transactional.h>
 #include "md4c.h"
 #include "qmdoc.h"
 #include "config.h"
@@ -1420,7 +1419,7 @@ real_path_at(stralloc *sa, int bfd, const char *file)
     char buf[strlen(file) + 1];
     memcpy(buf, file, sizeof(buf));
 
-    if (sarealpathat(sa, bfd, buf) < 0)
+    if (sa_realpathat(sa, bfd, buf) < 0)
         return (fileoff == (size_t) -1) ? file : sa->s + fileoff;
     return sa->s + off;
 }
@@ -1636,7 +1635,7 @@ scan_pages(enum idx *idx_mode, int bfd, stralloc *filesa, size_t fileoff, int nf
                 .ndirs = 0,
             };
 
-            int r = sascandirat(&ctx->sa, bfd, file(), scan_dir, &scan);
+            int r = sa_scandirat(&ctx->sa, bfd, file(), scan_dir, &scan);
             if (r < 0) {
                 scan.sa->len = scan.off;
                 fd_close(dirfd);
@@ -1656,7 +1655,7 @@ scan_pages(enum idx *idx_mode, int bfd, stralloc *filesa, size_t fileoff, int nf
             if (scan.ndirs) {
                 size_t aoff = scan.sa->len;
                 /* make an array of names('s offsets) */
-                int n = sacoloff(scan.sa, scan.off, aoff);
+                int n = sa_coloff(scan.sa, scan.off, aoff);
                 /* sort said array, to process subdirs in order */
                 struct cmp cmp = {
                     .sa = scan.sa,
@@ -1689,7 +1688,7 @@ scan_pages(enum idx *idx_mode, int bfd, stralloc *filesa, size_t fileoff, int nf
 
         /* special handling for symlinks.. */
         salen = ctx->buf.sa.len;
-        if (S_ISLNK(st.st_mode) && !sareadlinkat0(&ctx->buf.sa, bfd, file())) {
+        if (S_ISLNK(st.st_mode) && !sa_readlinkat0(&ctx->buf.sa, bfd, file())) {
             char *dst = ctx->buf.sa.s + salen;
             size_t dlen = ctx->buf.sa.len - salen - 1;
             size_t off = byte_chr(dst, dlen, '/');
@@ -2201,13 +2200,13 @@ main (int argc, const char *argv[])
 
         if (parse.header != (size_t) -1) {
             ctx.doc.oheader = ctx.sa.len;
-            if (!open_slurp_close(&ctx.sa, ctx.sa.s + parse.header) || !stralloc_0(&ctx.sa))
+            if (!open_saread_close(&ctx.sa, ctx.sa.s + parse.header) || !stralloc_0(&ctx.sa))
                 diefusys((errno == ENOMEM) ? EX_TEMPFAIL : EX_NOINPUT,
                          "load data from '", ctx.sa.s + parse.header, "'");
         }
         if (parse.footer != (size_t) -1) {
             ctx.doc.ofooter = ctx.sa.len;
-            if (!open_slurp_close(&ctx.sa, ctx.sa.s + parse.footer) || !stralloc_0(&ctx.sa))
+            if (!open_saread_close(&ctx.sa, ctx.sa.s + parse.footer) || !stralloc_0(&ctx.sa))
                 diefusys((errno == ENOMEM) ? EX_TEMPFAIL : EX_NOINPUT,
                          "load data from '", ctx.sa.s + parse.footer, "'");
         }
@@ -2251,7 +2250,7 @@ main (int argc, const char *argv[])
 
             if (ctx.options & OPT_INLINE_CSS) {
                 ctx.css[i] = ctx.sa.len;
-                if (!slurp(&ctx.sa, from) || !stralloc_0(&ctx.sa))
+                if (!sa_read(&ctx.sa, from) || !stralloc_0(&ctx.sa))
                     diefusys((errno == ENOMEM) ? EX_TEMPFAIL : EX_NOINPUT,
                              "load CSS from ", ESC,
                              (i == CSS_CUSTOM) ? ctx.sa.s + off : file,