Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2008 15:52:11 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 141055 for review
Message-ID:  <200805021552.m42FqBei056200@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805021552.m42FqBei056200>