cvs commit: src/usr.sbin/ngctl config.c connect.c debug.c dot.c list.c main.c mkpeer.c msg.c name.c ngctl.h rmhook.c show.c shutdown.c status.c types.c write.c

Gleb Smirnoff glebius at
Thu May 25 00:23:15 PDT 2006

On Thu, May 25, 2006 at 12:05:37PM +0900, Ganbold wrote:
G> Gleb,
G> I modified my previous patch accordingly. Hopefully it follows style(9) 
G> more; removed typedef, changed function names to follow original 
G> function naming styles in code, space after return statements according 
G> to style(9).

I am working on your patch now. I'm doing some minor changes to match
style of surrounding code, and also moving to queue(3) instead of
home-made linked list.

G> -		return(CMDRTN_USAGE);
G> +		return (CMDRTN_USAGE);

Let's commit these style changes later.

G> diff -u /usr/src/usr.sbin/ngctl/main.c /usr/home/tsgan/ngctl/main.c
G> --- /usr/src/usr.sbin/ngctl/main.c	Wed May 24 23:46:55 2006
G> +++ /usr/home/tsgan/ngctl/main.c	Thu May 25 11:47:59 2006
G> @@ -50,6 +50,7 @@
G>  #include <stdlib.h>
G>  #include <string.h>
G>  #include <sysexits.h>
G> +#include <termios.h>
G>  #include <unistd.h>
G>  #include <netgraph.h>
G> @@ -61,6 +62,13 @@
G>  #define WHITESPACE		" \t\r\n\v\f"
G>  #define DUMP_BYTES_PER_LINE	16
G> +/* Previously issued commands list */
G> +struct cmdlist {
G> +	char		*cmd;	/* command */
G> +	struct cmdlist	*prev;	/* previous command */
G> +	struct cmdlist	*next;	/* next command */
G> +};
G> +

Yes, yes. This is what I'm tending to do. Do not touch ngctl.h, since
this type is private to main.c

I lowercased CMDLIST, too. :)

G> +static int	ScanCmd(char *cmd, struct cmdlist **curr);

I uppercased "s" and "c" in this function too. Damn, haven't you rooted
my notebook? :)

Please wait for me to send you a patch converted to queue(3) macro, and
then continue discussion.

Totus tuus, Glebius.

More information about the cvs-src mailing list