* `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
#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);
/* 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)
* `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"
-#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; \
/* 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; \
} \
* `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 $ */
/*
#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 { \
* `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 */
}
-#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)
}
-#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; \
} \
}