From: thib Date: Sat, 5 Oct 2002 14:25:16 +0000 (+0000) Subject: coding style change : use uppercase for macro parameters X-Git-Tag: ver1564~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ded43b929afc94a6fa8f6ad62b4935c2e715c0e;p=fcron coding style change : use uppercase for macro parameters --- diff --git a/fcrondyn.c b/fcrondyn.c index 70be3a6..7480dec 100644 --- a/fcrondyn.c +++ b/fcrondyn.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrondyn.c,v 1.6 2002-08-30 20:04:28 thib Exp $ */ + /* $Id: fcrondyn.c,v 1.7 2002-10-05 14:25:16 thib Exp $ */ /* fcrondyn : interact dynamically with running fcron process : * - list jobs, with their status, next time of execution, etc @@ -35,7 +35,7 @@ #include "allow.h" #include "read_string.h" -char rcs_info[] = "$Id: fcrondyn.c,v 1.6 2002-08-30 20:04:28 thib Exp $"; +char rcs_info[] = "$Id: fcrondyn.c,v 1.7 2002-10-05 14:25:16 thib Exp $"; void info(void); void usage(void); @@ -153,12 +153,12 @@ xexit(int exit_val) /* used in parse_cmd : */ -#define Write_cmd(data) \ - memcpy(buf + *cmd_len, (long int *) &data, sizeof(long int)); \ +#define Write_cmd(DATA) \ + memcpy(buf + *cmd_len, (long int *) &DATA, sizeof(long int)); \ *cmd_len += 1; -#define Strncmp(str1, str2, str1_size) \ - strncmp(str1, str2, (str1_size < strlen(str2)) ? strlen(str2) : str1_size) +#define Strncmp(STR1, STR2, STR1_SIZE) \ + strncmp(STR1, STR2, (STR1_SIZE < strlen(STR2)) ? strlen(STR2) : STR1_SIZE) int parse_cmd(char *cmd_str, long int **cmd, int *cmd_len) diff --git a/fileconf.c b/fileconf.c index f8f1852..9c79874 100644 --- a/fileconf.c +++ b/fileconf.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fileconf.c,v 1.63 2002-09-15 18:09:42 thib Exp $ */ + /* $Id: fileconf.c,v 1.64 2002-10-05 14:26:05 thib Exp $ */ #include "fcrontab.h" @@ -1160,11 +1160,11 @@ read_freq(char *ptr, CF *cf) -#define R_field(ptr, ary, max, aryconst, descrp) \ - if((ptr = read_field(ptr, ary, max, aryconst)) == NULL) { \ +#define R_field(PTR, ARY, MAX, ARYCONST, DESCRP) \ + if((PTR = read_field(PTR, ARY, MAX, ARYCONST)) == NULL) { \ if (debug_opt) \ fprintf(stderr, "\n"); \ - fprintf(stderr, "%s:%d: Error while reading " descrp " field: " \ + fprintf(stderr, "%s:%d: Error while reading " DESCRP " field: " \ "skipping line.\n", file_name, line); \ free(cl); \ return; \ @@ -1648,41 +1648,41 @@ delete_file(const char *user_name) /* save_file() error management */ -#define Save_type(fd, type) \ +#define Save_type(FD, TYPE) \ { \ - if ( save_type(fd, type) != OK ) { \ + if ( save_type(FD, TYPE) != OK ) { \ error_e("Could not write type : file has not been installed."); \ - close(fd); \ + close(FD); \ remove(path); \ return ERR; \ } \ } -#define Save_str(fd, type, str) \ +#define Save_str(FD, TYPE, STR) \ { \ - if ( save_str(fd, type, str) != OK ) { \ + if ( save_str(FD, TYPE, STR) != OK ) { \ error_e("Could not write str : file has not been installed."); \ - close(fd); \ + close(FD); \ remove(path); \ return ERR; \ } \ } -#define Save_strn(fd, type, str, size) \ +#define Save_strn(FD, TYPE, STR, SIZE) \ { \ - if ( save_strn(fd, type, str, size) != OK ) { \ + if ( save_strn(FD, TYPE, STR, SIZE) != OK ) { \ error_e("Could not write strn : file has not been installed."); \ - close(fd); \ + close(FD); \ remove(path); \ return ERR; \ } \ } -#define Save_lint(fd, type, value) \ +#define Save_lint(FD, TYPE, VALUE) \ { \ - if ( save_lint(fd, type, value) != OK ) { \ + if ( save_lint(FD, TYPE, VALUE) != OK ) { \ error_e("Could not write lint : file has not been installed."); \ - close(fd); \ + close(FD); \ remove(path); \ return ERR; \ } \ diff --git a/global.h b/global.h index 3cbeed9..cbbcb61 100644 --- a/global.h +++ b/global.h @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: global.h,v 1.36 2002-03-02 17:27:44 thib Exp $ */ + /* $Id: global.h,v 1.37 2002-10-05 14:26:25 thib Exp $ */ /* @@ -124,21 +124,21 @@ #define STD 0 /* macros */ -#define Alloc(ptr, type) \ - if( (ptr = calloc(1, sizeof(type))) == NULL ) \ +#define Alloc(PTR, TYPE) \ + if( (PTR = calloc(1, sizeof(TYPE))) == NULL ) \ die_e("Could not calloc."); -#define Set(var, value) \ - free(var); \ - var = strdup2(value); +#define Set(VAR, VALUE) \ + free(VAR); \ + VAR = strdup2(VALUE); -#define Flush(var) \ - free(var); \ - var = NULL; +#define Flush(VAR) \ + free(VAR); \ + VAR = NULL; -#define Skip_blanks(ptr) \ - while((*(ptr) == ' ') || (*(ptr) == '\t')) \ - (ptr)++; +#define Skip_blanks(PTR) \ + while((*(PTR) == ' ') || (*(PTR) == '\t')) \ + (PTR)++; #define Overwrite(x) \ do { \ diff --git a/socket.c b/socket.c index daca35a..705d772 100644 --- a/socket.c +++ b/socket.c @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: socket.c,v 1.7 2002-08-30 20:06:04 thib Exp $ */ + /* $Id: socket.c,v 1.8 2002-10-05 14:27:50 thib Exp $ */ /* This file contains all fcron's code (server) to handle communication with fcrondyn */ @@ -192,14 +192,14 @@ auth_client(struct fcrondyn_cl *client) } -#define Test_add_field(field_nb, field_str) \ - if ( (bit_test(details, field_nb)) ) { \ - strncat(fields, field_str, sizeof(fields)-1 - len); \ - len += (sizeof(field_str)-1); \ +#define Test_add_field(FIELD_NB, FIELD_STR) \ + if ( (bit_test(details, FIELD_NB)) ) { \ + strncat(fields, FIELD_STR, sizeof(fields)-1 - len); \ + len += (sizeof(FIELD_STR)-1); \ } -#define Add_field(field_str) \ - strncat(fields, field_str, sizeof(fields) - len); \ - len += (sizeof(field_str)-1); +#define Add_field(FIELD_STR) \ + strncat(fields, FIELD_STR, sizeof(fields) - len); \ + len += (sizeof(FIELD_STR)-1); void print_fields(int fd, unsigned char *details) @@ -302,10 +302,10 @@ print_line(int fd, struct CL *line, unsigned char *details, pid_t pid, int inde } -#define Test_line(line, pid, index, until) \ +#define Test_line(LINE, PID, INDEX, UNTIL) \ { \ - if (all || strcmp(user, line->cl_file->cf_user) == 0 ) { \ - print_line(fd, line, fields, pid, index, until); \ + if (all || strcmp(user, LINE->cl_file->cf_user) == 0 ) { \ + print_line(fd, LINE, fields, PID, INDEX, UNTIL); \ found = 1; \ } \ }