From d225ed51774cf919531e23df1fe98406bc19cbd8 Mon Sep 17 00:00:00 2001 From: Rik Wehbring Date: Fri, 15 Oct 2010 16:42:14 +0000 Subject: [PATCH] Change functions to static prototypes to avoid polluting global namespace. --- address.c | 4 ++-- dat.c | 4 ++-- datebook.c | 19 ++++++++++++++----- datebook.h | 8 +------- datebook_gui.c | 4 ++-- dialer/jpilot-dial.c | 24 ++++++++++++------------ font.c | 8 ++++---- log.c | 7 +++++-- log.h | 3 +-- memo.c | 6 +++--- memo_gui.c | 10 +++++----- monthview_gui.c | 10 +++++----- otherconv.c | 5 ++--- password.c | 6 +++--- password.h | 5 +---- plugins.c | 6 +++--- prefs_gui.c | 6 +++--- print.c | 10 ++++++---- todo.c | 6 +++--- todo_gui.c | 12 ++++++------ utils.c | 20 ++++++++++---------- utils.h | 7 +------ weekview_gui.c | 10 +++++----- 23 files changed, 99 insertions(+), 101 deletions(-) diff --git a/address.c b/address.c index 8c9c6dc3..028ff019 100644 --- a/address.c +++ b/address.c @@ -1,4 +1,4 @@ -/* $Id: address.c,v 1.63 2010/10/13 03:18:58 rikster5 Exp $ */ +/* $Id: address.c,v 1.64 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * address.c @@ -514,7 +514,7 @@ int pc_address_write(struct Address *addr, PCRecType rt, unsigned char attrib, } #ifdef JPILOT_DEBUG -void print_address_list(AddressList **al) +static void print_address_list(AddressList **al) { AddressList *temp_al, *prev_al; diff --git a/dat.c b/dat.c index f4e9f533..1e704035 100644 --- a/dat.c +++ b/dat.c @@ -1,4 +1,4 @@ -/* $Id: dat.c,v 1.24 2010/03/29 05:44:28 rikster5 Exp $ */ +/* $Id: dat.c,v 1.25 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * dat.c @@ -391,7 +391,7 @@ static int print_date(int palm_date) #endif #ifdef JPILOT_DEBUG -int print_field(struct field *f) +static int print_field(struct field *f) { switch (f->type) { diff --git a/datebook.c b/datebook.c index 2e1955f6..d3a1f6fd 100644 --- a/datebook.c +++ b/datebook.c @@ -1,4 +1,4 @@ -/* $Id: datebook.c,v 1.70 2010/10/13 03:18:58 rikster5 Exp $ */ +/* $Id: datebook.c,v 1.71 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * datebook.c @@ -146,11 +146,15 @@ int datebook_add_exception(struct CalendarEvent *cale, int year, int mon, int da return EXIT_SUCCESS; } + +/* All datebook appts are handled as calendar events now. + * This code scrap is being kept for reference only. */ +#if 0 /* * If a copy is made, then it should be freed through free_Appointment */ -int datebook_copy_appointment(struct Appointment *a1, - struct Appointment **a2) +static int datebook_copy_appointment(struct Appointment *a1, + struct Appointment **a2) { long datebook_version; @@ -179,6 +183,7 @@ int datebook_copy_appointment(struct Appointment *a1, return EXIT_SUCCESS; } +#endif /* * If a copy is made, then it should be freed through free_CalendarEvent @@ -197,8 +202,11 @@ int copy_calendar_event(const struct CalendarEvent *source, return EXIT_FAILURE; } -int datebook_sort(AppointmentList **al, - int (*compare_func)(const void*, const void*)) +/* calendar_sort in calendar.c is now used for all datebook sorting + * This code scrap is being kept for reference only. */ +#if 0 +static int datebook_sort(AppointmentList **al, + int (*compare_func)(const void*, const void*)) { AppointmentList *temp_al; AppointmentList **sort_al; @@ -239,6 +247,7 @@ int datebook_sort(AppointmentList **al, return EXIT_SUCCESS; } +#endif #ifdef ENABLE_DATEBK static void db3_fill_struct(char *note, int type, struct db4_struct *db4) diff --git a/datebook.h b/datebook.h index 42073154..41803315 100644 --- a/datebook.h +++ b/datebook.h @@ -1,4 +1,4 @@ -/* $Id: datebook.h,v 1.29 2010/10/07 21:04:31 rikster5 Exp $ */ +/* $Id: datebook.h,v 1.30 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * datebook.h @@ -103,10 +103,6 @@ int weed_datebook_list(AppointmentList **al, int mon, int year, int weed_calendar_event_list(CalendarEventList **cel, int mon, int year, int skip_privates, int *mask); -/* Sorts a list of appointments according to the comparison function given */ -int datebook_sort(AppointmentList **al, - int (*compare_func)(const void*, const void*)); - /* Year is years since 1900 */ /* Mon is 0-11 */ /* Day is 1-31 */ @@ -114,8 +110,6 @@ int datebook_sort(AppointmentList **al, int datebook_add_exception(struct CalendarEvent *cale, int year, int mon, int day); int get_calendar_or_datebook_app_info(struct CalendarAppInfo *cai, long datebook_version); -int datebook_copy_appointment(struct Appointment *a1, - struct Appointment **a2); int copy_calendar_event(const struct CalendarEvent *source, struct CalendarEvent **dest); /* returns a bit mask where bit 1 is day one, etc. Bit is set if an */ diff --git a/datebook_gui.c b/datebook_gui.c index 6b81dd14..b7a60142 100644 --- a/datebook_gui.c +++ b/datebook_gui.c @@ -1,4 +1,4 @@ -/* $Id: datebook_gui.c,v 1.235 2010/10/15 14:26:03 rikster5 Exp $ */ +/* $Id: datebook_gui.c,v 1.236 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * datebook_gui.c @@ -1792,7 +1792,7 @@ static int dialog_current_all_cancel(void) } #ifdef EASTER -int dialog_easter(int mday) +static int dialog_easter(int mday) { char text[255]; char who[50]; diff --git a/dialer/jpilot-dial.c b/dialer/jpilot-dial.c index f7be1791..fb2a380c 100644 --- a/dialer/jpilot-dial.c +++ b/dialer/jpilot-dial.c @@ -1,4 +1,4 @@ -/* $Id: jpilot-dial.c,v 1.5 2010/10/13 03:19:00 rikster5 Exp $ */ +/* $Id: jpilot-dial.c,v 1.6 2010/10/15 16:42:14 rikster5 Exp $ */ /******************************************************************************* * jpilot-dial.c @@ -48,10 +48,10 @@ #define DEV_MIXER "/dev/mixer" -void gen_costab(void); -void dial_digit(int c); -void silent(int msec); -void dial(int f1, int f2, int msec); +static void gen_costab(void); +static void dial_digit(int c); +static void silent(int msec); +static void dial(int f1, int f2, int msec); char *output = "/dev/dsp"; int bits = 8; @@ -81,7 +81,7 @@ int left = 0; int fd; -void Usage(void) { +static void Usage(void) { fprintf(stderr, "usage: jpilot-dial [options] number ...\n" " Valid options with their default values are:\n" " Duration options:\n" @@ -105,7 +105,7 @@ void Usage(void) { exit(1); } -void +static void initialize_audiodev(void) { int speed_local = speed; int channels = 1; @@ -147,7 +147,7 @@ initialize_audiodev(void) { speed = speed_local; } -void +static void getvalue(int *arg, int *index, int argc, char **argv, int min, int max) { @@ -363,7 +363,7 @@ int main(int argc, char **argv) exit(0); } -void +static void dial_digit(int c) { DEBUG(fprintf(stderr, "dial_digit %#c\n", c)); switch(c) { @@ -418,7 +418,7 @@ dial_digit(int c) { } } -void +static void silent(int msec) { int time; if (msec <= 0) @@ -452,7 +452,7 @@ silent(int msec) { dialed = 0; } -void +static void dial(int f1, int f2, int msec) { int i1, i2, d1, d2, e1, e2, g1, g2; int time; @@ -532,7 +532,7 @@ dial(int f1, int f2, int msec) { dialed = 1; } -void +static void gen_costab(void) { int i; double d; diff --git a/font.c b/font.c index 97296427..2044801b 100644 --- a/font.c +++ b/font.c @@ -4,7 +4,7 @@ #ifdef FONT_TEST -void SetFontRecursively2(GtkWidget *widget, gpointer data) +static void SetFontRecursively2(GtkWidget *widget, gpointer data) { GtkStyle *style; char *font_desc; @@ -20,7 +20,7 @@ void SetFontRecursively2(GtkWidget *widget, gpointer data) gtk_container_foreach(GTK_CONTAINER(widget), SetFontRecursively2, font_desc); } } -void font_selection_ok(GtkWidget *w, GtkFontSelectionDialog *fs) +static void font_selection_ok(GtkWidget *w, GtkFontSelectionDialog *fs) { gchar *s = gtk_font_selection_dialog_get_font_name(fs); @@ -32,7 +32,7 @@ void font_selection_ok(GtkWidget *w, GtkFontSelectionDialog *fs) cb_app_button(NULL, GINT_TO_POINTER(REDRAW)); } -void font_sel_dialog() +static void font_sel_dialog() { static GtkWidget *fontsel = NULL; @@ -61,7 +61,7 @@ void font_sel_dialog() } } -void cb_font(GtkWidget *widget, gpointer data) +static void cb_font(GtkWidget *widget, gpointer data) { font_sel_dialog(); diff --git a/log.c b/log.c index 15692de9..f824e928 100644 --- a/log.c +++ b/log.c @@ -1,4 +1,4 @@ -/* $Id: log.c,v 1.34 2010/10/13 03:18:58 rikster5 Exp $ */ +/* $Id: log.c,v 1.35 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * log.c @@ -57,6 +57,9 @@ int glob_log_gui_mask; extern void output_to_pane(const char *str); extern pid_t jpilot_master_pid; +/****************************** Prototypes ************************************/ +static int jp_vlogf (int level, const char *format, va_list val); + /****************************** Main Code *************************************/ int jp_logf(int level, const char *format, ...) { @@ -75,7 +78,7 @@ int jp_logf(int level, const char *format, ...) return rval; } -int jp_vlogf (int level, const char *format, va_list val) { +static int jp_vlogf (int level, const char *format, va_list val) { char real_buf[WRITE_MAX_BUF+32]; char *buf, *local_buf; int size; diff --git a/log.h b/log.h index eb175ea6..0a01c7bf 100644 --- a/log.h +++ b/log.h @@ -1,4 +1,4 @@ -/* $Id: log.h,v 1.14 2010/03/29 05:44:29 rikster5 Exp $ */ +/* $Id: log.h,v 1.15 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * log.h @@ -48,7 +48,6 @@ extern int glob_log_stdout_mask; extern int glob_log_gui_mask; int jp_logf(int log_level, const char *format, ...); -int jp_vlogf (int level, const char *format, va_list val); int write_to_parent(int command, const char *format, ...); #endif diff --git a/memo.c b/memo.c index 53bc416c..a12b672f 100644 --- a/memo.c +++ b/memo.c @@ -1,4 +1,4 @@ -/* $Id: memo.c,v 1.51 2010/10/13 03:18:58 rikster5 Exp $ */ +/* $Id: memo.c,v 1.52 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * memo.c @@ -40,7 +40,7 @@ /********************************* Constants **********************************/ /****************************** Prototypes ************************************/ -int memo_sort(MemoList **memol, int sort_order); +static int memo_sort(MemoList **memol, int sort_order); /****************************** Main Code *************************************/ void free_MemoList(MemoList **memo) @@ -262,7 +262,7 @@ static int memo_compare(const void *v1, const void *v2) return strcoll(str2, str1); } -int memo_sort(MemoList **memol, int sort_order) +static int memo_sort(MemoList **memol, int sort_order) { /* struct MemoAppInfo memo_ai; */ MemoList *temp_memol; diff --git a/memo_gui.c b/memo_gui.c index 7df85d89..2523cea1 100644 --- a/memo_gui.c +++ b/memo_gui.c @@ -1,4 +1,4 @@ -/* $Id: memo_gui.c,v 1.142 2010/10/13 03:18:58 rikster5 Exp $ */ +/* $Id: memo_gui.c,v 1.143 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * memo_gui.c @@ -90,10 +90,10 @@ static MemoList *export_memo_list=NULL; /****************************** Prototypes ************************************/ static int memo_clear_details(void); -int memo_clist_redraw(void); +static int memo_clist_redraw(void); static void connect_changed_signals(int con_or_dis); static int memo_find(void); -int memo_get_details(struct Memo *new_memo, unsigned char *attrib); +static int memo_get_details(struct Memo *new_memo, unsigned char *attrib); static void memo_update_clist(GtkWidget *clist, GtkWidget *tooltip_widget, MemoList **memo_list, int category, int main); static void cb_add_new_record(GtkWidget *widget, gpointer data); @@ -935,7 +935,7 @@ static int memo_clear_details(void) return EXIT_SUCCESS; } -int memo_get_details(struct Memo *new_memo, unsigned char *attrib) +static int memo_get_details(struct Memo *new_memo, unsigned char *attrib) { int i; GtkTextIter start_iter; @@ -1369,7 +1369,7 @@ static int memo_find(void) return EXIT_SUCCESS; } -int memo_clist_redraw(void) +static int memo_clist_redraw(void) { memo_update_clist(clist, category_menu1, &glob_memo_list, memo_category, TRUE); diff --git a/monthview_gui.c b/monthview_gui.c index 2bc15d87..81716950 100644 --- a/monthview_gui.c +++ b/monthview_gui.c @@ -1,4 +1,4 @@ -/* $Id: monthview_gui.c,v 1.56 2010/10/13 03:18:58 rikster5 Exp $ */ +/* $Id: monthview_gui.c,v 1.57 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * monthview_gui.c @@ -54,8 +54,8 @@ static int glob_offset; static struct tm glob_month_date; /****************************** Prototypes ************************************/ -int display_months_appts(struct tm *glob_month_date, GtkWidget **glob_month_texts); -void hide_show_month_boxes(void); +static int display_months_appts(struct tm *glob_month_date, GtkWidget **glob_month_texts); +static void hide_show_month_boxes(void); /****************************** Main Code *************************************/ static gboolean cb_destroy(GtkWidget *widget) @@ -156,7 +156,7 @@ static void cb_enter_selected_day(GtkWidget *widget, * Also, set a global offset for indexing day 1. * Also relabel day labels. */ -void hide_show_month_boxes(void) +static void hide_show_month_boxes(void) { int n; int dow, ndim; @@ -281,7 +281,7 @@ static void create_month_boxes_texts(GtkWidget *month_vbox) gtk_box_pack_start(GTK_BOX(month_vbox), text, TRUE, TRUE, 4); } -int display_months_appts(struct tm *date_in, GtkWidget **day_texts) +static int display_months_appts(struct tm *date_in, GtkWidget **day_texts) { CalendarEventList *ce_list; CalendarEventList *temp_cel; diff --git a/otherconv.c b/otherconv.c index c6715ea5..589601d3 100644 --- a/otherconv.c +++ b/otherconv.c @@ -1,4 +1,4 @@ -/* $Id: otherconv.c,v 1.45 2010/10/13 03:18:59 rikster5 Exp $ */ +/* $Id: otherconv.c,v 1.46 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * otherconv.c @@ -64,8 +64,7 @@ static GIConv glob_frompda = NULL; * To avoid conflicting declarations, it is reimplemented as a thin * inline function over the library function strlen */ -size_t oc_strnlen(const char *s, size_t maxlen); -inline size_t oc_strnlen(const char *s, size_t maxlen) +static inline size_t oc_strnlen(const char *s, size_t maxlen) { return min(strlen(s), maxlen); } diff --git a/password.c b/password.c index 82a5e3c3..ad8e9e61 100644 --- a/password.c +++ b/password.c @@ -1,4 +1,4 @@ -/* $Id: password.c,v 1.30 2010/10/07 21:34:00 rikster5 Exp $ */ +/* $Id: password.c,v 1.31 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * password.c @@ -85,7 +85,7 @@ void bin_to_hex_str(unsigned char *bin, char *hex_str, int len) * This is the hashing algorithm used in palm OS < 4.0. * It is not very secure and is reversible. */ -void palm_encode_hash(unsigned char *ascii, unsigned char *encoded) +static void palm_encode_hash(unsigned char *ascii, unsigned char *encoded) { unsigned char index, shift; unsigned short temp; @@ -141,7 +141,7 @@ void palm_encode_hash(unsigned char *ascii, unsigned char *encoded) * This is the hashing algorithm used in palm OS >= 4.0. * Its just a plain ole' MD5. */ -void palm_encode_md5(unsigned char *ascii, unsigned char *encoded) +static void palm_encode_md5(unsigned char *ascii, unsigned char *encoded) { struct MD5Context m; unsigned char digest[20]; diff --git a/password.h b/password.h index 9afe469d..d53375f4 100644 --- a/password.h +++ b/password.h @@ -1,4 +1,4 @@ -/* $Id: password.h,v 1.10 2010/03/29 05:44:30 rikster5 Exp $ */ +/* $Id: password.h,v 1.11 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * password.h @@ -40,9 +40,6 @@ int show_privates(int hide); #ifdef ENABLE_PRIVATE -void palm_encode_hash(unsigned char *ascii, unsigned char *encoded); - -void palm_encode_md5(unsigned char *ascii, unsigned char *encoded); /* len is the length of the bin str, hex_str must be at least twice as long */ void bin_to_hex_str(unsigned char *bin, char *hex_str, int len); diff --git a/plugins.c b/plugins.c index 3746cddd..870de5a4 100644 --- a/plugins.c +++ b/plugins.c @@ -1,4 +1,4 @@ -/* $Id: plugins.c,v 1.27 2010/10/13 03:18:59 rikster5 Exp $ */ +/* $Id: plugins.c,v 1.28 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * plugins.c @@ -40,7 +40,7 @@ GList *plugins = NULL; /****************************** Prototypes ************************************/ static int get_plugin_info(struct plugin_s *p, char *path); static int get_plugin_sync_bits(void); -gint plugin_sort(gconstpointer a, gconstpointer b); +static gint plugin_sort(gconstpointer a, gconstpointer b); /****************************** Main Code *************************************/ /* Write out the jpilot.plugins file that tells which plugins to sync */ @@ -133,7 +133,7 @@ static int load_plugins_sub1(DIR *dir, char *path, int *number, return count; } -gint plugin_sort(gconstpointer a, gconstpointer b) +static gint plugin_sort(gconstpointer a, gconstpointer b) { const char *ca = ((struct plugin_s *)a)->menu_name; const char *cb = ((struct plugin_s *)b)->menu_name; diff --git a/prefs_gui.c b/prefs_gui.c index 45f850c5..281f3860 100644 --- a/prefs_gui.c +++ b/prefs_gui.c @@ -1,4 +1,4 @@ -/* $Id: prefs_gui.c,v 1.75 2010/10/14 22:47:32 rikster5 Exp $ */ +/* $Id: prefs_gui.c,v 1.76 2010/10/15 16:42:13 rikster5 Exp $ */ /******************************************************************************* * prefs_gui.c @@ -62,7 +62,7 @@ static char *port_choices[]={ #ifdef COLORS /* This doesn't work quite right. There is supposedly no way to do it in GTK. */ -void r(GtkWidget *w, gpointer data) +static void r(GtkWidget *w, gpointer data) { GtkStyle *style; @@ -73,7 +73,7 @@ void r(GtkWidget *w, gpointer data) } } -void set_colors() +static void set_colors() { GtkStyle* style; int i; diff --git a/print.c b/print.c index d3be272d..549dd64a 100644 --- a/print.c +++ b/print.c @@ -1,4 +1,4 @@ -/* $Id: print.c,v 1.50 2010/10/13 03:18:59 rikster5 Exp $ */ +/* $Id: print.c,v 1.51 2010/10/15 16:42:14 rikster5 Exp $ */ /******************************************************************************* * print.c @@ -56,8 +56,6 @@ static FILE *out; static int first_hour, first_min, last_hour, last_min; extern int datebk_category; -int fill_in(struct tm *date, CalendarEventList *a_list); -void ps_strncat(char *dest, char *src, int n); char *PaperSizes[] = { "Letter", "Legal", "Statement", "Tabloid", "Ledger", "Folio", "Quarto", "7x9", "9x11", "9x12", "10x13", @@ -69,6 +67,10 @@ char *PaperSizes[] = { "Letter", "Legal", "Statement", "Tabloid", "Ledger", "C1", "C2", "C3", "C4", "C5", "C6", "C7", "DL", "Filo" }; +/****************************** Prototypes ************************************/ +static int fill_in(struct tm *date, CalendarEventList *a_list); +static void ps_strncat(char *dest, char *src, int n); + /****************************** Main Code *************************************/ static FILE *print_open(void) { @@ -213,7 +215,7 @@ static int print_dayview(struct tm *date, CalendarEventList *ce_list) return EXIT_SUCCESS; } -int fill_in(struct tm *date, CalendarEventList *ce_list) +static int fill_in(struct tm *date, CalendarEventList *ce_list) { CalendarEventList *temp_cel; int i; diff --git a/todo.c b/todo.c index f0255826..53738a24 100644 --- a/todo.c +++ b/todo.c @@ -1,4 +1,4 @@ -/* $Id: todo.c,v 1.52 2010/10/13 03:18:59 rikster5 Exp $ */ +/* $Id: todo.c,v 1.53 2010/10/15 16:42:14 rikster5 Exp $ */ /******************************************************************************* * todo.c @@ -44,7 +44,7 @@ static struct ToDoAppInfo *glob_Ptodo_app_info; /****************************** Prototypes ************************************/ -int todo_sort(ToDoList **todol, int sort_order); +static int todo_sort(ToDoList **todol, int sort_order); /****************************** Main Code *************************************/ void free_ToDoList(ToDoList **todo) @@ -473,7 +473,7 @@ static int todo_compare(const void *v1, const void *v2) return 0; } -int todo_sort(ToDoList **todol, int sort_order) +static int todo_sort(ToDoList **todol, int sort_order) { ToDoList *temp_todol; ToDoList **sort_todol; diff --git a/todo_gui.c b/todo_gui.c index 6d7a475e..a9b3bb71 100644 --- a/todo_gui.c +++ b/todo_gui.c @@ -1,4 +1,4 @@ -/* $Id: todo_gui.c,v 1.172 2010/10/14 04:43:52 rikster5 Exp $ */ +/* $Id: todo_gui.c,v 1.173 2010/10/15 16:42:14 rikster5 Exp $ */ /******************************************************************************* * todo_gui.c @@ -103,11 +103,11 @@ static int record_changed; /****************************** Prototypes ************************************/ void todo_update_clist(GtkWidget *clist, GtkWidget *tooltip_widget, ToDoList **todo_list, int category, int main); -int todo_clear_details(void); -int todo_clist_redraw(void); -static void connect_changed_signals(int con_or_dis); +static int todo_clear_details(void); +static int todo_clist_redraw(void); static int todo_find(void); static void cb_add_new_record(GtkWidget *widget, gpointer data); +static void connect_changed_signals(int con_or_dis); /****************************** Main Code *************************************/ /* Called once on initialization of GUI */ @@ -1149,7 +1149,7 @@ static void cb_check_button_no_due_date(GtkWidget *widget, gpointer data) } } -int todo_clear_details(void) +static int todo_clear_details(void) { time_t ltime; struct tm *now; @@ -1984,7 +1984,7 @@ static gboolean cb_key_pressed_shift_tab(GtkWidget *widget, } /* This redraws the clist and goes back to the same line number */ -int todo_clist_redraw(void) +static int todo_clist_redraw(void) { todo_update_clist(clist, category_menu1, &glob_todo_list, todo_category, TRUE); diff --git a/utils.c b/utils.c index 9b98d7d6..4e665546 100644 --- a/utils.c +++ b/utils.c @@ -1,4 +1,4 @@ -/* $Id: utils.c,v 1.189 2010/10/13 03:18:59 rikster5 Exp $ */ +/* $Id: utils.c,v 1.190 2010/10/15 16:42:14 rikster5 Exp $ */ /******************************************************************************* * utils.c @@ -77,11 +77,11 @@ unsigned int glob_find_id; static gboolean cb_destroy(GtkWidget *widget); static void cb_quit(GtkWidget *widget, gpointer data); static void cb_today(GtkWidget *widget, gpointer data); -int write_to_next_id(unsigned int unique_id); -int write_to_next_id_open(FILE *pc_out, unsigned int unique_id); -int forward_backward_in_ce_time(const struct CalendarEvent *cale, - struct tm *t, - int forward_or_backward); +static int write_to_next_id(unsigned int unique_id); +static int write_to_next_id_open(FILE *pc_out, unsigned int unique_id); +static int forward_backward_in_ce_time(const struct CalendarEvent *cale, + struct tm *t, + int forward_or_backward); static int str_to_iv_str(char *dest, int destsz, char *src, int isical); /****************************** Main Code *************************************/ @@ -230,7 +230,7 @@ static const char b64_dict[65] = { "abcdefghijklmnopqrstuvwxyz" "0123456789+/=" }; -void base64_out(FILE *f, unsigned char *str) +static void base64_out(FILE *f, unsigned char *str) { unsigned char *index, char1, char2, char3; int loop, pad; @@ -259,7 +259,7 @@ void base64_out(FILE *f, unsigned char *str) } -unsigned int bytes_to_bin(unsigned char *bytes, unsigned int num_bytes) +static unsigned int bytes_to_bin(unsigned char *bytes, unsigned int num_bytes) { unsigned int i, n; n=0; @@ -3653,7 +3653,7 @@ int verify_csv_header(const char *header, int num_fields, const char *file_name) return EXIT_SUCCESS; } -int write_to_next_id(unsigned int unique_id) +static int write_to_next_id(unsigned int unique_id) { FILE *pc_out; int ret; @@ -3671,7 +3671,7 @@ int write_to_next_id(unsigned int unique_id) return ret; } -int write_to_next_id_open(FILE *pc_out, unsigned int unique_id) +static int write_to_next_id_open(FILE *pc_out, unsigned int unique_id) { char id_str[50]; diff --git a/utils.h b/utils.h index 3b820f3a..729e07e3 100644 --- a/utils.h +++ b/utils.h @@ -1,4 +1,4 @@ -/* $Id: utils.h,v 1.81 2010/10/13 03:18:59 rikster5 Exp $ */ +/* $Id: utils.h,v 1.82 2010/10/15 16:42:14 rikster5 Exp $ */ /******************************************************************************* * utils.h @@ -292,8 +292,6 @@ int undelete_pc_record(AppType app_type, void *VP, int flag); void get_month_info(int month, int day, int year, int *dow, int *ndim); -unsigned int bytes_to_bin(unsigned char *bytes, unsigned int num_bytes); - void free_mem_rec_header(mem_rec_header **mem_rh); void print_string(char *str, int len); @@ -384,9 +382,6 @@ void lstrncpy_remove_cr_lfs(char *dest, char *src, int len); * fmt ... is like printf. */ void ldif_out(FILE *f, char *name, char *fmt, ...); -/* Output base64-encoded string to file */ -void base64_out(FILE *, unsigned char *); - void cleanup_path(char *path); int add_days_to_date(struct tm *date, int n); diff --git a/weekview_gui.c b/weekview_gui.c index 6f8e4c43..a510e0aa 100644 --- a/weekview_gui.c +++ b/weekview_gui.c @@ -1,4 +1,4 @@ -/* $Id: weekview_gui.c,v 1.54 2010/10/13 03:18:59 rikster5 Exp $ */ +/* $Id: weekview_gui.c,v 1.55 2010/10/15 16:42:14 rikster5 Exp $ */ /******************************************************************************* * weekview_gui.c @@ -50,8 +50,8 @@ static GObject *week_day_text_buffer[8]; static struct tm glob_week_date; /****************************** Prototypes ************************************/ -int clear_weeks_appts(GtkWidget **day_texts); -int display_weeks_appts(struct tm *date_in, GtkWidget **day_texts); +static int clear_weeks_appts(GtkWidget **day_texts); +static int display_weeks_appts(struct tm *date_in, GtkWidget **day_texts); /****************************** Main Code *************************************/ static gboolean cb_destroy(GtkWidget *widget) @@ -122,7 +122,7 @@ static void cb_week_move(GtkWidget *widget, gpointer data) thaw_weeks_appts(); } -int clear_weeks_appts(GtkWidget **day_texts) +static int clear_weeks_appts(GtkWidget **day_texts) { int i; GObject *text_buffer; @@ -140,7 +140,7 @@ int clear_weeks_appts(GtkWidget **day_texts) * It will then print the next eight days to the day_texts array of * text boxes. */ -int display_weeks_appts(struct tm *date_in, GtkWidget **day_texts) +static int display_weeks_appts(struct tm *date_in, GtkWidget **day_texts) { CalendarEventList *ce_list; CalendarEventList *temp_cel;