Date: Thu, 25 May 2006 11:23:11 +0400 From: Gleb Smirnoff <glebius@FreeBSD.org> To: Ganbold <ganbold@micom.mng.net> Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: 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 Message-ID: <20060525072311.GG27819@FreeBSD.org> In-Reply-To: <44751F01.4030702@micom.mng.net> References: <200605241446.k4OEkvo0011251@repoman.freebsd.org> <44751F01.4030702@micom.mng.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 25, 2006 at 12:05:37PM +0900, Ganbold wrote: G> Gleb, G> 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> 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> 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. GLEBIUS-RIPN GLEB-RIPE
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060525072311.GG27819>