Explorar o código

Rename cmdinfos set functions to have underscores between words

Guillem Jover %!s(int64=13) %!d(string=hai) anos
pai
achega
632c785858
Modificáronse 5 ficheiros con 54 adicións e 34 borrados
  1. 2 2
      dpkg-deb/main.c
  2. 4 2
      dpkg-split/main.c
  3. 13 7
      dselect/main.cc
  4. 6 6
      src/divertcmd.c
  5. 29 17
      src/main.c

+ 2 - 2
dpkg-deb/main.c

@@ -206,7 +206,7 @@ set_compress_strategy(const struct cmdinfo *cip, const char *value)
 }
 
 static void
-setcompresstype(const struct cmdinfo *cip, const char *value)
+set_compress_type(const struct cmdinfo *cip, const char *value)
 {
   compress_params.type = compressor_find_by_name(value);
   if (compress_params.type == compressor_type_unknown)
@@ -234,7 +234,7 @@ static const struct cmdinfo cmdinfos[]= {
   { "verbose",       'v', 0, &opt_verbose,   NULL,         NULL,          1 },
   { "nocheck",       0,   0, &nocheckflag,   NULL,         NULL,          1 },
   { NULL,            'z', 1, NULL,           NULL,         set_compress_level },
-  { NULL,            'Z', 1, NULL,           NULL,         setcompresstype  },
+  { NULL,            'Z', 1, NULL,           NULL,         set_compress_type  },
   { NULL,            'S', 1, NULL,           NULL,         set_compress_strategy },
   { "showformat",    0,   1, NULL,           &showformat,  NULL             },
   { "help",          '?', 0, NULL,           NULL,         usage            },

+ 4 - 2
dpkg-split/main.c

@@ -117,7 +117,9 @@ void rerreof(FILE *f, const char *fn) {
   ohshit(_("unexpected end of file in %.250s"),fn);
 }
 
-static void setpartsize(const struct cmdinfo *cip, const char *value) {
+static void
+set_part_size(const struct cmdinfo *cip, const char *value)
+{
   off_t newpartsize;
   char *endp;
 
@@ -145,7 +147,7 @@ static const struct cmdinfo cmdinfos[]= {
   { "help",         '?',  0,  NULL, NULL,             usage               },
   { "version",       0,   0,  NULL, NULL,             printversion        },
   { "depotdir",      0,   1,  NULL, &opt_depotdir,    NULL                },
-  { "partsize",     'S',  1,  NULL, NULL,             setpartsize         },
+  { "partsize",     'S',  1,  NULL, NULL,             set_part_size       },
   { "output",       'o',  1,  NULL, &opt_outputfile,  NULL                },
   { "npquiet",      'Q',  0,  &opt_npquiet, NULL,     NULL,           1   },
   { "msdos",         0,   0,  &opt_msdos, NULL,       NULL,           1   },

+ 13 - 7
dselect/main.cc

@@ -222,7 +222,9 @@ usage(const struct cmdinfo *ci, const char *value)
 /* These are called by C code, so need to have C calling convention */
 extern "C" {
 
-  static void setdebug(const struct cmdinfo*, const char *v) {
+  static void
+  set_debug(const struct cmdinfo*, const char *v)
+  {
     FILE *fp;
 
     fp = fopen(v, "a");
@@ -234,7 +236,9 @@ extern "C" {
     debug_set_mask(dbg_general | dbg_depcon);
   }
 
-  static void setexpert(const struct cmdinfo*, const char *v) {
+  static void
+  set_expert(const struct cmdinfo*, const char *v)
+  {
     expertmode= 1;
   }
 
@@ -258,7 +262,9 @@ extern "C" {
    *            --color colheads:,green:bright
    *            --color selstate::reverse  // doesn't work FIXME
    */
-  static void setcolor(const struct cmdinfo*, const char *string) {
+  static void
+  set_color(const struct cmdinfo*, const char *string)
+  {
     char *s;
     char *colours, *attributes, *attrib, *colourname;
     int screenpart, aval;
@@ -304,12 +310,12 @@ extern "C" {
 
 static const struct cmdinfo cmdinfos[]= {
   { "admindir",     0,   1,  0,  &admindir,  0               },
-  { "debug",       'D',  1,  0,  0,          setdebug        },
-  { "expert",      'E',  0,  0,  0,          setexpert       },
+  { "debug",       'D',  1,  0,  0,          set_debug       },
+  { "expert",      'E',  0,  0,  0,          set_expert      },
   { "help",        '?',  0,  0,  0,          usage           },
   { "version",      0,   0,  0,  0,          printversion    },
-  { "color",        0,   1,  0,  0,          setcolor        }, /* US spelling */
-  { "colour",       0,   1,  0,  0,          setcolor        }, /* UK spelling */
+  { "color",        0,   1,  0,  0,          set_color       }, /* US spelling */
+  { "colour",       0,   1,  0,  0,          set_color       }, /* UK spelling */
   { 0,              0,   0,  0,  0,          0               }
 };
 

+ 6 - 6
src/divertcmd.c

@@ -717,7 +717,7 @@ diversion_listpackage(const char *const *argv)
 }
 
 static void
-setpackage(const struct cmdinfo *cip, const char *value)
+set_package(const struct cmdinfo *cip, const char *value)
 {
 	opt_pkgname_match_any = false;
 
@@ -729,7 +729,7 @@ setpackage(const struct cmdinfo *cip, const char *value)
 }
 
 static void
-setdivertto(const struct cmdinfo *cip, const char *value)
+set_divertto(const struct cmdinfo *cip, const char *value)
 {
 	opt_divertto = value;
 
@@ -750,9 +750,9 @@ static const struct cmdinfo cmdinfos[] = {
 	ACTION("truename",    0, 0, diversion_truename),
 
 	{ "admindir",   0,   1,  NULL,         &admindir, NULL          },
-	{ "divert",     0,   1,  NULL,         NULL,      setdivertto   },
-	{ "package",    0,   1,  NULL,         NULL,      setpackage    },
-	{ "local",      0,   0,  NULL,         NULL,      setpackage    },
+	{ "divert",     0,   1,  NULL,         NULL,      set_divertto  },
+	{ "package",    0,   1,  NULL,         NULL,      set_package   },
+	{ "local",      0,   0,  NULL,         NULL,      set_package   },
 	{ "quiet",      0,   0,  &opt_verbose, NULL,      NULL, 0       },
 	{ "rename",     0,   0,  &opt_rename,  NULL,      NULL, 1       },
 	{ "test",       0,   0,  &opt_test,    NULL,      NULL, 1       },
@@ -775,7 +775,7 @@ main(int argc, const char * const *argv)
 
 	env_pkgname = getenv("DPKG_MAINTSCRIPT_PACKAGE");
 	if (opt_pkgname_match_any && env_pkgname)
-		setpackage(NULL, env_pkgname);
+		set_package(NULL, env_pkgname);
 
 	if (!cipaction)
 		setaction(&cmdinfo_add, NULL);

+ 29 - 17
src/main.c

@@ -300,7 +300,9 @@ static const struct debuginfo {
   { 0, NULL, NULL }
 };
 
-static void setdebug(const struct cmdinfo *cpi, const char *value) {
+static void
+set_debug(const struct cmdinfo *cpi, const char *value)
+{
   char *endp;
   long mask;
   const struct debuginfo *dip;
@@ -330,7 +332,7 @@ static void setdebug(const struct cmdinfo *cpi, const char *value) {
 }
 
 static void
-setfilter(const struct cmdinfo *cip, const char *value)
+set_filter(const struct cmdinfo *cip, const char *value)
 {
   filter_add(value, cip->arg_int);
 }
@@ -342,14 +344,18 @@ set_verify_format(const struct cmdinfo *cip, const char *value)
     badusage(_("unknown verify output format '%s'"), value);
 }
 
-static void setroot(const struct cmdinfo *cip, const char *value) {
+static void
+set_root(const struct cmdinfo *cip, const char *value)
+{
   char *p;
   instdir= value;
   m_asprintf(&p, "%s%s", value, ADMINDIR);
   admindir= p;
 }
 
-static void ignoredepends(const struct cmdinfo *cip, const char *value) {
+static void
+set_ignore_depends(const struct cmdinfo *cip, const char *value)
+{
   char *copy, *p;
 
   copy= m_malloc(strlen(value)+2);
@@ -380,11 +386,15 @@ static void ignoredepends(const struct cmdinfo *cip, const char *value) {
   free(copy);
 }
 
-static void setinteger(const struct cmdinfo *cip, const char *value) {
+static void
+set_integer(const struct cmdinfo *cip, const char *value)
+{
   *cip->iassignto = dpkg_options_parse_arg_int(cip, value);
 }
 
-static void setpipe(const struct cmdinfo *cip, const char *value) {
+static void
+set_pipe(const struct cmdinfo *cip, const char *value)
+{
   long v;
 
   v = dpkg_options_parse_arg_int(cip, value);
@@ -581,7 +591,9 @@ print_forceinfo(const struct forceinfo *fi)
   free(desc);
 }
 
-static void setforce(const struct cmdinfo *cip, const char *value) {
+static void
+set_force(const struct cmdinfo *cip, const char *value)
+{
   const char *comma;
   size_t l;
   const struct forceinfo *fip;
@@ -679,11 +691,11 @@ static const struct cmdinfo cmdinfos[]= {
 
   { "pre-invoke",        0,   1, NULL,          NULL,      set_invoke_hook, 0, &pre_invoke_hooks_tail },
   { "post-invoke",       0,   1, NULL,          NULL,      set_invoke_hook, 0, &post_invoke_hooks_tail },
-  { "path-exclude",      0,   1, NULL,          NULL,      setfilter,     0 },
-  { "path-include",      0,   1, NULL,          NULL,      setfilter,     1 },
+  { "path-exclude",      0,   1, NULL,          NULL,      set_filter,     0 },
+  { "path-include",      0,   1, NULL,          NULL,      set_filter,     1 },
   { "verify-format",     0,   1, NULL,          NULL,      set_verify_format },
   { "status-logger",     0,   1, NULL,          NULL,      set_invoke_hook, 0, &status_loggers_tail },
-  { "status-fd",         0,   1, NULL,          NULL,      setpipe, 0 },
+  { "status-fd",         0,   1, NULL,          NULL,      set_pipe, 0 },
   { "log",               0,   1, NULL,          &log_file, NULL,    0 },
   { "pending",           'a', 0, &f_pending,    NULL,      NULL,    1 },
   { "recursive",         'R', 0, &f_recursive,  NULL,      NULL,    1 },
@@ -700,15 +712,15 @@ static const struct cmdinfo cmdinfos[]= {
   { "no-also-select",    'N', 0, &f_alsoselect, NULL,      NULL,    0 },
   { "skip-same-version", 'E', 0, &f_skipsame,   NULL,      NULL,    1 },
   { "auto-deconfigure",  'B', 0, &f_autodeconf, NULL,      NULL,    1 },
-  { "root",              0,   1, NULL,          NULL,      setroot,       0 },
-  { "abort-after",       0,   1, &errabort,     NULL,      setinteger,    0 },
+  { "root",              0,   1, NULL,          NULL,      set_root,      0 },
+  { "abort-after",       0,   1, &errabort,     NULL,      set_integer,   0 },
   { "admindir",          0,   1, NULL,          &admindir, NULL,          0 },
   { "instdir",           0,   1, NULL,          &instdir,  NULL,          0 },
-  { "ignore-depends",    0,   1, NULL,          NULL,      ignoredepends, 0 },
-  { "force",             0,   2, NULL,          NULL,      setforce,      1 },
-  { "refuse",            0,   2, NULL,          NULL,      setforce,      0 },
-  { "no-force",          0,   2, NULL,          NULL,      setforce,      0 },
-  { "debug",             'D', 1, NULL,          NULL,      setdebug,      0 },
+  { "ignore-depends",    0,   1, NULL,          NULL,      set_ignore_depends, 0 },
+  { "force",             0,   2, NULL,          NULL,      set_force,     1 },
+  { "refuse",            0,   2, NULL,          NULL,      set_force,     0 },
+  { "no-force",          0,   2, NULL,          NULL,      set_force,     0 },
+  { "debug",             'D', 1, NULL,          NULL,      set_debug,     0 },
   { "help",              '?', 0, NULL,          NULL,      usage,         0 },
   { "version",           0,   0, NULL,          NULL,      printversion,  0 },
   ACTIONBACKEND( "build",		'b', BACKEND),