argvize.c File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MAX_AC   100

Functions

int argvize (char *av[], char *s)


Define Documentation

#define MAX_AC   100

Definition at line 35 of file argvize.c.

Referenced by _do_cmd(), and argvize().


Function Documentation

int argvize ( char *  av[],
char *  s 
)

Definition at line 42 of file argvize.c.

References MAX_AC.

Referenced by _do_cmd(), and fileman_completion().

00043 {
00044         char **pav = av, c;
00045         int ac;
00046 
00047         for (ac = 0; ac < MAX_AC; ac++) {
00048                 /* step over cntrls and spaces */
00049                 while (*s && *s <= ' ')
00050                         s++;
00051 
00052                 if (!*s)
00053                         break;
00054 
00055                 c = *s;
00056                 /* if it's a quote skip forward */
00057                 if (c == '\'' || c == '"') {
00058                         if (pav)
00059                                 *pav++ = ++s;
00060                         while (*s && *s != c)
00061                                 s++;
00062                         if (*s)
00063                                 *s++ = 0;
00064                 } else {                /* find end of word */
00065                         if (pav)
00066                                 *pav++ = s;
00067                         while (' ' < *s)
00068                                 s++;
00069                 }
00070 
00071                 if (*s)
00072                         *s++ = 0;
00073         }
00074         return (ac);
00075 }


Generated on Fri Nov 5 07:24:48 2010 for ejtag debug tools for loongson 232 cpu by  doxygen 1.5.6