From: Peter Howkins Date: Thu, 28 Jun 2018 03:19:15 +0000 (+0100) Subject: dtimsstart: Change to ANSI function definitions X-Git-Tag: 2.3.0a~350 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1c545e12d2086a48df1832093063aa6ff7d1415c;p=oweals%2Fcde.git dtimsstart: Change to ANSI function definitions --- diff --git a/cde/programs/dtimsstart/action.c b/cde/programs/dtimsstart/action.c index 4c4a3ea5..8d051be8 100644 --- a/cde/programs/dtimsstart/action.c +++ b/cde/programs/dtimsstart/action.c @@ -42,14 +42,13 @@ static DtActionInvocationID actionId = 0; /* ***** DtAction functions ***** */ -static void DbReloadProc(cd) - XtPointer cd; +static void DbReloadProc(XtPointer cd) { DPR(("DbReloadProc(): action database updated\n")); DtDbLoad(); /* Pick up any dynamic changes to the database files */ } -static bool init_action_env() +static bool init_action_env(void) { init_window_env(); @@ -68,12 +67,8 @@ static bool init_action_env() return actionEnabled; } -static void action_cb(id, cd, args, argcnt, status) - long unsigned id; - XtPointer cd; /* unused */ - DtActionArg *args; - int argcnt; - DtActionStatus status; +static void action_cb(long unsigned id, XtPointer cd /* unused */, + DtActionArg *args, int argcnt, DtActionStatus status) { if (actionId == 0) { DPR(("action_cb(): invalid id %d != %d\n", id, actionId)); @@ -134,7 +129,7 @@ static void action_cb(id, cd, args, argcnt, status) } -static void wait_action_done() +static void wait_action_done(void) { XEvent event; @@ -157,9 +152,7 @@ static void wait_action_done() return; } -int invoke_action(action, host) - char *action; - char *host; +int invoke_action(char *action, char *host) { if (init_action_env() != True) return ErrInternal; @@ -188,8 +181,7 @@ int invoke_action(action, host) } -void send_dtims_msg(msg, errcode) - int msg, errcode; +void send_dtims_msg(int msg, int errcode) { XEvent ev; @@ -204,11 +196,8 @@ void send_dtims_msg(msg, errcode) XSendEvent(Dpy, XtWindow(TopW), False, NoEventMask, &ev); } -void dtims_msg_proc(w, cd, event, continue_dispatch) - Widget w; - XtPointer cd; - XEvent *event; - Boolean *continue_dispatch; /* never changed */ +void dtims_msg_proc(Widget w, XtPointer cd, XEvent *event, + Boolean *continue_dispatch /* never changed */) { XClientMessageEvent *ev = &event->xclient; int msg, errcode; diff --git a/cde/programs/dtimsstart/env.c b/cde/programs/dtimsstart/env.c index 3d60cd0e..e9d3f4d9 100644 --- a/cde/programs/dtimsstart/env.c +++ b/cde/programs/dtimsstart/env.c @@ -36,7 +36,7 @@ typedef enum { /* local func */ static int shell_type(/* shell */); -int set_cmd_env() +int set_cmd_env(void) { int ret = NoError; char **aliases = (char **)0; @@ -63,7 +63,7 @@ int set_cmd_env() } -int get_user_environ() +int get_user_environ(void) { int ret = NoError; char buf[BUFSIZ], *p; @@ -138,10 +138,7 @@ int get_user_environ() } -int expand_string(in_str, out_str, out_len, ims) - char *in_str, *out_str; - int out_len; - ImsConf *ims; +int expand_string(char *in_str, char *out_str, int out_len, ImsConf *ims) { register char *p, *q, *ep; char str[20]; @@ -220,8 +217,7 @@ int expand_string(in_str, out_str, out_len, ims) } -static int shell_type(shell) - char *shell; +static int shell_type(char *shell) { char *p; int len; @@ -245,9 +241,7 @@ static int shell_type(shell) } -int make_new_environ(oenv, sel) - OutEnv *oenv; - UserSelection *sel; +int make_new_environ(OutEnv *oenv, UserSelection *sel) { ImsConf *ims; EnvEnt *ep, *ep2; @@ -362,8 +356,8 @@ int make_new_environ(oenv, sel) return NoError; } -int put_new_environ(oenv) /* print modified environment variables */ - OutEnv *oenv; +/* print modified environment variables */ +int put_new_environ(OutEnv *oenv) { EnvEnt *ep; char tmpbuf[BUFSIZ], *bp, *vp; @@ -433,8 +427,7 @@ int put_new_environ(oenv) /* print modified environment variables */ } -int set_remote_env(ptr, env_pass) - char *ptr, *env_pass; +int set_remote_env(char *ptr, char *env_pass) { char *bp = ptr, *ep; char **ls, **ls2, **pp, **pp2; @@ -477,8 +470,7 @@ int set_remote_env(ptr, env_pass) } # ifdef old_hpux -char *xhp_xinput_name(locale) - char *locale; +char *xhp_xinput_name(char *locale) { char *xinput_name = "X@INPUT"; char **pp, *p; @@ -513,8 +505,7 @@ char *xhp_xinput_name(locale) } -char *get_real_locale(locale, aliases) - char *locale, ***aliases; +char *get_real_locale(char *locale, char ***aliases) { int i; int match_idx = -1; diff --git a/cde/programs/dtimsstart/file.c b/cde/programs/dtimsstart/file.c index 18c37b8f..f611fc39 100644 --- a/cde/programs/dtimsstart/file.c +++ b/cde/programs/dtimsstart/file.c @@ -27,7 +27,7 @@ #include /* local func */ -static void put_selection_entry(/* fp, ent_type, is_valid, val, val2 */); +static void put_selection_entry(FILE *fp, int ent_type, bool is_valid, char *val, char *val2); static void put_ims_conf(/* fp, sel */); static void put_select_mode(/* fp, select_mode */); static void put_selection_header(/* fp */); @@ -38,7 +38,7 @@ static char *SelectFileFormat = NULL; static bool cmdconf_initialized = False; -int create_xims_dir() +int create_xims_dir(void) { int ret = NoError; char path[MAXPATHLEN]; @@ -77,9 +77,7 @@ int create_xims_dir() return ret; } -int init_log_file(org_path, check_size) - char *org_path; - int check_size; +int init_log_file(char *org_path, int check_size) { char path[MAXPATHLEN]; bool log_exists = False; @@ -124,8 +122,7 @@ _err: } -int set_errorlog(path) - char *path; +int set_errorlog(char *path) { int fd; @@ -146,7 +143,7 @@ int set_errorlog(path) } -int read_cmd_conf() +int read_cmd_conf(void) { char buf[MAXPATHLEN]; CmdConf *conf = &Conf; @@ -377,7 +374,7 @@ _default: return NoError; } -int expand_cmd_conf() +int expand_cmd_conf(void) { char **pp[20 + NUM_ACTIONS], *p, buf[BUFSIZ]; int i, j, n; @@ -434,9 +431,7 @@ int expand_cmd_conf() } -int read_imsconf(conf, ims_name, ims_fname) - ImsConf *conf; - char *ims_name, *ims_fname; +int read_imsconf(ImsConf *conf, char *ims_name, char *ims_fname) { int ret = NoError; char path[MAXPATHLEN]; @@ -533,9 +528,7 @@ int read_imsconf(conf, ims_name, ims_fname) return ret; } -int check_ims_conf(ims, ims_name) - ImsConf *ims; - char *ims_name; +int check_ims_conf(ImsConf *ims, char *ims_name) { int ret = NoError; char *missing_entry = NULL; @@ -570,9 +563,7 @@ int check_ims_conf(ims, ims_name) return ret; } -int read_localeconf(list, locale_name) - ImsList *list; - char *locale_name; +int read_localeconf(ImsList *list, char *locale_name) { char path[MAXPATHLEN]; char *lp, *valp, *pp; @@ -669,9 +660,7 @@ int read_localeconf(list, locale_name) return list->status; } -int read_user_selection(fselp, locale_name) - FileSel **fselp; - char *locale_name; +int read_user_selection(FileSel **fselp, char *locale_name) { char path[MAXPATHLEN]; int ret; @@ -702,9 +691,7 @@ int read_user_selection(fselp, locale_name) return NoError; } -int read_selection_file(fsel, fp) - FileSel *fsel; - FILE *fp; +int read_selection_file(FileSel *fsel, FILE *fp) { char *lp, *valp, *vp, *p; int i, nopts, line_num; @@ -789,9 +776,7 @@ int read_selection_file(fsel, fp) return NoError; } -int save_user_selection(sel, locale_name) - UserSelection *sel; - char *locale_name; +int save_user_selection(UserSelection *sel, char *locale_name) { char path[MAXPATHLEN]; int dpy_specific; @@ -825,11 +810,7 @@ int save_user_selection(sel, locale_name) #define _IMSOPTION 4 #define _IMSOPT2 5 -static void put_selection_entry(fp, ent_type, is_valid, val, val2) - FILE *fp; - int ent_type; - bool is_valid; - char *val, *val2; +static void put_selection_entry(FILE *fp, int ent_type, bool is_valid, char *val, char *val2) { char *name = NULL; @@ -852,9 +833,7 @@ static void put_selection_entry(fp, ent_type, is_valid, val, val2) } -static void put_ims_conf(fp, sel) - FILE *fp; - UserSelection *sel; +static void put_ims_conf(FILE *fp, UserSelection *sel) { char *valp, val[20]; @@ -891,9 +870,7 @@ static void put_ims_conf(fp, sel) } } -static void put_select_mode(fp, select_mode) - FILE *fp; - int select_mode; +static void put_select_mode(FILE *fp, int select_mode) { char val[20]; if (select_mode != SEL_MODE_NOAUTO && select_mode != SEL_MODE_AUTO @@ -908,22 +885,20 @@ static void put_select_mode(fp, select_mode) } -static void put_selection_header(fp) - FILE *fp; +static void put_selection_header(FILE *fp) { fprintf(fp, "%s %s\n", COMMENT_CHARS, ProgramRevision); if (SelectFileFormat) fprintf(fp, "%s%s\n", COMMENT_CHARS, SelectFileFormat); } -static void put_selection_sep(fp) - FILE *fp; +static void put_selection_sep(FILE *fp) { fprintf(fp, "%s\n", COMMENT_CHARS); } -int get_select_mode() +int get_select_mode(void) { char path[MAXPATHLEN]; char *lp, *valp; @@ -957,8 +932,7 @@ int get_select_mode() return select_mode; } -int set_select_mode(cur_mode, new_mode) - int cur_mode, new_mode; +int set_select_mode(int cur_mode, int new_mode) { char path[MAXPATHLEN]; int dpy_specific; @@ -1055,9 +1029,7 @@ int set_select_mode(cur_mode, new_mode) return NoError; } -static int user_selection_fname(buf, buf_len, dpy_specific) - char *buf; - int buf_len, dpy_specific; +static int user_selection_fname(char *buf, int buf_len, int dpy_specific) { int len; UserEnv *uenv = &userEnv; @@ -1125,8 +1097,7 @@ static int user_selection_fname(buf, buf_len, dpy_specific) } -int parse_protolist(valp) - char *valp; +int parse_protolist(char *valp) { int proto_bits = 0; @@ -1140,8 +1111,7 @@ int parse_protolist(valp) return proto_bits; } -int default_protocol(conf) - ImsConf *conf; +int default_protocol(ImsConf *conf) { if (conf->protocols & ProtoBit(Proto_XIM)) return Proto_XIM; else if (conf->protocols & ProtoBit(Proto_Ximp)) return Proto_Ximp; diff --git a/cde/programs/dtimsstart/main.c b/cde/programs/dtimsstart/main.c index 8816c577..12bb4d2c 100644 --- a/cde/programs/dtimsstart/main.c +++ b/cde/programs/dtimsstart/main.c @@ -75,9 +75,7 @@ static int exitSignalNumber = 0; static bool do_usage = False; -main (argc, argv) - int argc; - char **argv; +int main (int argc, char **argv) { int ret = NoError; int ret2; @@ -149,8 +147,7 @@ main (argc, argv) } -void sigExit(sig) - int sig; +void sigExit(int sig) { DPR(("sigExit: %s (%d)\n", sig_name(sig), sig)); signal(sig, SIG_IGN); @@ -158,8 +155,7 @@ void sigExit(sig) Exit(ErrSignaled); } -void Exit(err_code) - int err_code; +void Exit(int err_code) { int exit_code = IsNoError(err_code) ? 0 : 1; @@ -186,8 +182,7 @@ void Exit(err_code) exit(exit_code); } -int NotifyErrCode(err_code) - int err_code; +int NotifyErrCode(int err_code) { char buf[BUFSIZ], *bp, val[20]; static bool notify_done = False; @@ -229,8 +224,7 @@ int NotifyErrCode(err_code) } -static int IsNoError(error) - ximsError error; +static int IsNoError(ximsError error) { switch (error) { case NoError: case ErrIsNone: case ErrNotRun: @@ -244,8 +238,7 @@ static int IsNoError(error) return False; } -static int EnvNeeded(error) - ximsError error; +static int EnvNeeded(ximsError error) { switch (error) { case NoError: case ErrIsNone: case ErrNotRun: @@ -258,8 +251,7 @@ static int EnvNeeded(error) return False; } -static int ErrMsgDisabled(error) - ximsError error; +static int ErrMsgDisabled(ximsError error) { switch (error) { case NoError: case ErrIsNone: case ErrNotRun: @@ -274,8 +266,7 @@ static int ErrMsgDisabled(error) return False; } -int ErrFilePathNeeded(error) - ximsError error; +int ErrFilePathNeeded(ximsError error) { switch (error) { case ErrFileOpen: case ErrFileCreate: case ErrDirCreate: @@ -286,7 +277,7 @@ int ErrFilePathNeeded(error) return False; } -int InWaitingState() +int InWaitingState(void) { switch (OpState) { case State_Init_Err: @@ -297,7 +288,7 @@ int InWaitingState() return False; } -void ximsMain() +void ximsMain(void) { static int call_cnt = 0; @@ -366,7 +357,7 @@ void ximsMain() } -void ximsFinish() +void ximsFinish(void) { OpStateVal oldOpState = OpState; @@ -408,7 +399,7 @@ void ximsFinish() } -static int ximsShowImsList() +static int ximsShowImsList(void) { int ret; int i; @@ -491,7 +482,7 @@ static int ximsShowImsList() return NoError; } -static int ximsShowCurrentIms() +static int ximsShowCurrentIms(void) { int ret = NoError; FileSel *fsel; @@ -520,8 +511,7 @@ static int ximsShowCurrentIms() } -static int prepare_remote(win_st) - int win_st; +static int prepare_remote(int win_st) { int ret; char **av = NULL; @@ -565,7 +555,7 @@ static int prepare_remote(win_st) return NoError; } -static int ximsRemoteConf() +static int ximsRemoteConf(void) { int ret; char *locale; @@ -583,7 +573,7 @@ static int ximsRemoteConf() } -static int ximsSetMode() +static int ximsSetMode(void) { int ret = NoError; int cur_mode = SEL_MODE_NONE; @@ -622,8 +612,7 @@ static int ximsSetMode() return ret; } -static void show_select_mode(mode) - int mode; +static void show_select_mode(int mode) { char *valp; @@ -652,8 +641,7 @@ static void show_select_mode(mode) } -static int set_locale_env(locale) - char *locale; +static int set_locale_env(char *locale) { char *env_name, *env_value, *bp, *vp, buf[BUFSIZ], buf2[BUFSIZ]; static char *last_lang_env[2] = { NULL, NULL }; @@ -729,8 +717,7 @@ static int set_locale_env(locale) return NoError; } -static void init_command(progname) - char *progname; +static void init_command(char *progname) { /* globals */ ProgramName = progname; @@ -775,9 +762,7 @@ static void init_command(progname) } -static bool optname_match(name, str, minlen) - char *name, *str; - int minlen; +static bool optname_match(char *name, char *str, int minlen) { int nlen, slen; @@ -790,9 +775,7 @@ static bool optname_match(name, str, minlen) return False; } -static int parse_options(argc, argv) - int argc; - char **argv; +static int parse_options(int argc, char **argv) { char *opt; int i, n; @@ -1118,8 +1101,7 @@ static OptDesc opts_internal[] = { }; #endif /* DEBUG */ -static void usage(force) - int force; +static void usage(int force) { char *fmt = "\t%-20s%s\n"; @@ -1167,9 +1149,7 @@ static void usage(force) /* ******** error messages ******** */ -char *xims_errmsg(err_num, arg1, arg2, arg3) - int err_num; - void *arg1, *arg2, *arg3; +char *xims_errmsg(int err_num, void *arg1, void *arg2, void *arg3) { char *fmt = NULL, *bp; int len; diff --git a/cde/programs/dtimsstart/remote.c b/cde/programs/dtimsstart/remote.c index ffce2447..13965673 100644 --- a/cde/programs/dtimsstart/remote.c +++ b/cde/programs/dtimsstart/remote.c @@ -149,8 +149,7 @@ strcasecmp(register const char *s1, } #endif -int put_remote_conf(locale, ims_name) - char *locale, *ims_name; +int put_remote_conf(char *locale, char *ims_name) { int ret; int msg_status = NoError; @@ -182,9 +181,7 @@ int put_remote_conf(locale, ims_name) return ret; } -int get_remote_conf(listp, hostname, locale, ims_name) - ImsList **listp; - char *hostname, *locale, *ims_name; +int get_remote_conf(ImsList **listp, char *hostname, char *locale, char *ims_name) { int ret = NoError; int conflen = 0; @@ -256,11 +253,9 @@ int get_remote_conf(listp, hostname, locale, ims_name) #define PUT_DATA(nm, val) *bp++ = ' ', bp = strcpyx(bp, (nm)), \ *bp++ = '=', bp = strcpyx(bp, (val)), *bp++ = '\n' -static int mk_remote_conf(list, locale, ims_name, status, confbuf, conflen) - ImsList *list; - int status; - char *locale, *ims_name, *confbuf; - int *conflen; +static int mk_remote_conf(ImsList *list, char *locale, + char *ims_name, int status, + char *confbuf, int *conflen) { int num_ent; int i, j; @@ -332,10 +327,7 @@ static int mk_remote_conf(list, locale, ims_name, status, confbuf, conflen) return NoError; } -static char *mk_ims_ent(bp, idx, ent) - ImsEnt *ent; - int idx; - register char *bp; +static char *mk_ims_ent(register char *bp, int idx, ImsEnt *ent) { ImsConf *ims = ent->ims; char val[20]; @@ -375,9 +367,7 @@ static char *mk_ims_ent(bp, idx, ent) #undef PUT_DATA -static int parse_ims_list(ptr, list) - char *ptr; - ImsList *list; +static int parse_ims_list(char *ptr, ImsList *list) { register char *bp = ptr; char *np, *vp; @@ -483,10 +473,7 @@ static int parse_ims_list(ptr, list) } -static int parse_remote_conf(listp, locale, confbuf, conflen) - ImsList **listp; - char *locale, *confbuf; - int conflen; +static int parse_remote_conf(ImsList **listp, char *locale, char *confbuf, int conflen) { int ret = NoError; char *bp = confbuf; @@ -545,8 +532,7 @@ static int parse_remote_conf(listp, locale, confbuf, conflen) } -int exec_remote_ims(sel) - UserSelection *sel; +int exec_remote_ims(UserSelection *sel) { int ret = NoError; int n, num_opts, binc; @@ -636,8 +622,7 @@ int exec_remote_ims(sel) } -int check_hostname(hostname) - char *hostname; +int check_hostname(char *hostname) { int host_type = HOST_UNKNOWN; char *local = userEnv.hostname; @@ -681,9 +666,7 @@ int check_hostname(hostname) -int set_remote_confdata(confbuf, conflen) - char *confbuf; - int conflen; +int set_remote_confdata(char *confbuf, int conflen) { char *av[2]; @@ -692,9 +675,7 @@ int set_remote_confdata(confbuf, conflen) return set_window_data(1, av); } -int read_remote_confdata(confbuf, conflen) - char **confbuf; - int *conflen; +int read_remote_confdata(char **confbuf, int *conflen) { char **av = NULL; int ac = 0; @@ -710,10 +691,7 @@ int read_remote_confdata(confbuf, conflen) } -static int prepare_action(act_typ, av, ac) - int act_typ; - char **av; - int ac; +static int prepare_action(int act_typ, char **av, int ac) { int ret; @@ -738,7 +716,7 @@ static int prepare_action(act_typ, av, ac) } -int get_window_status() +int get_window_status(void) { long *datap; int len = 0; @@ -762,8 +740,7 @@ int get_window_status() return win_st; } -int change_window_status(status) - int status; +int change_window_status(int status) { if (winEnv.atom_status == None || winEnv.atom_owner == None) return ErrInternal; @@ -780,9 +757,7 @@ int change_window_status(status) return NoError; } -int set_window_data(ac, av) - int ac; - char **av; +int set_window_data(int ac, char **av) { register int i; register int nbytes; @@ -823,9 +798,7 @@ int set_window_data(ac, av) } -int get_window_data(acp, avp) - int *acp; - char ***avp; +int get_window_data(int *acp, char ***avp) { int ac; char *data; @@ -878,13 +851,9 @@ int get_window_data(acp, avp) } -static int read_property(prop, type, format, del_flag, datapp, lenp) - Atom prop; - Atom type; - int format; - int del_flag; - unsigned char **datapp; - unsigned long *lenp; +static int read_property(Atom prop, Atom type, int format, + int del_flag, unsigned char **datapp, + unsigned long *lenp) { Atom realtype; int realformat; diff --git a/cde/programs/dtimsstart/select.c b/cde/programs/dtimsstart/select.c index f096bec1..53ddc17c 100644 --- a/cde/programs/dtimsstart/select.c +++ b/cde/programs/dtimsstart/select.c @@ -30,7 +30,7 @@ static int setup_remote_selection(/* sel */); static int setup_user_selection(/* sel, list, idx */); -void ximsSelect() +void ximsSelect(void) { int ret; bool use_win; @@ -166,9 +166,7 @@ void ximsSelect() } -static int fill_ims_ent(list, top, last) - ImsList *list; - int top, last; +static int fill_ims_ent(ImsList *list, int top, int last) { int ret; int i; @@ -199,10 +197,7 @@ static int fill_ims_ent(list, top, last) } -static int setup_local_selection(sel, list, conf_all) - UserSelection *sel; - ImsList *list; - int conf_all; +static int setup_local_selection(UserSelection *sel, ImsList *list, int conf_all) { int ret; int idx, top, last; @@ -218,8 +213,7 @@ static int setup_local_selection(sel, list, conf_all) return ret; } -static int setup_remote_selection(sel) - UserSelection *sel; +static int setup_remote_selection(UserSelection *sel) { int ret; int idx; @@ -235,10 +229,7 @@ static int setup_remote_selection(sel) return ret; } -static int setup_user_selection(sel, list, idx) - UserSelection *sel; - ImsList *list; - int idx; +static int setup_user_selection(UserSelection *sel, ImsList *list, int idx) { if (sel->name) { if (idx >= 0) { @@ -256,12 +247,7 @@ static int setup_user_selection(sel, list, idx) return sel->status; } -int update_user_selection(sel, list, idx, host, host_type) - UserSelection *sel; - ImsList *list; - int idx; - char *host; - int host_type; +int update_user_selection(UserSelection *sel, ImsList *list, int idx, char *host, int host_type) { ImsEnt *ent; @@ -292,9 +278,7 @@ int update_user_selection(sel, list, idx, host, host_type) } -int get_ims_idx(list, name) - ImsList *list; - char *name; +int get_ims_idx(ImsList *list, char *name) { int idx; @@ -306,8 +290,7 @@ int get_ims_idx(list, name) return -1; } -int set_ims_status(ent) - ImsEnt *ent; +int set_ims_status(ImsEnt *ent) { int ret = NoError; ImsConf *ims = ent->ims; @@ -328,10 +311,7 @@ int set_ims_status(ent) } -int get_ims_list(listp, locale, fill_ent) - ImsList **listp; - char *locale; - int fill_ent; +int get_ims_list(ImsList **listp, char *locale, int fill_ent) { int ret = NoError; ImsList *list; diff --git a/cde/programs/dtimsstart/start.c b/cde/programs/dtimsstart/start.c index a1d60a85..78fc2a38 100644 --- a/cde/programs/dtimsstart/start.c +++ b/cde/programs/dtimsstart/start.c @@ -55,7 +55,7 @@ static int create_dummy_ic(/* xim */); # endif /* old_hpux */ -void ximsStart() +void ximsStart(void) { int ret; UserSelection *sel = &userSel; @@ -118,7 +118,7 @@ void ximsStart() } -void ximsWait() +void ximsWait(void) { OpStateVal oldOpState = OpState; UserSelection *sel = &userSel; @@ -169,7 +169,7 @@ void ximsWait() } -void ximsWaitDone() +void ximsWaitDone(void) { int ret; UserSelection *sel = &userSel; @@ -224,20 +224,18 @@ void ximsWaitDone() ximsMain(); } -int is_waiting() +int is_waiting(void) { return userSel.renv && userSel.renv->status == ErrImsWaiting; } -void set_sig_chld(enable) - int enable; +void set_sig_chld(int enable) { DPR(("set_sig_chld(%s)\n", enable ? "Enabled" : "Disabled")); signal(SIGCHLD, enable ? on_sig_chld : SIG_IGN); } -int im_mod_available(renv) - RunEnv *renv; +int im_mod_available(RunEnv *renv) { Window owner; @@ -283,9 +281,7 @@ int im_mod_available(renv) /* ***** IMS options ***** */ -int mk_ims_option(ptr, sel) - char *ptr; - UserSelection *sel; +int mk_ims_option(char *ptr, UserSelection *sel) { char *bp = ptr; FileSel *fsel = sel->fsel; @@ -326,8 +322,7 @@ int mk_ims_option(ptr, sel) return (int) (bp - ptr); } -static int check_ims_opt(ptr) - char *ptr; +static int check_ims_opt(char *ptr) { /* option string must not contain any of shell's metacaharacters */ if (strpbrk(ptr, "`'\"#;&()|<>\n")) { @@ -346,7 +341,7 @@ static int check_ims_opt(ptr) static bool resource_loaded = False; -int load_resources() +int load_resources(void) { int ret; int empty; @@ -395,7 +390,7 @@ int load_resources() return ret; } -int restore_resources() +int restore_resources(void) { if (!resource_loaded) { DPR2(("restore_resources: not loaded yet -- not restored\n")); @@ -405,8 +400,7 @@ int restore_resources() return restore_RM(); } -static char *find_session_resfile(res_type) - int res_type; +static char *find_session_resfile(int res_type) { char path[MAXPATHLEN]; char **ls = (char **) 0, **pp; @@ -449,8 +443,7 @@ static char *find_session_resfile(res_type) /* ***** local functions ***** */ -static int check_selection(sel) - UserSelection *sel; +static int check_selection(UserSelection *sel) { int ret = NoError; @@ -470,8 +463,7 @@ static int check_selection(sel) return ret; } -static int build_run_env(sel) - UserSelection *sel; +static int build_run_env(UserSelection *sel) { char *p; int proto; @@ -570,8 +562,7 @@ static int build_run_env(sel) return NoError; } -static int run_ims(sel) - UserSelection *sel; +static int run_ims(UserSelection *sel) { int ret = NoError; @@ -598,8 +589,7 @@ static int run_ims(sel) return ret; } -static int invoke_ims(sel) - UserSelection *sel; +static int invoke_ims(UserSelection *sel) { RunEnv *renv = sel->renv; pid_t pid; @@ -646,8 +636,7 @@ static int invoke_ims(sel) return NoError; } -static void on_sig_chld(sig) - int sig; +static void on_sig_chld(int sig) { int wait_status = 0; pid_t pid; @@ -703,9 +692,7 @@ static void on_sig_chld(sig) return; } -static bool is_ims_running(renv, ims) - RunEnv *renv; - ImsConf *ims; +static bool is_ims_running(RunEnv *renv, ImsConf *ims) { char *prop_str; Window owner; @@ -745,8 +732,7 @@ static bool is_ims_running(renv, ims) } -static int settle_ims(sel) - UserSelection *sel; +static int settle_ims(UserSelection *sel) { if (isXsession()) { @@ -774,9 +760,7 @@ static int settle_ims(sel) return NoError; } -static Window property_owner(prop_atom, prop_str) - Atom *prop_atom; - char *prop_str; +static Window property_owner(Atom *prop_atom, char *prop_str) { Atom property = prop_atom ? *prop_atom : None; @@ -799,16 +783,14 @@ static Window property_owner(prop_atom, prop_str) static jmp_buf jmp_env; static Window dmy_win = 0; /* temporary window used for XCreateIC() */ -static void catch_alarm(sig) - int sig; +static void catch_alarm(int sig) { signal(SIGALRM, SIG_IGN); alarm(0); longjmp(jmp_env, 1); } -static int try_connection(sel) - UserSelection *sel; +static int try_connection(UserSelection *sel) { RunEnv *renv = sel->renv; ImsConf *ims = sel->ent->ims; @@ -886,8 +868,7 @@ static int try_connection(sel) return ic_ok ? NoError : ErrImsTimeout; /* ErrImsConnect; */ } -static int create_dummy_ic(xim) - XIM xim; +static int create_dummy_ic(XIM xim) { int scr; XFontSet fset; diff --git a/cde/programs/dtimsstart/util.c b/cde/programs/dtimsstart/util.c index 945a2408..cf124a34 100644 --- a/cde/programs/dtimsstart/util.c +++ b/cde/programs/dtimsstart/util.c @@ -30,7 +30,7 @@ /* ******** locale name manupilation ******** */ -int find_CDE_locale_name() +int find_CDE_locale_name(void) { UserEnv *uenv = &userEnv; _DtXlateDb db = NULL; @@ -61,8 +61,7 @@ int find_CDE_locale_name() return ret; } -char *find_system_locale_name(CDE_locale) - char *CDE_locale; +char *find_system_locale_name(char *CDE_locale) { _DtXlateDb db = NULL; int ret = NoError; @@ -93,16 +92,14 @@ char *find_system_locale_name(CDE_locale) /* ******** string manupilation ******** */ -char *strcpyx(dest, src) - register char *dest, *src; +char *strcpyx(register char *dest, register char *src) { while (*dest++ = *src++) ; return(--dest); } #ifdef unused -char *strcpy2(dest, src1, src2) - register char *dest, *src1, *src2; +char *strcpy2(register char *dest, register char *src1, register char *src2) { while (*dest++ = *src1++) ; --dest; @@ -110,8 +107,7 @@ char *strcpy2(dest, src1, src2) return(--dest); } -char *newstradded(src1, src2, src3) - register char *src1, *src2, *src3; +char *newstradded(register char *src1, register char *src2, register char *src3) { register char *p; char *dest; @@ -125,9 +121,7 @@ char *newstradded(src1, src2, src3) #endif /* unused */ -int str_to_int(ptr, val) - char *ptr; - int *val; +int str_to_int(char *ptr, int *val) { int base; char *pp; @@ -140,9 +134,7 @@ int str_to_int(ptr, val) return(True); } -bool str_to_bool(ptr, def_val) - char *ptr; - bool def_val; +bool str_to_bool(char *ptr, bool def_val) { if (!ptr || !*ptr) return def_val; skip_white(ptr); @@ -168,8 +160,7 @@ bool str_to_bool(ptr, def_val) return def_val; } -char *trim_line(ptr) - char *ptr; +char *trim_line(char *ptr) { register char *lastp; @@ -180,9 +171,7 @@ char *trim_line(ptr) return ptr; /* return lastp > ptr ? ptr : NULL; */ } -char **parse_strlist(ptr, sep_ch) - register char *ptr; - char sep_ch; +char **parse_strlist(register char *ptr, char sep_ch) { char *pbuf[100], **new, **bp; char *sep, *p; @@ -216,9 +205,7 @@ char **parse_strlist(ptr, sep_ch) } #ifdef unused -int pack_strlist(ptr, listp, sep_ch) - char *ptr, **listp; - char sep_ch; +int pack_strlist(char *ptr, char **listp, char sep_ch) { register char *bp = ptr, **lp = listp; @@ -240,8 +227,7 @@ int pack_strlist(ptr, listp, sep_ch) } #endif /* unused */ -void free_strlist(pp) - char **pp; +void free_strlist(char **pp) { register char **ptr = pp; @@ -253,9 +239,7 @@ void free_strlist(pp) /* ******** display string ******** */ -bool parse_dpy_str(display_str, host, dnum, snum, dnet) - char *display_str, **host; - int *dnum, *snum, *dnet; +bool parse_dpy_str(char *display_str, char **host, int *dnum, int *snum, int *dnet) { char buf[BUFSIZ], hostbuf[BUFSIZ], *p, *hp, *pdnum, *psnum; int isdnet = 0; @@ -301,9 +285,7 @@ bool parse_dpy_str(display_str, host, dnum, snum, dnet) return True; } -char *std_dpy_str(display_str, snum) - char *display_str; - int *snum; +char *std_dpy_str(char *display_str, int *snum) { char buf[BUFSIZ], *bp, val[20]; char *host = NULL; @@ -330,8 +312,7 @@ char *std_dpy_str(display_str, snum) /* ******** file & dir manipulation ******** */ -int make_user_dir(path) - char *path; +int make_user_dir(char *path) { if (!is_directory(path, False)) { if (access(path, F_OK) == 0) @@ -343,8 +324,7 @@ int make_user_dir(path) return True; } -char *dirname(path) - char *path; +char *dirname(char *path) { static char dname[MAXPATHLEN]; register char *p = path; @@ -371,9 +351,7 @@ char *dirname(path) } -int is_directory(path, must_writable) - char *path; - int must_writable; +int is_directory(char *path, int must_writable) { struct stat stb; int mode = R_OK|X_OK; @@ -384,15 +362,13 @@ int is_directory(path, must_writable) } #ifdef unused -int is_regularfile(path) - char *path; +int is_regularfile(char *path) { struct stat stb; return stat(path, &stb) == 0 && S_ISREG(stb.st_mode); } -int is_emptyfile(path) - char *path; +int is_emptyfile(char *path) { struct stat stb; return stat(path, &stb) == 0 && S_ISREG(stb.st_mode) && stb.st_size == 0; @@ -400,8 +376,7 @@ int is_emptyfile(path) #endif /* unused */ -int is_executable(path) - char *path; +int is_executable(char *path) { struct stat stb; return stat(path, &stb) == 0 && S_ISREG(stb.st_mode) @@ -409,8 +384,7 @@ int is_executable(path) } #ifdef unused -int is_writable(path) - char *path; +int is_writable(char *path) { if (access(path, R_OK|W_OK) == 0) return True; @@ -421,9 +395,7 @@ int is_writable(path) } #endif /* unused */ -int is_readable(path, allow_empty) - char *path; - int allow_empty; +int is_readable(char *path, int allow_empty) { struct stat stb; return stat(path, &stb) == 0 && S_ISREG(stb.st_mode) @@ -437,8 +409,7 @@ static int tag_line_num = 0; static char *tag_linebuf = NULL; static char *tag_file = NULL; -int start_tag_line(fname) - char *fname; +int start_tag_line(char *fname) { if (fname) { if (!tag_linebuf) @@ -453,9 +424,7 @@ int start_tag_line(fname) return True; } -int read_tag_line(fp, tagp, valp) - FILE *fp; - char **tagp, **valp; +int read_tag_line(FILE *fp, char **tagp, char **valp) { char *lp, *lp2; @@ -483,9 +452,7 @@ int read_tag_line(fp, tagp, valp) /* ******** put messages ******** */ -void put_xims_msg(msg_type, err_num, arg1, arg2, arg3) - int msg_type, err_num; - void *arg1, *arg2, *arg3; +void put_xims_msg(int msg_type, int err_num, void *arg1, void *arg2, void *arg3) { int ret = -2; char *msg; @@ -514,17 +481,13 @@ void put_xims_msg(msg_type, err_num, arg1, arg2, arg3) return; } -void put_xims_errmsg(err_num, arg1, arg2, arg3) - int err_num; - void *arg1, *arg2, *arg3; +void put_xims_errmsg(int err_num, void *arg1, void *arg2, void *arg3) { if (Verbose > 0) put_xims_msg(MSGTYP_FATAL, err_num, arg1, arg2, arg3); } -void put_xims_warnmsg(err_num, arg1, arg2, arg3) - int err_num; - void *arg1, *arg2, *arg3; +void put_xims_warnmsg(int err_num, void *arg1, void *arg2, void *arg3) { if (Verbose > 0) put_xims_msg(MSGTYP_WARN, err_num, arg1, arg2, arg3); @@ -533,18 +496,14 @@ void put_xims_warnmsg(err_num, arg1, arg2, arg3) #ifdef DEBUG /* for DPR*() macro */ -void print_msg(fmt, arg1, arg2, arg3, arg4, arg5) - char *fmt; - void *arg1, *arg2, *arg3, *arg4, *arg5; +void print_msg(char *fmt, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5) { fprintf(LogFp, fmt, arg1, arg2, arg3, arg4, arg5); } #endif -int put_xims_log(fmt, arg1, arg2, arg3) - char *fmt; - void *arg1, *arg2, *arg3; +int put_xims_log(char *fmt, void *arg1, void *arg2, void *arg3) { FILE *fp; char *logpath = Opt.LogPath; @@ -570,8 +529,7 @@ int put_xims_log(fmt, arg1, arg2, arg3) /* ******** clear structure ******** */ -void clear_ImsConf(ims) - ImsConf *ims; +void clear_ImsConf(ImsConf *ims) { FREE(ims->servername); FREE(ims->servername2); @@ -586,8 +544,7 @@ void clear_ImsConf(ims) CLR(ims, ImsConf); } -void clear_ImsEnt(ent) - ImsEnt *ent; +void clear_ImsEnt(ImsEnt *ent) { FREE(ent->name); FREE(ent->fname); @@ -599,8 +556,7 @@ void clear_ImsEnt(ent) CLR(ent, ImsEnt); } -void clear_ImsList(list) - ImsList *list; +void clear_ImsList(ImsList *list) { int i; @@ -616,8 +572,7 @@ void clear_ImsList(list) } -void clear_FileSel(fsel) - FileSel *fsel; +void clear_FileSel(FileSel *fsel) { FREE(fsel->name); FREE(fsel->hostname); @@ -640,8 +595,7 @@ void clear_FileSel(fsel) fsel->dpy_specific = False; } -void clear_UserSelection(sel) - UserSelection *sel; +void clear_UserSelection(UserSelection *sel) { FREE(sel->name); FREE(sel->hostname); @@ -666,8 +620,7 @@ void clear_UserSelection(sel) } -void clear_RunEnv(renv) - RunEnv *renv; +void clear_RunEnv(RunEnv *renv) { FREE(renv->im_mod); FREE(renv->atom_name); @@ -678,8 +631,7 @@ void clear_RunEnv(renv) } -void clear_OutEnv(oenv) - OutEnv *oenv; +void clear_OutEnv(OutEnv *oenv) { EnvEnt *ep; @@ -696,7 +648,7 @@ void clear_OutEnv(oenv) #ifdef unused -void clear_UserEnv() +void clear_UserEnv(void) { UserEnv *uenv = &userEnv; @@ -714,7 +666,7 @@ void clear_UserEnv() return; } -void clear_CmdConf() +void clear_CmdConf(void) { if (cmdconf_initialized) { CmdConf *conf = &Conf; @@ -775,17 +727,17 @@ void clear_CmdConf() return; } -void clear_WinEnv() +void clear_WinEnv(void) { CLR(&winEnv, WinEnv); } -void clear_CmdOpt() +void clear_CmdOpt(void) { CLR(&Opt, CmdOpt); } -void clear_All() +void clear_All(void) { UserSelection *sel = &userSel; @@ -815,8 +767,7 @@ void clear_All() /* ******** print structure (for DEBUG) ******** */ -void pr_FileSel(fsel) - FileSel *fsel; +void pr_FileSel(FileSel *fsel) { fprintf(LogFp, "FileSel:\tdpy_specific=%d real_fname=%s select_mode=%d\n", fsel->dpy_specific, fsel->real_fname, fsel->select_mode); @@ -831,8 +782,7 @@ void pr_FileSel(fsel) } } -void pr_UserSelection(sel) - UserSelection *sel; +void pr_UserSelection(UserSelection *sel) { fprintf(LogFp, "userSelection:\tstatus=%s flag=%#x ims_idx=%d\n", error_name(sel->status), sel->flag, sel->ims_idx); @@ -844,9 +794,7 @@ void pr_UserSelection(sel) if (sel->renv) pr_RunEnv(sel->renv); } -void pr_ImsConf(conf, ims_name) - ImsConf *conf; - char *ims_name; +void pr_ImsConf(ImsConf *conf, char *ims_name) { char **p; @@ -877,16 +825,13 @@ void pr_ImsConf(conf, ims_name) fputc('\n', LogFp); } -void pr_ImsEnt(ent, idx) - ImsEnt *ent; - int idx; +void pr_ImsEnt(ImsEnt *ent, int idx) { fprintf(LogFp, "ImsEnt[%d]:\tname=%s fname=%s label=%s ims=%#x\n", idx, ent->name, ent->fname, ent->label, ent->ims); } -void pr_ImsList(list) - ImsList *list; +void pr_ImsList(ImsList *list) { int i; ImsEnt *ent; @@ -900,8 +845,7 @@ void pr_ImsList(list) } } -void pr_WinEnv(wenv) - WinEnv *wenv; +void pr_WinEnv(WinEnv *wenv) { fprintf(LogFp, "WinEnv:\tstatus=%d Dpy=%#x topW=%#x appC=%#x\n", wenv->status, wenv->Dpy, wenv->TopW, wenv->appC); @@ -909,8 +853,7 @@ void pr_WinEnv(wenv) wenv->atom_owner, wenv->atom_main, wenv->atom_status, wenv->atom_data); } -void pr_RunEnv(renv) - RunEnv *renv; +void pr_RunEnv(RunEnv *renv) { fprintf(LogFp, "RunEnv:\tstatus=%s is_remote=%d proto=%d\n", error_name(renv->status), renv->is_remote, proto_name(renv->proto)); @@ -921,7 +864,7 @@ void pr_RunEnv(renv) } -void pr_UserEnv() +void pr_UserEnv(void) { UserEnv *uenv = &userEnv; @@ -936,8 +879,7 @@ void pr_UserEnv() fprintf(LogFp, "\tscreen_num=%d\n", uenv->screen_num); } -void pr_OutEnv(oenv) - OutEnv *oenv; +void pr_OutEnv(OutEnv *oenv) { EnvEnt *ep; @@ -956,7 +898,7 @@ void pr_OutEnv(oenv) } -void pr_CmdConf() +void pr_CmdConf(void) { int i; CmdConf *conf = &Conf; @@ -1034,7 +976,7 @@ void pr_CmdConf() # endif /* old_hpux */ } -void pr_CmdOpt() +void pr_CmdOpt(void) { fprintf(LogFp, "CmdOpt:\tDisplayName=%s LocaleName=%s ShellName=%s\n", Opt.DisplayName, Opt.LocaleName, Opt.ShellName); @@ -1048,7 +990,7 @@ void pr_CmdOpt() Opt.SelectMode, Opt.Timeout, Opt.Interval); } -void pr_OpModeFlag() +void pr_OpModeFlag(void) { char *name = ""; @@ -1107,7 +1049,7 @@ static char *StateNameTbl[] = { }; #define NumStates (sizeof(StateNameTbl) / sizeof(char *)) -char *StateName() +char *StateName(void) { return (OpState >= 0 && OpState < NumStates) ? StateNameTbl[OpState] : ""; @@ -1116,8 +1058,7 @@ char *StateName() /* ******** error name ******** */ -char *error_name(error) - ximsError error; +char *error_name(ximsError error) { char *name = ""; @@ -1196,8 +1137,7 @@ static char *_proto_names[NUM_PROTOCOLS] = { "None", "XIM", "Ximp", "Xsi" }; # endif /* old_hpux */ -char *proto_name(proto_idx) - int proto_idx; +char *proto_name(int proto_idx) { if (proto_idx >= 0 && proto_idx < NUM_PROTOCOLS) return _proto_names[proto_idx]; @@ -1214,15 +1154,13 @@ static char *SigNames[] = { /* 1 ~ 32 */ #define MaxSigNum (sizeof(SigNames) / sizeof(char *)) -char *sig_name(sig) - int sig; +char *sig_name(int sig) { return (sig > 0 && sig <= MaxSigNum) ? SigNames[sig - 1] : ""; } -void pr_brk(msg) - char *msg; +void pr_brk(char *msg) { static char *last_brk = 0; char *new_brk = (char *) sbrk(0); diff --git a/cde/programs/dtimsstart/win.c b/cde/programs/dtimsstart/win.c index 31d8948f..547c1f9f 100644 --- a/cde/programs/dtimsstart/win.c +++ b/cde/programs/dtimsstart/win.c @@ -175,7 +175,7 @@ static void xt_timer_cb(/* client_data, timer_id */); /* ******** window env ******** */ -int open_display() +int open_display(void) { if (Dpy) return NoError; /* already done */ @@ -188,7 +188,7 @@ int open_display() return NoError; } -void close_display() +void close_display(void) { if (TopW) return; /* Xt not finished */ @@ -199,12 +199,12 @@ void close_display() return; } -int window_env_ok() +int window_env_ok(void) { return winEnv.status != WIN_ST_NONE ? True : False; } -int init_window_env() +int init_window_env(void) { enum { XA_DTIMS_ATOM_MAIN, XA_DTIMS_ATOM_STATUS, XA_DTIMS_ATOM_DATA, NUM_ATOMS }; @@ -288,7 +288,7 @@ int init_window_env() return NoError; } -void end_window_env() +void end_window_env(void) { if (TopW) { disown_main_atom(XtWindow(TopW)); @@ -309,9 +309,8 @@ void end_window_env() /* return; */ } - -int clear_cmd_property(win) /* clear WM_COMMAND property */ - Window win; +/* clear WM_COMMAND property */ +int clear_cmd_property(Window win) { int ret, ac = 0; int clear_ok = False; @@ -331,9 +330,7 @@ int clear_cmd_property(win) /* clear WM_COMMAND property */ return clear_ok; } -static int ignoreBadWindow(dpy, error) - Display *dpy; - XErrorEvent *error; +static int ignoreBadWindow(Display *dpy, XErrorEvent *error) { if (error->error_code == BadWindow || error->error_code == BadDrawable) { return 0; @@ -343,9 +340,7 @@ static int ignoreBadWindow(dpy, error) } #ifdef unused -static void finish_window(w, end_window) - Widget *w; - int end_window; +static void finish_window(Widget *w, int end_window) { if (*w) { XtUnmapWidget(*w); @@ -361,8 +356,8 @@ static void finish_window(w, end_window) #endif /* unused */ -static int own_main_atom(win) /* own DTIMS_ATOM_MAIN */ - Window win; +/* own DTIMS_ATOM_MAIN */ +static int own_main_atom(Window win) { Window owner = None; @@ -383,8 +378,8 @@ static int own_main_atom(win) /* own DTIMS_ATOM_MAIN */ return winEnv.atom_owner == win ? True : False; } -static int disown_main_atom(win) /* disown DTIMS_ATOM_MAIN */ - Window win; +/* disown DTIMS_ATOM_MAIN */ +static int disown_main_atom(Window win) { if (winEnv.atom_main == None) return False; /* if (winEnv.atom_owner == None) return False; */ @@ -402,15 +397,14 @@ static int disown_main_atom(win) /* disown DTIMS_ATOM_MAIN */ static char *saved_xdefs = NULL; /* should not be freed */ -int save_RM() +int save_RM(void) { if (!Dpy) return False; saved_xdefs = XResourceManagerString(Dpy); return saved_xdefs ? True : False; } -int merge_RM(res1, res2) - char *res1, *res2; +int merge_RM(char *res1, char *res2) { char cmdbuf[BUFSIZ*2]; int ret; @@ -438,7 +432,7 @@ int merge_RM(res1, res2) return ret == 0 ? True : False; } -int restore_RM() +int restore_RM(void) { int len = saved_xdefs ? strlen(saved_xdefs) : 0; int max = (XMaxRequestSize(Dpy) << 2) - 28; @@ -490,8 +484,7 @@ static ImsList *curList = 0; static bool selection_changed = False; -static void free_ims_list(list) - ImsList *list; +static void free_ims_list(ImsList *list) { /* DPR(("free_ims_list(list=%p)\n", list)); */ if (list && list != localList && list != userSel.list) { @@ -500,7 +493,7 @@ static void free_ims_list(list) } } -static void clear_selection_var() +static void clear_selection_var(void) { free_ims_list(curList); curList = (ImsList *) 0; @@ -512,7 +505,7 @@ static void clear_selection_var() selection_changed = False; } -int start_selection_window() +int start_selection_window(void) { int ret = NoError; @@ -548,8 +541,7 @@ int start_selection_window() return NoError; } -static void finish_selection_window(end_window) - int end_window; +static void finish_selection_window(int end_window) { DPR(("finish_selection_window(end=%s)\n", end_window ? "True" : "False")); @@ -582,9 +574,7 @@ static void finish_selection_window(end_window) return; } -static void done_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void done_cb(Widget w, XtPointer client_data, XtPointer call_data) { int canceled = (int)(intptr_t) client_data == CANCEL_BTN; int idx; @@ -618,9 +608,7 @@ static void done_cb(w, client_data, call_data) ximsMain(); } -static void select_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void select_cb(Widget w, XtPointer client_data, XtPointer call_data) { int new_idx = (int)(intptr_t) client_data; @@ -635,22 +623,18 @@ static void select_cb(w, client_data, call_data) CurIdx = new_idx; } -static void host_btn_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void host_btn_cb(Widget w, XtPointer client_data, XtPointer call_data) { start_host_window(CurHost); } -static void help_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void help_cb(Widget w, XtPointer client_data, XtPointer call_data) { ximsHelp(HELP_SELECTION); } -static int create_selection_window() +static int create_selection_window(void) { Widget form, sel_rc, host_rc, cmd_rc, lb, sep; Widget w_tbl[8]; @@ -752,9 +736,7 @@ static int create_selection_window() } -static int change_host(new_host, host_type) - char *new_host; - int host_type; +static int change_host(char *new_host, int host_type) { int ret = NoError; ImsList *new_list = (ImsList *) 0; @@ -794,8 +776,7 @@ static int change_host(new_host, host_type) #define createPB XmCreatePushButton #define createTB XmCreateToggleButton -static void add_btn_trans(btn) - Widget btn; +static void add_btn_trans(Widget btn) { char btn_trans_str[] = "Return: ArmAndActivate()"; static XtTranslations btn_trans = 0; @@ -814,9 +795,7 @@ static void add_btn_trans(btn) # endif /* SelectByReturn */ -static void change_ims_list(last_ims_name, init_idx) - char *last_ims_name; - int init_idx; +static void change_ims_list(char *last_ims_name, int init_idx) { int idx; int i, j; @@ -880,9 +859,7 @@ static void change_ims_list(last_ims_name, init_idx) #undef IMS_OK } -static void set_host_label(host_type, hostname) - int host_type; - char *hostname; +static void set_host_label(int host_type, char *hostname) { static Widget lb_host = 0; @@ -914,10 +891,9 @@ static void set_host_label(host_type, hostname) } -static void add_cmd_btn(parent_rc, cb_ok, cb_clear, cb_cancel, cb_host, cb_help) - Widget parent_rc; - void (*cb_ok)(), (*cb_cancel)(), (*cb_clear)(), - (*cb_host)(), (*cb_help)(); +static void add_cmd_btn(Widget parent_rc, void (*cb_ok)(), + void (*cb_clear)(), void (*cb_cancel)(), + void (*cb_host)(), void (*cb_help)()) { Widget pb[4]; Arg args[12]; @@ -996,8 +972,7 @@ static void add_cmd_btn(parent_rc, cb_ok, cb_clear, cb_cancel, cb_host, cb_help) /* ***** host window ***** */ -static void start_host_window(cur_host) - char *cur_host; +static void start_host_window(char *cur_host) { int ret; @@ -1026,7 +1001,7 @@ static void start_host_window(cur_host) return; } -static void finish_host_window() +static void finish_host_window(void) { DPR(("finish_host_window()\n")); @@ -1037,9 +1012,7 @@ static void finish_host_window() } } -static void host_done_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void host_done_cb(Widget w, XtPointer client_data, XtPointer call_data) { int cancel = (int)(intptr_t) client_data == CANCEL_BTN; int ret = NoError; @@ -1120,25 +1093,18 @@ static void host_done_cb(w, client_data, call_data) #endif } -static void host_clear_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void host_clear_cb(Widget w, XtPointer client_data, XtPointer call_data) { /* if (!HostText) return; */ XtVaSetValues(HostText, XmNvalue, "", NULL); } -static void host_done_action(w, ev, args, num_args) - Widget w; - XEvent *ev; - String *args; - Cardinal *num_args; +static void host_done_action(Widget w, XEvent *ev, String *args, Cardinal *num_args) { host_done_cb(w, (XtPointer) OK_BTN, 0); } -static void create_host_window(cur_host) - char *cur_host; +static void create_host_window(char *cur_host) { Widget form, cmd_rc, lb1, sep, w_tbl[5]; Widget host_desc, host_rc, host_lb, host_txt; @@ -1233,8 +1199,7 @@ static void create_host_window(cur_host) static int OrgMode = SEL_MODE_NONE; static int CurMode = SEL_MODE_NONE; -int start_mode_window(cur_mode) - int cur_mode; +int start_mode_window(int cur_mode) { int ret; @@ -1263,8 +1228,7 @@ int start_mode_window(cur_mode) return NoError; } -static void finish_mode_window(end_window) - int end_window; +static void finish_mode_window(int end_window) { if (ModeW) { XtUnmanageChild(ModeW); @@ -1280,9 +1244,7 @@ static void finish_mode_window(end_window) return; } -static void mode_done_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void mode_done_cb(Widget w, XtPointer client_data, XtPointer call_data) { int ret = NoError; int canceled = (int)(intptr_t) client_data == CANCEL_BTN; @@ -1312,9 +1274,7 @@ static void mode_done_cb(w, client_data, call_data) /* never returns */ } -static void mode_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void mode_cb(Widget w, XtPointer client_data, XtPointer call_data) { int is_set = (int)((XmToggleButtonCallbackStruct *)call_data)->set; int is_auto = (int)(intptr_t) client_data; @@ -1322,15 +1282,12 @@ static void mode_cb(w, client_data, call_data) CurMode = (is_auto && is_set) ? SEL_MODE_AUTO : SEL_MODE_NOAUTO; } -static void mode_help_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void mode_help_cb(Widget w, XtPointer client_data, XtPointer call_data) { ximsHelp(HELP_MODE); } -static int create_mode_window(cur_mode) - int cur_mode; +static int create_mode_window(int cur_mode) { Widget form, mode_rc, cmd_rc, lb1, sep, w_tbl[8]; Arg args[16]; @@ -1415,14 +1372,12 @@ static int create_mode_window(cur_mode) /* ******** ximsHelp ******** */ -static void help_ok(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void help_ok(Widget w, XtPointer client_data, XtPointer call_data) { stop_help(); } -void stop_help() +void stop_help(void) { if (HelpW) { XtUnmanageChild(HelpW); @@ -1430,7 +1385,7 @@ void stop_help() } } -static void create_help() +static void create_help(void) { int i; Arg args[10]; @@ -1460,8 +1415,7 @@ static void create_help() return; } -void ximsHelp(help_type) - int help_type; +void ximsHelp(int help_type) { char *msg = NULL; XmString str; @@ -1509,9 +1463,7 @@ void ximsHelp(help_type) static int dialog_resp = XmCR_NONE; static bool in_confirmation = False; -static void dialog_resp_cb(w, client_data, call_data) - Widget w; - XtPointer client_data, call_data; +static void dialog_resp_cb(Widget w, XtPointer client_data, XtPointer call_data) { Widget msg_box = (Widget) client_data; XmAnyCallbackStruct *cbs = (XmAnyCallbackStruct *) call_data; @@ -1529,8 +1481,7 @@ static void dialog_resp_cb(w, client_data, call_data) } #ifdef unused -static int wait_confirmation(w) - Widget w; +static int wait_confirmation(Widget w) { XtAppContext context; @@ -1550,9 +1501,7 @@ static int wait_confirmation(w) } #endif /* unused */ -int put_msg_win(type, msg) - int type; - char *msg; +int put_msg_win(int type, char *msg) { int reply; Widget btn; @@ -1657,8 +1606,7 @@ int put_msg_win(type, msg) #define LOC_RIGHT (1<<3) #define LOC_MARGIN 5 -static int window_location(loc_str) - char *loc_str; +static int window_location(char *loc_str) { int locate_type = LOC_CENTER; char *lower_str, *p; @@ -1676,8 +1624,7 @@ static int window_location(loc_str) return locate_type; } -static void locate_window(w) - Widget w; +static void locate_window(Widget w) { int scr; int x, y; @@ -1718,9 +1665,7 @@ static void locate_window(w) /* ******** cursor (normal / wait) ******** */ -static void set_cursor(w, is_wait) - Widget w; - int is_wait; +static void set_cursor(Widget w, int is_wait) { static Cursor cursors[2] = { None, None }; int idx; @@ -1738,7 +1683,7 @@ static void set_cursor(w, is_wait) /* ***** waiting functions ***** */ -void xevent_loop() +void xevent_loop(void) { if (appC) XtAppMainLoop(appC); @@ -1748,7 +1693,7 @@ static time_t xt_start_tm = 0L; /* in sec */ static XtIntervalId xt_last_timer = (XtIntervalId)0; static bool xt_waiting = False; -void xt_start_waiting() +void xt_start_waiting(void) { if (!appC) return; @@ -1763,7 +1708,7 @@ void xt_start_waiting() XtAppMainLoop(appC); } -void xt_stop_waiting() +void xt_stop_waiting(void) { if (xt_last_timer) { XtRemoveTimeOut(xt_last_timer); @@ -1774,9 +1719,7 @@ void xt_stop_waiting() ximsWaitDone(); } -static void xt_timer_cb(client_data, timer_id) - XtPointer client_data; - XtIntervalId *timer_id; +static void xt_timer_cb(XtPointer client_data, XtIntervalId *timer_id) { int lapse; diff --git a/cde/programs/dtimsstart/ximsfunc.h b/cde/programs/dtimsstart/ximsfunc.h index aafac1ea..1dd791f7 100644 --- a/cde/programs/dtimsstart/ximsfunc.h +++ b/cde/programs/dtimsstart/ximsfunc.h @@ -125,9 +125,9 @@ extern char *strcpyx(/* dest, src */); extern char *strcpy2(/* dest, src1, src2 */); extern char *newstradded(/* src1, src2, src3 */); extern int str_to_int(/* ptr, val */); -extern bool str_to_bool(/* ptr, def_val */); +extern bool str_to_bool(char *ptr, bool def_val); extern char *trim_line(/* ptr */); -extern char **parse_strlist(/* ptr, sep_ch */); +extern char **parse_strlist(register char *ptr, char sep_ch); extern int pack_strlist(/* ptr, listp, sep_ch */); extern void free_strlist(/* pp */); extern bool parse_dpy_str(/* display_str, host, dnum, snum, dnet */);