summaryrefslogtreecommitdiffstats
path: root/source4/lib/popt/popthelp.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-02-24 06:49:59 +0000
committerStefan Metzmacher <metze@samba.org>2004-02-24 06:49:59 +0000
commit2027b1922b01d3b6af17d24ae51d33cc7048d27d (patch)
tree9a67d0c513d5ea77217bbea21f1a4e005e03f7cd /source4/lib/popt/popthelp.c
parent8105eb67881140da072bc7f5ad760e1569a56859 (diff)
downloadsamba-2027b1922b01d3b6af17d24ae51d33cc7048d27d.tar.gz
samba-2027b1922b01d3b6af17d24ae51d33cc7048d27d.tar.xz
samba-2027b1922b01d3b6af17d24ae51d33cc7048d27d.zip
let the popt replacement stuff survive a make proto
metze (This used to be commit 0f1c6dd631c7a1d4be333b8e3e4ce9850752d5c2)
Diffstat (limited to 'source4/lib/popt/popthelp.c')
-rw-r--r--source4/lib/popt/popthelp.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/source4/lib/popt/popthelp.c b/source4/lib/popt/popthelp.c
index 6b790a63e78..562995c011d 100644
--- a/source4/lib/popt/popthelp.c
+++ b/source4/lib/popt/popthelp.c
@@ -10,7 +10,8 @@
static void displayArgs(poptContext con,
/*@unused@*/ enum poptCallbackReason foo,
struct poptOption * key,
- /*@unused@*/ const char * arg, /*@unused@*/ void * data) {
+ /*@unused@*/ const char * arg, /*@unused@*/ void * data)
+{
if (key->shortName== '?')
poptPrintHelp(con, stdout, 0);
else
@@ -55,7 +56,8 @@ getArgDescrip(const struct poptOption * opt, const char *translation_domain)
static void singleOptionHelp(FILE * f, int maxLeftCol,
const struct poptOption * opt,
- const char *translation_domain) {
+ const char *translation_domain)
+{
int indentLength = maxLeftCol + 5;
int lineLength = 79 - indentLength;
const char * help = D_(translation_domain, opt->descrip);
@@ -109,7 +111,8 @@ out:
}
static int maxArgWidth(const struct poptOption * opt,
- const char * translation_domain) {
+ const char * translation_domain)
+{
int max = 0;
int this;
const char * s;
@@ -139,7 +142,8 @@ static int maxArgWidth(const struct poptOption * opt,
static void singleTableHelp(FILE * f, const struct poptOption * table,
int left,
- const char *translation_domain) {
+ const char *translation_domain)
+{
const struct poptOption * opt;
const char *sub_transdom;
@@ -167,7 +171,8 @@ static void singleTableHelp(FILE * f, const struct poptOption * table,
}
}
-static int showHelpIntro(poptContext con, FILE * f) {
+static int showHelpIntro(poptContext con, FILE * f)
+{
int len = 6;
const char * fn;
@@ -182,7 +187,8 @@ static int showHelpIntro(poptContext con, FILE * f) {
return len;
}
-void poptPrintHelp(poptContext con, FILE * f, /*@unused@*/ int flags) {
+ void poptPrintHelp(poptContext con, FILE * f, /*@unused@*/ int flags)
+{
int leftColWidth;
showHelpIntro(con, f);
@@ -197,7 +203,8 @@ void poptPrintHelp(poptContext con, FILE * f, /*@unused@*/ int flags) {
static int singleOptionUsage(FILE * f, int cursor,
const struct poptOption * opt,
- const char *translation_domain) {
+ const char *translation_domain)
+{
int len = 3;
char shortStr[2] = { '\0', '\0' };
const char * item = shortStr;
@@ -232,7 +239,8 @@ static int singleOptionUsage(FILE * f, int cursor,
}
static int singleTableUsage(FILE * f, int cursor, const struct poptOption * table,
- const char *translation_domain) {
+ const char *translation_domain)
+{
const struct poptOption * opt;
opt = table;
@@ -253,7 +261,8 @@ static int singleTableUsage(FILE * f, int cursor, const struct poptOption * tabl
}
static int showShortOptions(const struct poptOption * opt, FILE * f,
- char * str) {
+ char * str)
+{
char s[300]; /* this is larger then the ascii set, so
it should do just fine */
@@ -279,7 +288,8 @@ static int showShortOptions(const struct poptOption * opt, FILE * f,
return strlen(s) + 4;
}
-void poptPrintUsage(poptContext con, FILE * f, /*@unused@*/ int flags) {
+ void poptPrintUsage(poptContext con, FILE * f, /*@unused@*/ int flags)
+{
int cursor;
cursor = showHelpIntro(con, f);
@@ -295,7 +305,8 @@ void poptPrintUsage(poptContext con, FILE * f, /*@unused@*/ int flags) {
fprintf(f, "\n");
}
-void poptSetOtherOptionHelp(poptContext con, const char * text) {
+ void poptSetOtherOptionHelp(poptContext con, const char * text)
+{
if (con->otherHelp) xfree(con->otherHelp);
con->otherHelp = xstrdup(text);
}