From owner-p4-projects@FreeBSD.ORG Fri May 2 15:52:11 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9CE0E1065676; Fri, 2 May 2008 15:52:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E9D01065673 for ; Fri, 2 May 2008 15:52:11 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5618FC0A for ; Fri, 2 May 2008 15:52:11 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m42FqBQl056202 for ; Fri, 2 May 2008 15:52:11 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m42FqBei056200 for perforce@freebsd.org; Fri, 2 May 2008 15:52:11 GMT (envelope-from gabor@freebsd.org) Date: Fri, 2 May 2008 15:52:11 GMT Message-Id: <200805021552.m42FqBei056200@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 141055 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2008 15:52:11 -0000 http://perforce.freebsd.org/chv.cgi?CH=141055 Change 141055 by gabor@gabor_server on 2008/05/02 15:51:15 - Better naming conventions Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/grep.h#3 edit .. //depot/projects/soc2008/gabor_textproc/grep/queue.c#3 edit .. //depot/projects/soc2008/gabor_textproc/grep/util.c#3 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/grep.h#3 (text+ko) ==== @@ -37,13 +37,13 @@ #define BIN_FILE_SKIP 1 #define BIN_FILE_TEXT 2 -typedef struct { +typedef struct str { size_t len; int line_no; off_t off; char *file; char *dat; -} str_t; +} str_t ; typedef struct { unsigned char *pattern; @@ -81,13 +81,13 @@ void *grep_malloc(size_t size); void *grep_calloc(size_t nmemb, size_t size); void *grep_realloc(void *ptr, size_t size); -void printline(str_t *line, int sep); +void printline(struct str *line, int sep); int fastcomp(fastgrep_t *, const char *); void fgrepcomp(fastgrep_t *, const char *); /* queue.c */ void initqueue(void); -void enqueue(str_t *x); +void enqueue(struct str *x); void printqueue(void); void clearqueue(void); ==== //depot/projects/soc2008/gabor_textproc/grep/queue.c#3 (text+ko) ==== @@ -47,14 +47,14 @@ #include "grep.h" typedef struct queue { - struct queue *next; - str_t data; -} queue_t; + struct queue *next; + struct str data; +} queue_t ; -static queue_t *q_head, *q_tail; -static int count; +static struct queue *q_head, *q_tail; +static int count; -static queue_t *dequeue(void); +static struct queue *dequeue(void); void initqueue(void) @@ -63,16 +63,16 @@ } static void -free_item(queue_t *item) +free_item(struct queue *item) { free(item); } void -enqueue(str_t *x) +enqueue(struct str *x) { - queue_t *item; + struct queue *item; item = grep_malloc(sizeof *item + x->len); item->data.len = x->len; @@ -94,10 +94,10 @@ free_item(dequeue()); } -static queue_t * +static struct queue * dequeue(void) { - queue_t *item; + struct queue *item; if (q_head == NULL) return (NULL); @@ -113,7 +113,7 @@ void printqueue(void) { - queue_t *item; + struct queue *item; while ((item = dequeue()) != NULL) { printline(&item->data, '-'); @@ -124,7 +124,7 @@ void clearqueue(void) { - queue_t *item; + struct queue *item; while ((item = dequeue()) != NULL) free_item(item); ==== //depot/projects/soc2008/gabor_textproc/grep/util.c#3 (text+ko) ==== @@ -55,7 +55,7 @@ */ static int linesqueued; -static int procline(str_t *l, int); +static int procline(struct str *l, int); static int grep_search(fastgrep_t *, unsigned char *, size_t, regmatch_t *pmatch); static int grep_cmp(const unsigned char *, const unsigned char *, size_t); static void grep_revstr(unsigned char *, int); @@ -103,9 +103,9 @@ int procfile(char *fn) { - str_t ln; - file_t *f; - int c, t, z, nottext; + struct str ln; + file_t *f; + int c, t, z, nottext; if (fn == NULL) { fn = "(standard input)"; @@ -178,7 +178,7 @@ #define isword(x) (isalnum(x) || (x) == '_') static int -procline(str_t *l, int nottext) +procline(struct str *l, int nottext) { regmatch_t pmatch; int c, i, r; @@ -571,7 +571,7 @@ } void -printline(str_t *line, int sep) +printline(struct str *line, int sep) { int n;