Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove unused function
  • Loading branch information
tangrs committed May 28, 2013
1 parent e8e4dfc commit ccbf01b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
34 changes: 0 additions & 34 deletions cmd.c
Expand Up @@ -25,40 +25,6 @@
#include "memory.h"
#include "cmd.h"


static int next_space_null(const char *str) {
int i = 0;
while (*str != ' ' && *str != '\0') ((i++), (str++));
return i;
}
/*
Returns number of filled arguments.
Var args are all of type char**
*/
int cmd_args(char *args, unsigned max_n, ...) {
va_list ap;
va_start(ap, max_n);

char *ptr = args;
unsigned i;

for (i=0; i<max_n; i++) {
char **fill;

args += next_space_null(args);
if (!*args) break;
*args = '\0';

fill = va_arg(ap,char**);
*fill = ptr;
args++;
ptr = args;
}

va_end(ap);
return i;
}

int load_script(const char *filename) {
FILE *script = fopen(filename, "r");
if (!script) {
Expand Down
1 change: 0 additions & 1 deletion cmd.h
Expand Up @@ -21,6 +21,5 @@

int load_script(const char *filename);
int process_cmd(char *cmd);
int cmd_args(char *args, unsigned max_n, ...);

#endif

0 comments on commit ccbf01b

Please sign in to comment.