about summary refs log tree commit diff
path: root/editor/pamundice.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-03-27 01:46:26 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-03-27 01:46:26 +0000
commitdff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa (patch)
treeb147568ccffc4cdba9e2a98de1452450ba8e55c3 /editor/pamundice.c
parent4ce684c4978610d1ea42be1b00f7332f3f5f337a (diff)
downloadnetpbm-mirror-dff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa.tar.gz
netpbm-mirror-dff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa.tar.xz
netpbm-mirror-dff6b9fdfeb78fe21a66aa459ddc1d5f7e362dfa.zip
Promote Advanced (10.73) to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@2692 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor/pamundice.c')
-rw-r--r--editor/pamundice.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/editor/pamundice.c b/editor/pamundice.c
index 89d8b6b5..9a80e46d 100644
--- a/editor/pamundice.c
+++ b/editor/pamundice.c
@@ -50,7 +50,7 @@ parseCommandLine(int argc, char ** argv,
    was passed to us as the argv array.  We also trash *argv.
 -----------------------------------------------------------------------------*/
     optEntry *option_def;
-        /* Instructions to optParseOptions3 on how to parse our options.
+        /* Instructions to pm_optParseOptions3 on how to parse our options.
          */
     optStruct3 opt;
     
@@ -76,7 +76,7 @@ parseCommandLine(int argc, char ** argv,
     opt.short_allowed = FALSE;  /* We have no short (old-fashioned) options */
     opt.allowNegNum = FALSE;  /* We have no parms that are negative numbers */
 
-    optParseOptions3( &argc, argv, opt, sizeof(opt), 0 );
+    pm_optParseOptions3( &argc, argv, opt, sizeof(opt), 0 );
         /* Uses and sets argc, argv, and some of *cmdline_p and others. */
 
     if (!acrossSpec)
@@ -232,12 +232,12 @@ doSubstitution(const char *    const pattern,
 
             switch (pattern[inCursor]) {
             case 'a':
-                asprintfN(&substString, "%0*u", precision, file);
-                asprintfN(&desc, "file (across)");
+                pm_asprintf(&substString, "%0*u", precision, file);
+                pm_asprintf(&desc, "file (across)");
                 break;
             case 'd':
-                asprintfN(&substString, "%0*u", precision, rank);
-                asprintfN(&desc, "rank (down)");
+                pm_asprintf(&substString, "%0*u", precision, rank);
+                pm_asprintf(&desc, "rank (down)");
                 break;
             default:
                 pm_error("Unknown format specifier '%c' in input file "
@@ -249,12 +249,12 @@ doSubstitution(const char *    const pattern,
                 pm_error("%s number %u is wider than "
                          "the %u characters specified in the "
                          "input file pattern",
-                         desc, strlen(substString), precision);
+                         desc, (unsigned)strlen(substString), precision);
             else
                 buffer_addString(bufferP, substString);
             
-            strfree(desc);
-            strfree(substString);
+            pm_strfree(desc);
+            pm_strfree(substString);
 
             ++inCursor;
         }
@@ -288,7 +288,7 @@ computeInputFileName(const char *  const pattern,
             buffer_addChar(&buffer, pattern[inCursor++]);
     }
 
-    asprintfN(fileNameP, "%s", buffer.string);
+    pm_asprintf(fileNameP, "%s", buffer.string);
 
     buffer_term(&buffer);
 }
@@ -327,7 +327,7 @@ getCommonInfo(const char *   const inputFilePattern,
 
     pm_close(ifP);
 
-    strfree(fileName);
+    pm_strfree(fileName);
 }
 
 
@@ -344,7 +344,7 @@ openInputImage(const char * const inputFilePattern,
 
     retval = pm_openr(fileName);
     
-    strfree(fileName);
+    pm_strfree(fileName);
 
     return retval;
 }
@@ -491,7 +491,12 @@ openInStreams(struct pam         inpam[],
 /*----------------------------------------------------------------------------
    Open the input files for a single horizontal slice (there's one file
    for each vertical slice) and read the Netpbm headers from them.  Return
-   the pam structures to describe each.
+   the pam structures to describe each as inpam[].
+
+   Open the files for horizontal slice number 'rank', assuming there are
+   'fileCount' vertical slices (so open 'fileCount' files).  Use
+   inputFilePattern[] with each rank and file number to compute the name of
+   each file.
 -----------------------------------------------------------------------------*/
     unsigned int file;
 
@@ -507,7 +512,9 @@ openInStreams(struct pam         inpam[],
 static void
 closeInFiles(struct pam         pam[],
              unsigned int const fileCount) {
-
+/*----------------------------------------------------------------------------
+   Close the 'fileCount' input file streams represented by pam[].
+-----------------------------------------------------------------------------*/
     unsigned int file;
     
     for (file = 0; file < fileCount; ++file)