const char *pdesc, *p;
int l;
- pdesc= pkg->installed.valid ? pkg->installed.description : 0;
+ pdesc = pkg->installed.valid ? pkg->installed.description : NULL;
if (!pdesc) pdesc= _("(no description available)");
p= strchr(pdesc,'\n');
if (!p) p= pdesc+strlen(pdesc);
const char *pdesc;
int plen, vlen, dlen;
- pdesc= pkg->installed.valid ? pkg->installed.description : 0;
+ pdesc = pkg->installed.valid ? pkg->installed.description : NULL;
if (!pdesc) pdesc= _("(no description available)");
plen= strlen(pkgl[i]->name);
ensure_allinstfiles_available_quiet();
ensure_diversions();
- while ((thisarg= *argv++) != 0) {
+ while ((thisarg = *argv++) != NULL) {
found= 0;
/* Trim trailing slash and slash dot from the argument if it's
found += searchoutput(namenode);
} else {
it= iterfilestart();
- while ((namenode= iterfilenext(it)) != 0) {
+ while ((namenode = iterfilenext(it)) != NULL) {
if (fnmatch(thisarg,namenode->name,0)) continue;
found+= searchoutput(namenode);
}
else
modstatdb_init(admindir,msdbrw_readonly);
- while ((thisarg= *argv++) != 0) {
+ while ((thisarg = *argv++) != NULL) {
pkg= findpackage(thisarg);
switch (cipaction->arg) {
internerr("unknown action");
}
- if (*(argv + 1) == 0)
+ if (*(argv + 1) == NULL)
putchar('\n');
if (ferror(stdout)) werr("stdout");
}
Use --help for help about querying packages;\n\
Use --license for copyright license and lack of warranty (GNU GPL).");
-const struct cmdinfo *cipaction= 0;
+const struct cmdinfo *cipaction = NULL;
int f_pending=0, f_recursive=0, f_alsoselect=1, f_skipsame=0, f_noact=0;
int f_autodeconf=0, f_nodebsig=0;
unsigned long f_debug=0;
int errabort = 50;
const char *admindir= ADMINDIR;
const char *instdir= "";
-struct packageinlist *ignoredependss=0;
+struct packageinlist *ignoredependss = NULL;
static void setaction(const struct cmdinfo *cip, const char *value) {
if (cipaction)
* have a very similar structure.
*/
#define ACTION(longopt,shortopt,code,function) \
- { longopt, shortopt, 0,0,0, setaction, code, 0, (voidfnp)function }
+ { longopt, shortopt, 0, NULL, NULL, setaction, code, NULL, (voidfnp)function }
#define OBSOLETE(longopt,shortopt) \
- { longopt, shortopt, 0,0,0, setobsolete, 0, 0, 0 }
+ { longopt, shortopt, 0, NULL, NULL, setobsolete, 0, NULL, NULL }
ACTION( "listfiles", 'L', act_listfiles, enqperpackage ),
ACTION( "status", 's', act_status, enqperpackage ),
ACTION( "search", 'S', act_searchfiles, searchfiles ),
ACTION( "show", 'W', act_listpackages, showpackages ),
- { "admindir", 0, 1, 0, &admindir, 0 },
- { "showformat", 'f', 1, 0, &showformat, 0 },
- { "help", 'h', 0, 0, 0, helponly },
- { "version", 0, 0, 0, 0, versiononly },
- { "licence",/* UK spelling */ 0,0,0,0, showcopyright },
- { "license",/* US spelling */ 0,0,0,0, showcopyright },
- { 0, 0 }
+ { "admindir", 0, 1, NULL, &admindir, NULL },
+ { "showformat", 'f', 1, NULL, &showformat, NULL },
+ { "help", 'h', 0, NULL, NULL, helponly },
+ { "version", 0, 0, NULL, NULL, versiononly },
+ /* UK spelling. */
+ { "licence", 0, 0, NULL, NULL, showcopyright },
+ /* US spelling */
+ { "license", 0, 0, NULL, NULL, showcopyright },
+ { NULL, 0, 0, NULL, NULL, NULL }
};
int main(int argc, const char *const *argv) {
standard_startup(&ejbuf, argc, &argv, NULL, 0, cmdinfos);
if (!cipaction) badusage(_("need an action option"));
- setvbuf(stdout,0,_IONBF,0);
+ setvbuf(stdout, NULL, _IONBF, 0);
filesdbinit();
actionfunction= (void (*)(const char* const*))cipaction->farg;
{ "admindir", 0, 1, NULL, &admindir },
{ "by-package", 'f', 1, NULL, &bypackage },
{ "no-await", 0, 0, NULL, &bypackage, noawait },
- { "no-act", 0, 0, &f_noact, NULL, 0, 1 },
- { "check-supported", 0, 0, &f_check, NULL, 0, 1 },
+ { "no-act", 0, 0, &f_noact, NULL, NULL, 1 },
+ { "check-supported", 0, 0, &f_check, NULL, NULL, 1 },
{ "help", 'h', 0, NULL, NULL, helponly },
{ "version", 0, 0, NULL, NULL, versiononly },
/* UK spelling */