Add macro %isu_package to generate ISU Package
[platform/upstream/rpm.git] / cliutils.h
index 830b4c4..b5deee1 100644 (file)
@@ -1,20 +1,25 @@
 #ifndef _CLIUTIL_H
 #define _CLIUTIL_H
 
+/** \file cliutils.h
+ *
+ *  Misc helpers for RPM CLI tools
+ */
+
 #include <stdio.h>
 #include <popt.h>
 #include <rpm/rpmutil.h>
 
+/* "normalized" exit: avoid overflowing and xargs special value 255 */
+#define RETVAL(rc) (((rc) > 254) ? 254 : (rc))
+
 RPM_GNUC_NORETURN
 void argerror(const char * desc);
 
 void printUsage(poptContext con, FILE * fp, int flags);
 
-/* Initialize cli-environment, returning parsed popt context caller */
-poptContext initCli(const char *ctx, struct poptOption *optionsTable,
-                   int argc, char *argv[]);
+int initPipe(void);
 
-/* Free up common resources, return "normalized" exit code */
-int finishCli(poptContext optCon, int rc);
+int finishPipe(void);
 
 #endif /* _CLIUTIL_H */