#include "fish.h"
int
-run_alloc (const char *cmd, int argc, char *argv[])
+run_alloc (const char *cmd, size_t argc, char *argv[])
{
if (argc != 2) {
fprintf (stderr, _("use 'alloc file size' to create an image\n"));
}
int
-run_sparse (const char *cmd, int argc, char *argv[])
+run_sparse (const char *cmd, size_t argc, char *argv[])
{
if (argc != 2) {
fprintf (stderr, _("use 'sparse file size' to create a sparse image\n"));
static int split_path (char *buf, size_t buf_size, const char *path, const char **dirname, const char **basename);
int
-run_copy_in (const char *cmd, int argc, char *argv[])
+run_copy_in (const char *cmd, size_t argc, char *argv[])
{
if (argc < 2) {
fprintf (stderr,
}
int
-run_copy_out (const char *cmd, int argc, char *argv[])
+run_copy_out (const char *cmd, size_t argc, char *argv[])
{
if (argc < 2) {
fprintf (stderr,
#include "fish.h"
int
-run_echo (const char *cmd, int argc, char *argv[])
+run_echo (const char *cmd, size_t argc, char *argv[])
{
- int i;
+ size_t i;
for (i = 0; i < argc; ++i) {
if (i > 0) printf (" ");
/* guestfish edit command, suggested by Ján Ondrej, implemented by RWMJ */
int
-run_edit (const char *cmd, int argc, char *argv[])
+run_edit (const char *cmd, size_t argc, char *argv[])
{
TMP_TEMPLATE_ON_STACK (filename);
char buf[256];
/* in cmds.c (auto-generated) */
extern void list_commands (void);
extern int display_command (const char *cmd);
-extern int run_action (const char *cmd, int argc, char *argv[]);
+extern int run_action (const char *cmd, size_t argc, char *argv[]);
/* in completion.c (auto-generated) */
extern char **do_completion (const char *text, int start, int end);
extern char *complete_dest_paths_generator (const char *text, int state);
/* in alloc.c */
-extern int run_alloc (const char *cmd, int argc, char *argv[]);
-extern int run_sparse (const char *cmd, int argc, char *argv[]);
+extern int run_alloc (const char *cmd, size_t argc, char *argv[]);
+extern int run_sparse (const char *cmd, size_t argc, char *argv[]);
extern int alloc_disk (const char *filename, const char *size,
int add, int sparse);
extern int parse_size (const char *str, off_t *size_rtn);
/* in copy.c */
-extern int run_copy_in (const char *cmd, int argc, char *argv[]);
-extern int run_copy_out (const char *cmd, int argc, char *argv[]);
+extern int run_copy_in (const char *cmd, size_t argc, char *argv[]);
+extern int run_copy_out (const char *cmd, size_t argc, char *argv[]);
/* in echo.c */
-extern int run_echo (const char *cmd, int argc, char *argv[]);
+extern int run_echo (const char *cmd, size_t argc, char *argv[]);
/* in edit.c */
-extern int run_edit (const char *cmd, int argc, char *argv[]);
+extern int run_edit (const char *cmd, size_t argc, char *argv[]);
/* in hexedit.c */
-extern int run_hexedit (const char *cmd, int argc, char *argv[]);
+extern int run_hexedit (const char *cmd, size_t argc, char *argv[]);
/* in inspect.c */
extern void inspect_mount (void);
extern void print_inspect_prompt (void);
/* in lcd.c */
-extern int run_lcd (const char *cmd, int argc, char *argv[]);
+extern int run_lcd (const char *cmd, size_t argc, char *argv[]);
/* in glob.c */
-extern int run_glob (const char *cmd, int argc, char *argv[]);
+extern int run_glob (const char *cmd, size_t argc, char *argv[]);
/* in man.c */
-extern int run_man (const char *cmd, int argc, char *argv[]);
+extern int run_man (const char *cmd, size_t argc, char *argv[]);
/* in more.c */
-extern int run_more (const char *cmd, int argc, char *argv[]);
+extern int run_more (const char *cmd, size_t argc, char *argv[]);
/* in prep.c */
struct prep_data {
/* in rc.c (remote control) */
extern void rc_listen (void) __attribute__((noreturn));
-extern int rc_remote (int pid, const char *cmd, int argc, char *argv[],
+extern int rc_remote (int pid, const char *cmd, size_t argc, char *argv[],
int exit_on_error);
/* in reopen.c */
-extern int run_reopen (const char *cmd, int argc, char *argv[]);
+extern int run_reopen (const char *cmd, size_t argc, char *argv[]);
/* in supported.c */
-extern int run_supported (const char *cmd, int argc, char *argv[]);
+extern int run_supported (const char *cmd, size_t argc, char *argv[]);
/* in time.c */
-extern int run_time (const char *cmd, int argc, char *argv[]);
+extern int run_time (const char *cmd, size_t argc, char *argv[]);
/* in tilde.c */
extern char *try_tilde_expansion (char *path);
/* A bit tricky because in the case where there are multiple
* paths we have to perform a Cartesian product.
*/
-static void glob_issue (char *cmd, int argc, char ***globs, int *posn, int *count, int *r);
+static void glob_issue (char *cmd, size_t argc, char ***globs, int *posn, int *count, int *r);
int
-run_glob (const char *cmd, int argc, char *argv[])
+run_glob (const char *cmd, size_t argc, char *argv[])
{
/* For 'glob cmd foo /s* /usr/s*' this could be:
*
char **globs[argc];
int posn[argc];
int count[argc];
- int i, r = 0;
+ size_t i;
+ int r = 0;
if (argc < 1) {
fprintf (stderr, _("use 'glob command [args...]'\n"));
}
static void
-glob_issue (char *cmd, int argc,
+glob_issue (char *cmd, size_t argc,
char ***globs, int *posn, int *count,
int *r)
{
- int i;
+ size_t i;
char *argv[argc+1];
argv[0] = cmd;
static off_t get_size (const char *filename);
int
-run_hexedit (const char *cmd, int argc, char *argv[])
+run_hexedit (const char *cmd, size_t argc, char *argv[])
{
if (argc < 1 || argc > 3) {
fprintf (stderr, _("hexedit (device|filename) [max | start max]\n"));
/* guestfish lcd command (similar to the lcd command in BSD ftp) */
int
-run_lcd (const char *cmd, int argc, char *argv[])
+run_lcd (const char *cmd, size_t argc, char *argv[])
{
if (argc != 1) {
fprintf (stderr, _("use 'lcd directory' to change local directory\n"));
/* guestfish man command */
int
-run_man (const char *cmd, int argc, char *argv[])
+run_man (const char *cmd, size_t argc, char *argv[])
{
if (argc != 0) {
fprintf (stderr, _("use 'man' without parameters to open the manual\n"));
#include "fish.h"
int
-run_more (const char *cmd, int argc, char *argv[])
+run_more (const char *cmd, size_t argc, char *argv[])
{
TMP_TEMPLATE_ON_STACK (filename);
char buf[256];
char sockpath[128];
pid_t pid;
struct sockaddr_un addr;
- int sock, s, i;
+ int sock, s;
+ size_t i;
FILE *fp;
XDR xdr, xdr2;
guestfish_hello hello;
guestfish_call call;
guestfish_reply reply;
char **argv;
- int argc;
+ size_t argc;
memset (&hello, 0, sizeof hello);
memset (&call, 0, sizeof call);
/* Remote control client. */
int
-rc_remote (int pid, const char *cmd, int argc, char *argv[],
+rc_remote (int pid, const char *cmd, size_t argc, char *argv[],
int exit_on_error)
{
guestfish_hello hello;
#include "fish.h"
int
-run_reopen (const char *cmd, int argc, char *argv[])
+run_reopen (const char *cmd, size_t argc, char *argv[])
{
guestfs_h *g2;
int r;
#include "fish.h"
int
-run_supported (const char *cmd, int argc, char *argv[])
+run_supported (const char *cmd, size_t argc, char *argv[])
{
char **groups;
#include "fish.h"
int
-run_time (const char *cmd, int argc, char *argv[])
+run_time (const char *cmd, size_t argc, char *argv[])
{
struct timeval start_t, end_t;
int64_t start_us, end_us, elapsed_us;
(* run_<action> actions *)
List.iter (
fun (name, style, _, flags, _, _, _) ->
- pr "static int run_%s (const char *cmd, int argc, char *argv[])\n" name;
+ pr "static int run_%s (const char *cmd, size_t argc, char *argv[])\n" name;
pr "{\n";
(match fst style with
| RErr
) all_functions;
(* run_action function *)
- pr "int run_action (const char *cmd, int argc, char *argv[])\n";
+ pr "int run_action (const char *cmd, size_t argc, char *argv[])\n";
pr "{\n";
List.iter (