From 3b72352ce2cafbfd9cd0d66c34e4d19bf91a111e Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Mon, 16 Feb 2004 15:05:56 +0000 Subject: [PATCH] Changed indentation SVN revision: 764 --- src/elogd.c | 306 +++++++++++++++++++++++++++++----------------------- 1 file changed, 172 insertions(+), 134 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 73fb93e8..b1e58a2d 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.248 2004/02/16 15:05:56 midas + Changed indentation + Revision 1.247 2004/02/16 15:04:32 midas Fixed compiler warnings @@ -559,23 +562,40 @@ struct { char type[32]; } filetype[] = { - {".CSS", "text/css"}, - {".JPG", "image/jpeg"}, - {".JPEG", "image/jpeg"}, - {".GIF", "image/gif"}, - {".PNG", "image/png"}, - {".PS", "application/postscript"}, - {".EPS", "application/postscript"}, - {".HTML", "text/html"}, - {".HTM", "text/html"}, - {".XLS", "application/x-msexcel"}, - {".DOC", "application/msword"}, - {".PDF", "application/pdf"}, - {".JS", "application/x-javascript"}, - {".TXT", "text/plain"}, - {".ASC", "text/plain"}, - {".ZIP", "application/x-zip-compressed"}, - {"",""},}; + { + ".CSS", "text/css"}, + { + ".JPG", "image/jpeg"}, + { + ".JPEG", "image/jpeg"}, + { + ".GIF", "image/gif"}, + { + ".PNG", "image/png"}, + { + ".PS", "application/postscript"}, + { + ".EPS", "application/postscript"}, + { + ".HTML", "text/html"}, + { + ".HTM", "text/html"}, + { + ".XLS", "application/x-msexcel"}, + { + ".DOC", "application/msword"}, + { + ".PDF", "application/pdf"}, + { + ".JS", "application/x-javascript"}, + { + ".TXT", "text/plain"}, + { + ".ASC", "text/plain"}, + { + ".ZIP", "application/x-zip-compressed"}, + { +"", ""},}; typedef struct { int message_id; @@ -3457,9 +3477,10 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit, time_t now, ltime; char *message, *p, *buffer; char attachment_all[64 * MAX_ATTACHMENTS]; - - tail_size = orig_size = 0; - buffer = NULL; + +tail_size = orig_size = 0; + +buffer = NULL; message = malloc(TEXT_SIZE + 100); assert(message); @@ -3485,7 +3506,7 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit, } lseek(fh, lbs->el_index[index].offset, SEEK_SET); - i = read(fh, message, TEXT_SIZE+100); + i = read(fh, message, TEXT_SIZE + 100); message[i] = 0; /* check for valid message */ @@ -3643,8 +3664,8 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit, sprintf(message + strlen(message), "Locked by: %s\n", locked_by); sprintf(message + strlen(message), "========================================\n"); - strlcat(message, text, TEXT_SIZE+100); - strlcat(message, "\n", TEXT_SIZE+100); + strlcat(message, text, TEXT_SIZE + 100); + strlcat(message, "\n", TEXT_SIZE + 100); write(fh, message, strlen(message)); @@ -3665,8 +3686,7 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit, for (j = i + 1; j < *lbs->n_el_index - && strieq(lbs->el_index[i].file_name, lbs->el_index[j].file_name); - j++) + && strieq(lbs->el_index[i].file_name, lbs->el_index[j].file_name); j++) lbs->el_index[j].offset += delta; } @@ -3688,7 +3708,7 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit, reply_id = atoi(in_reply_to); /* retrieve original message */ - size = TEXT_SIZE+100; + size = TEXT_SIZE + 100; el_retrieve(lbs, reply_id, date, attr_list, attr, n_attr, message, &size, in_reply_to, reply_to, att, enc, lock); @@ -3710,12 +3730,12 @@ int el_submit(LOGBOOK * lbs, int message_id, BOOL bedit, void remove_reference(LOGBOOK * lbs, int message_id, int remove_id, BOOL reply_to_flag) { char date[80], attr[MAX_N_ATTR][NAME_LENGTH], enc[80], in_reply_to[80], - reply_to[MAX_REPLY_TO * 10], att[MAX_ATTACHMENTS][256], lock[256], + reply_to[MAX_REPLY_TO * 10], att[MAX_ATTACHMENTS][256], lock[256], *p, *ps, *message; int size, status; /* retrieve original message */ - size = TEXT_SIZE+1000; + size = TEXT_SIZE + 1000; message = malloc(size); status = el_retrieve(lbs, message_id, date, attr_list, attr, lbs->n_attr, message, &size, @@ -3876,8 +3896,8 @@ INT el_delete_message(LOGBOOK * lbs, int message_id, /* buffer tail of logfile */ lseek(fh, 0, SEEK_END); tail_size = TELL(fh) - (lbs->el_index[index].offset + size); - - buffer = NULL; + +buffer = NULL; if (tail_size > 0) { buffer = malloc(tail_size); if (buffer == NULL) { @@ -3922,8 +3942,7 @@ INT el_delete_message(LOGBOOK * lbs, int message_id, /* correct all offsets after deleted message */ for (i = 0; i < *lbs->n_el_index; i++) - if (strieq(lbs->el_index[i].file_name, str) && - lbs->el_index[i].offset > old_offset) + if (strieq(lbs->el_index[i].file_name, str) && lbs->el_index[i].offset > old_offset) lbs->el_index[i].offset -= size; /* if other logbook has same index, update pointers */ @@ -4324,7 +4343,7 @@ void rsputs2(const char *str) j += 4; break; - /* the translation for the search highliting */ + /* the translation for the search highliting */ case '\001': strcat(return_buffer, "<"); j++; @@ -4757,7 +4776,8 @@ int scan_attributes(char *logbook, char *condition) /* scan configuration file for attributes and fill attr_list, attr_options and attr_flags arrays */ { - char list[10000], str[NAME_LENGTH], type[NAME_LENGTH], tmp_list[MAX_N_ATTR][NAME_LENGTH]; + char list[10000], str[NAME_LENGTH], type[NAME_LENGTH], + tmp_list[MAX_N_ATTR][NAME_LENGTH]; int i, j, n, m; if (getcfg_cond(logbook, condition, "Attributes", list)) { @@ -4837,7 +4857,7 @@ and attr_flags arrays */ for (j = 0; j < n; j++) if (strieq(attr_list[j], tmp_list[i])) attr_flags[j] |= AF_EXTENDABLE; - + } for (i = 0; i < n; i++) { @@ -5561,7 +5581,7 @@ void strencode(char *text) rsprintf(" "); break; - /* the translation for the search highliting */ + /* the translation for the search highliting */ case '\001': rsprintf("<"); break; @@ -5606,7 +5626,7 @@ void strencode2(char *b, char *text) strcat(b, """); break; default: - sprintf(b+strlen(b), "%c", text[i]); + sprintf(b + strlen(b), "%c", text[i]); } } } @@ -5948,7 +5968,7 @@ void show_date_selector(int day, int month, int year, char *index) rsprintf("