1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtimsstart: Change to ANSI function definitions

This commit is contained in:
Peter Howkins 2018-06-28 04:19:15 +01:00
parent 94f78da5df
commit 1c545e12d2
10 changed files with 232 additions and 491 deletions

View file

@ -42,14 +42,13 @@ static DtActionInvocationID actionId = 0;
/* ***** DtAction functions ***** */ /* ***** DtAction functions ***** */
static void DbReloadProc(cd) static void DbReloadProc(XtPointer cd)
XtPointer cd;
{ {
DPR(("DbReloadProc(): action database updated\n")); DPR(("DbReloadProc(): action database updated\n"));
DtDbLoad(); /* Pick up any dynamic changes to the database files */ DtDbLoad(); /* Pick up any dynamic changes to the database files */
} }
static bool init_action_env() static bool init_action_env(void)
{ {
init_window_env(); init_window_env();
@ -68,12 +67,8 @@ static bool init_action_env()
return actionEnabled; return actionEnabled;
} }
static void action_cb(id, cd, args, argcnt, status) static void action_cb(long unsigned id, XtPointer cd /* unused */,
long unsigned id; DtActionArg *args, int argcnt, DtActionStatus status)
XtPointer cd; /* unused */
DtActionArg *args;
int argcnt;
DtActionStatus status;
{ {
if (actionId == 0) { if (actionId == 0) {
DPR(("action_cb(): invalid id %d != %d\n", id, actionId)); 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; XEvent event;
@ -157,9 +152,7 @@ static void wait_action_done()
return; return;
} }
int invoke_action(action, host) int invoke_action(char *action, char *host)
char *action;
char *host;
{ {
if (init_action_env() != True) return ErrInternal; if (init_action_env() != True) return ErrInternal;
@ -188,8 +181,7 @@ int invoke_action(action, host)
} }
void send_dtims_msg(msg, errcode) void send_dtims_msg(int msg, int errcode)
int msg, errcode;
{ {
XEvent ev; XEvent ev;
@ -204,11 +196,8 @@ void send_dtims_msg(msg, errcode)
XSendEvent(Dpy, XtWindow(TopW), False, NoEventMask, &ev); XSendEvent(Dpy, XtWindow(TopW), False, NoEventMask, &ev);
} }
void dtims_msg_proc(w, cd, event, continue_dispatch) void dtims_msg_proc(Widget w, XtPointer cd, XEvent *event,
Widget w; Boolean *continue_dispatch /* never changed */)
XtPointer cd;
XEvent *event;
Boolean *continue_dispatch; /* never changed */
{ {
XClientMessageEvent *ev = &event->xclient; XClientMessageEvent *ev = &event->xclient;
int msg, errcode; int msg, errcode;

View file

@ -36,7 +36,7 @@ typedef enum {
/* local func */ /* local func */
static int shell_type(/* shell */); static int shell_type(/* shell */);
int set_cmd_env() int set_cmd_env(void)
{ {
int ret = NoError; int ret = NoError;
char **aliases = (char **)0; char **aliases = (char **)0;
@ -63,7 +63,7 @@ int set_cmd_env()
} }
int get_user_environ() int get_user_environ(void)
{ {
int ret = NoError; int ret = NoError;
char buf[BUFSIZ], *p; char buf[BUFSIZ], *p;
@ -138,10 +138,7 @@ int get_user_environ()
} }
int expand_string(in_str, out_str, out_len, ims) int expand_string(char *in_str, char *out_str, int out_len, ImsConf *ims)
char *in_str, *out_str;
int out_len;
ImsConf *ims;
{ {
register char *p, *q, *ep; register char *p, *q, *ep;
char str[20]; char str[20];
@ -220,8 +217,7 @@ int expand_string(in_str, out_str, out_len, ims)
} }
static int shell_type(shell) static int shell_type(char *shell)
char *shell;
{ {
char *p; char *p;
int len; int len;
@ -245,9 +241,7 @@ static int shell_type(shell)
} }
int make_new_environ(oenv, sel) int make_new_environ(OutEnv *oenv, UserSelection *sel)
OutEnv *oenv;
UserSelection *sel;
{ {
ImsConf *ims; ImsConf *ims;
EnvEnt *ep, *ep2; EnvEnt *ep, *ep2;
@ -362,8 +356,8 @@ int make_new_environ(oenv, sel)
return NoError; return NoError;
} }
int put_new_environ(oenv) /* print modified environment variables */ /* print modified environment variables */
OutEnv *oenv; int put_new_environ(OutEnv *oenv)
{ {
EnvEnt *ep; EnvEnt *ep;
char tmpbuf[BUFSIZ], *bp, *vp; 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) int set_remote_env(char *ptr, char *env_pass)
char *ptr, *env_pass;
{ {
char *bp = ptr, *ep; char *bp = ptr, *ep;
char **ls, **ls2, **pp, **pp2; char **ls, **ls2, **pp, **pp2;
@ -477,8 +470,7 @@ int set_remote_env(ptr, env_pass)
} }
# ifdef old_hpux # ifdef old_hpux
char *xhp_xinput_name(locale) char *xhp_xinput_name(char *locale)
char *locale;
{ {
char *xinput_name = "X@INPUT"; char *xinput_name = "X@INPUT";
char **pp, *p; char **pp, *p;
@ -513,8 +505,7 @@ char *xhp_xinput_name(locale)
} }
char *get_real_locale(locale, aliases) char *get_real_locale(char *locale, char ***aliases)
char *locale, ***aliases;
{ {
int i; int i;
int match_idx = -1; int match_idx = -1;

View file

@ -27,7 +27,7 @@
#include <sys/stat.h> #include <sys/stat.h>
/* local func */ /* 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_ims_conf(/* fp, sel */);
static void put_select_mode(/* fp, select_mode */); static void put_select_mode(/* fp, select_mode */);
static void put_selection_header(/* fp */); static void put_selection_header(/* fp */);
@ -38,7 +38,7 @@ static char *SelectFileFormat = NULL;
static bool cmdconf_initialized = False; static bool cmdconf_initialized = False;
int create_xims_dir() int create_xims_dir(void)
{ {
int ret = NoError; int ret = NoError;
char path[MAXPATHLEN]; char path[MAXPATHLEN];
@ -77,9 +77,7 @@ int create_xims_dir()
return ret; return ret;
} }
int init_log_file(org_path, check_size) int init_log_file(char *org_path, int check_size)
char *org_path;
int check_size;
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
bool log_exists = False; bool log_exists = False;
@ -124,8 +122,7 @@ _err:
} }
int set_errorlog(path) int set_errorlog(char *path)
char *path;
{ {
int fd; int fd;
@ -146,7 +143,7 @@ int set_errorlog(path)
} }
int read_cmd_conf() int read_cmd_conf(void)
{ {
char buf[MAXPATHLEN]; char buf[MAXPATHLEN];
CmdConf *conf = &Conf; CmdConf *conf = &Conf;
@ -377,7 +374,7 @@ _default:
return NoError; return NoError;
} }
int expand_cmd_conf() int expand_cmd_conf(void)
{ {
char **pp[20 + NUM_ACTIONS], *p, buf[BUFSIZ]; char **pp[20 + NUM_ACTIONS], *p, buf[BUFSIZ];
int i, j, n; int i, j, n;
@ -434,9 +431,7 @@ int expand_cmd_conf()
} }
int read_imsconf(conf, ims_name, ims_fname) int read_imsconf(ImsConf *conf, char *ims_name, char *ims_fname)
ImsConf *conf;
char *ims_name, *ims_fname;
{ {
int ret = NoError; int ret = NoError;
char path[MAXPATHLEN]; char path[MAXPATHLEN];
@ -533,9 +528,7 @@ int read_imsconf(conf, ims_name, ims_fname)
return ret; return ret;
} }
int check_ims_conf(ims, ims_name) int check_ims_conf(ImsConf *ims, char *ims_name)
ImsConf *ims;
char *ims_name;
{ {
int ret = NoError; int ret = NoError;
char *missing_entry = NULL; char *missing_entry = NULL;
@ -570,9 +563,7 @@ int check_ims_conf(ims, ims_name)
return ret; return ret;
} }
int read_localeconf(list, locale_name) int read_localeconf(ImsList *list, char *locale_name)
ImsList *list;
char *locale_name;
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
char *lp, *valp, *pp; char *lp, *valp, *pp;
@ -669,9 +660,7 @@ int read_localeconf(list, locale_name)
return list->status; return list->status;
} }
int read_user_selection(fselp, locale_name) int read_user_selection(FileSel **fselp, char *locale_name)
FileSel **fselp;
char *locale_name;
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
int ret; int ret;
@ -702,9 +691,7 @@ int read_user_selection(fselp, locale_name)
return NoError; return NoError;
} }
int read_selection_file(fsel, fp) int read_selection_file(FileSel *fsel, FILE *fp)
FileSel *fsel;
FILE *fp;
{ {
char *lp, *valp, *vp, *p; char *lp, *valp, *vp, *p;
int i, nopts, line_num; int i, nopts, line_num;
@ -789,9 +776,7 @@ int read_selection_file(fsel, fp)
return NoError; return NoError;
} }
int save_user_selection(sel, locale_name) int save_user_selection(UserSelection *sel, char *locale_name)
UserSelection *sel;
char *locale_name;
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
int dpy_specific; int dpy_specific;
@ -825,11 +810,7 @@ int save_user_selection(sel, locale_name)
#define _IMSOPTION 4 #define _IMSOPTION 4
#define _IMSOPT2 5 #define _IMSOPT2 5
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)
FILE *fp;
int ent_type;
bool is_valid;
char *val, *val2;
{ {
char *name = NULL; 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) static void put_ims_conf(FILE *fp, UserSelection *sel)
FILE *fp;
UserSelection *sel;
{ {
char *valp, val[20]; char *valp, val[20];
@ -891,9 +870,7 @@ static void put_ims_conf(fp, sel)
} }
} }
static void put_select_mode(fp, select_mode) static void put_select_mode(FILE *fp, int select_mode)
FILE *fp;
int select_mode;
{ {
char val[20]; char val[20];
if (select_mode != SEL_MODE_NOAUTO && select_mode != SEL_MODE_AUTO 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) static void put_selection_header(FILE *fp)
FILE *fp;
{ {
fprintf(fp, "%s %s\n", COMMENT_CHARS, ProgramRevision); fprintf(fp, "%s %s\n", COMMENT_CHARS, ProgramRevision);
if (SelectFileFormat) if (SelectFileFormat)
fprintf(fp, "%s%s\n", COMMENT_CHARS, SelectFileFormat); fprintf(fp, "%s%s\n", COMMENT_CHARS, SelectFileFormat);
} }
static void put_selection_sep(fp) static void put_selection_sep(FILE *fp)
FILE *fp;
{ {
fprintf(fp, "%s\n", COMMENT_CHARS); fprintf(fp, "%s\n", COMMENT_CHARS);
} }
int get_select_mode() int get_select_mode(void)
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
char *lp, *valp; char *lp, *valp;
@ -957,8 +932,7 @@ int get_select_mode()
return select_mode; return select_mode;
} }
int set_select_mode(cur_mode, new_mode) int set_select_mode(int cur_mode, int new_mode)
int cur_mode, new_mode;
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
int dpy_specific; int dpy_specific;
@ -1055,9 +1029,7 @@ int set_select_mode(cur_mode, new_mode)
return NoError; return NoError;
} }
static int user_selection_fname(buf, buf_len, dpy_specific) static int user_selection_fname(char *buf, int buf_len, int dpy_specific)
char *buf;
int buf_len, dpy_specific;
{ {
int len; int len;
UserEnv *uenv = &userEnv; UserEnv *uenv = &userEnv;
@ -1125,8 +1097,7 @@ static int user_selection_fname(buf, buf_len, dpy_specific)
} }
int parse_protolist(valp) int parse_protolist(char *valp)
char *valp;
{ {
int proto_bits = 0; int proto_bits = 0;
@ -1140,8 +1111,7 @@ int parse_protolist(valp)
return proto_bits; return proto_bits;
} }
int default_protocol(conf) int default_protocol(ImsConf *conf)
ImsConf *conf;
{ {
if (conf->protocols & ProtoBit(Proto_XIM)) return Proto_XIM; if (conf->protocols & ProtoBit(Proto_XIM)) return Proto_XIM;
else if (conf->protocols & ProtoBit(Proto_Ximp)) return Proto_Ximp; else if (conf->protocols & ProtoBit(Proto_Ximp)) return Proto_Ximp;

View file

@ -75,9 +75,7 @@ static int exitSignalNumber = 0;
static bool do_usage = False; static bool do_usage = False;
main (argc, argv) int main (int argc, char **argv)
int argc;
char **argv;
{ {
int ret = NoError; int ret = NoError;
int ret2; int ret2;
@ -149,8 +147,7 @@ main (argc, argv)
} }
void sigExit(sig) void sigExit(int sig)
int sig;
{ {
DPR(("sigExit: %s (%d)\n", sig_name(sig), sig)); DPR(("sigExit: %s (%d)\n", sig_name(sig), sig));
signal(sig, SIG_IGN); signal(sig, SIG_IGN);
@ -158,8 +155,7 @@ void sigExit(sig)
Exit(ErrSignaled); Exit(ErrSignaled);
} }
void Exit(err_code) void Exit(int err_code)
int err_code;
{ {
int exit_code = IsNoError(err_code) ? 0 : 1; int exit_code = IsNoError(err_code) ? 0 : 1;
@ -186,8 +182,7 @@ void Exit(err_code)
exit(exit_code); exit(exit_code);
} }
int NotifyErrCode(err_code) int NotifyErrCode(int err_code)
int err_code;
{ {
char buf[BUFSIZ], *bp, val[20]; char buf[BUFSIZ], *bp, val[20];
static bool notify_done = False; static bool notify_done = False;
@ -229,8 +224,7 @@ int NotifyErrCode(err_code)
} }
static int IsNoError(error) static int IsNoError(ximsError error)
ximsError error;
{ {
switch (error) { switch (error) {
case NoError: case ErrIsNone: case ErrNotRun: case NoError: case ErrIsNone: case ErrNotRun:
@ -244,8 +238,7 @@ static int IsNoError(error)
return False; return False;
} }
static int EnvNeeded(error) static int EnvNeeded(ximsError error)
ximsError error;
{ {
switch (error) { switch (error) {
case NoError: case ErrIsNone: case ErrNotRun: case NoError: case ErrIsNone: case ErrNotRun:
@ -258,8 +251,7 @@ static int EnvNeeded(error)
return False; return False;
} }
static int ErrMsgDisabled(error) static int ErrMsgDisabled(ximsError error)
ximsError error;
{ {
switch (error) { switch (error) {
case NoError: case ErrIsNone: case ErrNotRun: case NoError: case ErrIsNone: case ErrNotRun:
@ -274,8 +266,7 @@ static int ErrMsgDisabled(error)
return False; return False;
} }
int ErrFilePathNeeded(error) int ErrFilePathNeeded(ximsError error)
ximsError error;
{ {
switch (error) { switch (error) {
case ErrFileOpen: case ErrFileCreate: case ErrDirCreate: case ErrFileOpen: case ErrFileCreate: case ErrDirCreate:
@ -286,7 +277,7 @@ int ErrFilePathNeeded(error)
return False; return False;
} }
int InWaitingState() int InWaitingState(void)
{ {
switch (OpState) { switch (OpState) {
case State_Init_Err: case State_Init_Err:
@ -297,7 +288,7 @@ int InWaitingState()
return False; return False;
} }
void ximsMain() void ximsMain(void)
{ {
static int call_cnt = 0; static int call_cnt = 0;
@ -366,7 +357,7 @@ void ximsMain()
} }
void ximsFinish() void ximsFinish(void)
{ {
OpStateVal oldOpState = OpState; OpStateVal oldOpState = OpState;
@ -408,7 +399,7 @@ void ximsFinish()
} }
static int ximsShowImsList() static int ximsShowImsList(void)
{ {
int ret; int ret;
int i; int i;
@ -491,7 +482,7 @@ static int ximsShowImsList()
return NoError; return NoError;
} }
static int ximsShowCurrentIms() static int ximsShowCurrentIms(void)
{ {
int ret = NoError; int ret = NoError;
FileSel *fsel; FileSel *fsel;
@ -520,8 +511,7 @@ static int ximsShowCurrentIms()
} }
static int prepare_remote(win_st) static int prepare_remote(int win_st)
int win_st;
{ {
int ret; int ret;
char **av = NULL; char **av = NULL;
@ -565,7 +555,7 @@ static int prepare_remote(win_st)
return NoError; return NoError;
} }
static int ximsRemoteConf() static int ximsRemoteConf(void)
{ {
int ret; int ret;
char *locale; char *locale;
@ -583,7 +573,7 @@ static int ximsRemoteConf()
} }
static int ximsSetMode() static int ximsSetMode(void)
{ {
int ret = NoError; int ret = NoError;
int cur_mode = SEL_MODE_NONE; int cur_mode = SEL_MODE_NONE;
@ -622,8 +612,7 @@ static int ximsSetMode()
return ret; return ret;
} }
static void show_select_mode(mode) static void show_select_mode(int mode)
int mode;
{ {
char *valp; char *valp;
@ -652,8 +641,7 @@ static void show_select_mode(mode)
} }
static int set_locale_env(locale) static int set_locale_env(char *locale)
char *locale;
{ {
char *env_name, *env_value, *bp, *vp, buf[BUFSIZ], buf2[BUFSIZ]; char *env_name, *env_value, *bp, *vp, buf[BUFSIZ], buf2[BUFSIZ];
static char *last_lang_env[2] = { NULL, NULL }; static char *last_lang_env[2] = { NULL, NULL };
@ -729,8 +717,7 @@ static int set_locale_env(locale)
return NoError; return NoError;
} }
static void init_command(progname) static void init_command(char *progname)
char *progname;
{ {
/* globals */ /* globals */
ProgramName = progname; ProgramName = progname;
@ -775,9 +762,7 @@ static void init_command(progname)
} }
static bool optname_match(name, str, minlen) static bool optname_match(char *name, char *str, int minlen)
char *name, *str;
int minlen;
{ {
int nlen, slen; int nlen, slen;
@ -790,9 +775,7 @@ static bool optname_match(name, str, minlen)
return False; return False;
} }
static int parse_options(argc, argv) static int parse_options(int argc, char **argv)
int argc;
char **argv;
{ {
char *opt; char *opt;
int i, n; int i, n;
@ -1118,8 +1101,7 @@ static OptDesc opts_internal[] = {
}; };
#endif /* DEBUG */ #endif /* DEBUG */
static void usage(force) static void usage(int force)
int force;
{ {
char *fmt = "\t%-20s%s\n"; char *fmt = "\t%-20s%s\n";
@ -1167,9 +1149,7 @@ static void usage(force)
/* ******** error messages ******** */ /* ******** error messages ******** */
char *xims_errmsg(err_num, arg1, arg2, arg3) char *xims_errmsg(int err_num, void *arg1, void *arg2, void *arg3)
int err_num;
void *arg1, *arg2, *arg3;
{ {
char *fmt = NULL, *bp; char *fmt = NULL, *bp;
int len; int len;

View file

@ -149,8 +149,7 @@ strcasecmp(register const char *s1,
} }
#endif #endif
int put_remote_conf(locale, ims_name) int put_remote_conf(char *locale, char *ims_name)
char *locale, *ims_name;
{ {
int ret; int ret;
int msg_status = NoError; int msg_status = NoError;
@ -182,9 +181,7 @@ int put_remote_conf(locale, ims_name)
return ret; return ret;
} }
int get_remote_conf(listp, hostname, locale, ims_name) int get_remote_conf(ImsList **listp, char *hostname, char *locale, char *ims_name)
ImsList **listp;
char *hostname, *locale, *ims_name;
{ {
int ret = NoError; int ret = NoError;
int conflen = 0; 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)), \ #define PUT_DATA(nm, val) *bp++ = ' ', bp = strcpyx(bp, (nm)), \
*bp++ = '=', bp = strcpyx(bp, (val)), *bp++ = '\n' *bp++ = '=', bp = strcpyx(bp, (val)), *bp++ = '\n'
static int mk_remote_conf(list, locale, ims_name, status, confbuf, conflen) static int mk_remote_conf(ImsList *list, char *locale,
ImsList *list; char *ims_name, int status,
int status; char *confbuf, int *conflen)
char *locale, *ims_name, *confbuf;
int *conflen;
{ {
int num_ent; int num_ent;
int i, j; int i, j;
@ -332,10 +327,7 @@ static int mk_remote_conf(list, locale, ims_name, status, confbuf, conflen)
return NoError; return NoError;
} }
static char *mk_ims_ent(bp, idx, ent) static char *mk_ims_ent(register char *bp, int idx, ImsEnt *ent)
ImsEnt *ent;
int idx;
register char *bp;
{ {
ImsConf *ims = ent->ims; ImsConf *ims = ent->ims;
char val[20]; char val[20];
@ -375,9 +367,7 @@ static char *mk_ims_ent(bp, idx, ent)
#undef PUT_DATA #undef PUT_DATA
static int parse_ims_list(ptr, list) static int parse_ims_list(char *ptr, ImsList *list)
char *ptr;
ImsList *list;
{ {
register char *bp = ptr; register char *bp = ptr;
char *np, *vp; char *np, *vp;
@ -483,10 +473,7 @@ static int parse_ims_list(ptr, list)
} }
static int parse_remote_conf(listp, locale, confbuf, conflen) static int parse_remote_conf(ImsList **listp, char *locale, char *confbuf, int conflen)
ImsList **listp;
char *locale, *confbuf;
int conflen;
{ {
int ret = NoError; int ret = NoError;
char *bp = confbuf; char *bp = confbuf;
@ -545,8 +532,7 @@ static int parse_remote_conf(listp, locale, confbuf, conflen)
} }
int exec_remote_ims(sel) int exec_remote_ims(UserSelection *sel)
UserSelection *sel;
{ {
int ret = NoError; int ret = NoError;
int n, num_opts, binc; int n, num_opts, binc;
@ -636,8 +622,7 @@ int exec_remote_ims(sel)
} }
int check_hostname(hostname) int check_hostname(char *hostname)
char *hostname;
{ {
int host_type = HOST_UNKNOWN; int host_type = HOST_UNKNOWN;
char *local = userEnv.hostname; char *local = userEnv.hostname;
@ -681,9 +666,7 @@ int check_hostname(hostname)
int set_remote_confdata(confbuf, conflen) int set_remote_confdata(char *confbuf, int conflen)
char *confbuf;
int conflen;
{ {
char *av[2]; char *av[2];
@ -692,9 +675,7 @@ int set_remote_confdata(confbuf, conflen)
return set_window_data(1, av); return set_window_data(1, av);
} }
int read_remote_confdata(confbuf, conflen) int read_remote_confdata(char **confbuf, int *conflen)
char **confbuf;
int *conflen;
{ {
char **av = NULL; char **av = NULL;
int ac = 0; int ac = 0;
@ -710,10 +691,7 @@ int read_remote_confdata(confbuf, conflen)
} }
static int prepare_action(act_typ, av, ac) static int prepare_action(int act_typ, char **av, int ac)
int act_typ;
char **av;
int ac;
{ {
int ret; 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; long *datap;
int len = 0; int len = 0;
@ -762,8 +740,7 @@ int get_window_status()
return win_st; return win_st;
} }
int change_window_status(status) int change_window_status(int status)
int status;
{ {
if (winEnv.atom_status == None || winEnv.atom_owner == None) if (winEnv.atom_status == None || winEnv.atom_owner == None)
return ErrInternal; return ErrInternal;
@ -780,9 +757,7 @@ int change_window_status(status)
return NoError; return NoError;
} }
int set_window_data(ac, av) int set_window_data(int ac, char **av)
int ac;
char **av;
{ {
register int i; register int i;
register int nbytes; register int nbytes;
@ -823,9 +798,7 @@ int set_window_data(ac, av)
} }
int get_window_data(acp, avp) int get_window_data(int *acp, char ***avp)
int *acp;
char ***avp;
{ {
int ac; int ac;
char *data; char *data;
@ -878,13 +851,9 @@ int get_window_data(acp, avp)
} }
static int read_property(prop, type, format, del_flag, datapp, lenp) static int read_property(Atom prop, Atom type, int format,
Atom prop; int del_flag, unsigned char **datapp,
Atom type; unsigned long *lenp)
int format;
int del_flag;
unsigned char **datapp;
unsigned long *lenp;
{ {
Atom realtype; Atom realtype;
int realformat; int realformat;

View file

@ -30,7 +30,7 @@ static int setup_remote_selection(/* sel */);
static int setup_user_selection(/* sel, list, idx */); static int setup_user_selection(/* sel, list, idx */);
void ximsSelect() void ximsSelect(void)
{ {
int ret; int ret;
bool use_win; bool use_win;
@ -166,9 +166,7 @@ void ximsSelect()
} }
static int fill_ims_ent(list, top, last) static int fill_ims_ent(ImsList *list, int top, int last)
ImsList *list;
int top, last;
{ {
int ret; int ret;
int i; int i;
@ -199,10 +197,7 @@ static int fill_ims_ent(list, top, last)
} }
static int setup_local_selection(sel, list, conf_all) static int setup_local_selection(UserSelection *sel, ImsList *list, int conf_all)
UserSelection *sel;
ImsList *list;
int conf_all;
{ {
int ret; int ret;
int idx, top, last; int idx, top, last;
@ -218,8 +213,7 @@ static int setup_local_selection(sel, list, conf_all)
return ret; return ret;
} }
static int setup_remote_selection(sel) static int setup_remote_selection(UserSelection *sel)
UserSelection *sel;
{ {
int ret; int ret;
int idx; int idx;
@ -235,10 +229,7 @@ static int setup_remote_selection(sel)
return ret; return ret;
} }
static int setup_user_selection(sel, list, idx) static int setup_user_selection(UserSelection *sel, ImsList *list, int idx)
UserSelection *sel;
ImsList *list;
int idx;
{ {
if (sel->name) { if (sel->name) {
if (idx >= 0) { if (idx >= 0) {
@ -256,12 +247,7 @@ static int setup_user_selection(sel, list, idx)
return sel->status; return sel->status;
} }
int update_user_selection(sel, list, idx, host, host_type) int update_user_selection(UserSelection *sel, ImsList *list, int idx, char *host, int host_type)
UserSelection *sel;
ImsList *list;
int idx;
char *host;
int host_type;
{ {
ImsEnt *ent; ImsEnt *ent;
@ -292,9 +278,7 @@ int update_user_selection(sel, list, idx, host, host_type)
} }
int get_ims_idx(list, name) int get_ims_idx(ImsList *list, char *name)
ImsList *list;
char *name;
{ {
int idx; int idx;
@ -306,8 +290,7 @@ int get_ims_idx(list, name)
return -1; return -1;
} }
int set_ims_status(ent) int set_ims_status(ImsEnt *ent)
ImsEnt *ent;
{ {
int ret = NoError; int ret = NoError;
ImsConf *ims = ent->ims; ImsConf *ims = ent->ims;
@ -328,10 +311,7 @@ int set_ims_status(ent)
} }
int get_ims_list(listp, locale, fill_ent) int get_ims_list(ImsList **listp, char *locale, int fill_ent)
ImsList **listp;
char *locale;
int fill_ent;
{ {
int ret = NoError; int ret = NoError;
ImsList *list; ImsList *list;

View file

@ -55,7 +55,7 @@ static int create_dummy_ic(/* xim */);
# endif /* old_hpux */ # endif /* old_hpux */
void ximsStart() void ximsStart(void)
{ {
int ret; int ret;
UserSelection *sel = &userSel; UserSelection *sel = &userSel;
@ -118,7 +118,7 @@ void ximsStart()
} }
void ximsWait() void ximsWait(void)
{ {
OpStateVal oldOpState = OpState; OpStateVal oldOpState = OpState;
UserSelection *sel = &userSel; UserSelection *sel = &userSel;
@ -169,7 +169,7 @@ void ximsWait()
} }
void ximsWaitDone() void ximsWaitDone(void)
{ {
int ret; int ret;
UserSelection *sel = &userSel; UserSelection *sel = &userSel;
@ -224,20 +224,18 @@ void ximsWaitDone()
ximsMain(); ximsMain();
} }
int is_waiting() int is_waiting(void)
{ {
return userSel.renv && userSel.renv->status == ErrImsWaiting; return userSel.renv && userSel.renv->status == ErrImsWaiting;
} }
void set_sig_chld(enable) void set_sig_chld(int enable)
int enable;
{ {
DPR(("set_sig_chld(%s)\n", enable ? "Enabled" : "Disabled")); DPR(("set_sig_chld(%s)\n", enable ? "Enabled" : "Disabled"));
signal(SIGCHLD, enable ? on_sig_chld : SIG_IGN); signal(SIGCHLD, enable ? on_sig_chld : SIG_IGN);
} }
int im_mod_available(renv) int im_mod_available(RunEnv *renv)
RunEnv *renv;
{ {
Window owner; Window owner;
@ -283,9 +281,7 @@ int im_mod_available(renv)
/* ***** IMS options ***** */ /* ***** IMS options ***** */
int mk_ims_option(ptr, sel) int mk_ims_option(char *ptr, UserSelection *sel)
char *ptr;
UserSelection *sel;
{ {
char *bp = ptr; char *bp = ptr;
FileSel *fsel = sel->fsel; FileSel *fsel = sel->fsel;
@ -326,8 +322,7 @@ int mk_ims_option(ptr, sel)
return (int) (bp - ptr); return (int) (bp - ptr);
} }
static int check_ims_opt(ptr) static int check_ims_opt(char *ptr)
char *ptr;
{ {
/* option string must not contain any of shell's metacaharacters */ /* option string must not contain any of shell's metacaharacters */
if (strpbrk(ptr, "`'\"#;&()|<>\n")) { if (strpbrk(ptr, "`'\"#;&()|<>\n")) {
@ -346,7 +341,7 @@ static int check_ims_opt(ptr)
static bool resource_loaded = False; static bool resource_loaded = False;
int load_resources() int load_resources(void)
{ {
int ret; int ret;
int empty; int empty;
@ -395,7 +390,7 @@ int load_resources()
return ret; return ret;
} }
int restore_resources() int restore_resources(void)
{ {
if (!resource_loaded) { if (!resource_loaded) {
DPR2(("restore_resources: not loaded yet -- not restored\n")); DPR2(("restore_resources: not loaded yet -- not restored\n"));
@ -405,8 +400,7 @@ int restore_resources()
return restore_RM(); return restore_RM();
} }
static char *find_session_resfile(res_type) static char *find_session_resfile(int res_type)
int res_type;
{ {
char path[MAXPATHLEN]; char path[MAXPATHLEN];
char **ls = (char **) 0, **pp; char **ls = (char **) 0, **pp;
@ -449,8 +443,7 @@ static char *find_session_resfile(res_type)
/* ***** local functions ***** */ /* ***** local functions ***** */
static int check_selection(sel) static int check_selection(UserSelection *sel)
UserSelection *sel;
{ {
int ret = NoError; int ret = NoError;
@ -470,8 +463,7 @@ static int check_selection(sel)
return ret; return ret;
} }
static int build_run_env(sel) static int build_run_env(UserSelection *sel)
UserSelection *sel;
{ {
char *p; char *p;
int proto; int proto;
@ -570,8 +562,7 @@ static int build_run_env(sel)
return NoError; return NoError;
} }
static int run_ims(sel) static int run_ims(UserSelection *sel)
UserSelection *sel;
{ {
int ret = NoError; int ret = NoError;
@ -598,8 +589,7 @@ static int run_ims(sel)
return ret; return ret;
} }
static int invoke_ims(sel) static int invoke_ims(UserSelection *sel)
UserSelection *sel;
{ {
RunEnv *renv = sel->renv; RunEnv *renv = sel->renv;
pid_t pid; pid_t pid;
@ -646,8 +636,7 @@ static int invoke_ims(sel)
return NoError; return NoError;
} }
static void on_sig_chld(sig) static void on_sig_chld(int sig)
int sig;
{ {
int wait_status = 0; int wait_status = 0;
pid_t pid; pid_t pid;
@ -703,9 +692,7 @@ static void on_sig_chld(sig)
return; return;
} }
static bool is_ims_running(renv, ims) static bool is_ims_running(RunEnv *renv, ImsConf *ims)
RunEnv *renv;
ImsConf *ims;
{ {
char *prop_str; char *prop_str;
Window owner; Window owner;
@ -745,8 +732,7 @@ static bool is_ims_running(renv, ims)
} }
static int settle_ims(sel) static int settle_ims(UserSelection *sel)
UserSelection *sel;
{ {
if (isXsession()) { if (isXsession()) {
@ -774,9 +760,7 @@ static int settle_ims(sel)
return NoError; return NoError;
} }
static Window property_owner(prop_atom, prop_str) static Window property_owner(Atom *prop_atom, char *prop_str)
Atom *prop_atom;
char *prop_str;
{ {
Atom property = prop_atom ? *prop_atom : None; 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 jmp_buf jmp_env;
static Window dmy_win = 0; /* temporary window used for XCreateIC() */ static Window dmy_win = 0; /* temporary window used for XCreateIC() */
static void catch_alarm(sig) static void catch_alarm(int sig)
int sig;
{ {
signal(SIGALRM, SIG_IGN); signal(SIGALRM, SIG_IGN);
alarm(0); alarm(0);
longjmp(jmp_env, 1); longjmp(jmp_env, 1);
} }
static int try_connection(sel) static int try_connection(UserSelection *sel)
UserSelection *sel;
{ {
RunEnv *renv = sel->renv; RunEnv *renv = sel->renv;
ImsConf *ims = sel->ent->ims; ImsConf *ims = sel->ent->ims;
@ -886,8 +868,7 @@ static int try_connection(sel)
return ic_ok ? NoError : ErrImsTimeout; /* ErrImsConnect; */ return ic_ok ? NoError : ErrImsTimeout; /* ErrImsConnect; */
} }
static int create_dummy_ic(xim) static int create_dummy_ic(XIM xim)
XIM xim;
{ {
int scr; int scr;
XFontSet fset; XFontSet fset;

View file

@ -30,7 +30,7 @@
/* ******** locale name manupilation ******** */ /* ******** locale name manupilation ******** */
int find_CDE_locale_name() int find_CDE_locale_name(void)
{ {
UserEnv *uenv = &userEnv; UserEnv *uenv = &userEnv;
_DtXlateDb db = NULL; _DtXlateDb db = NULL;
@ -61,8 +61,7 @@ int find_CDE_locale_name()
return ret; return ret;
} }
char *find_system_locale_name(CDE_locale) char *find_system_locale_name(char *CDE_locale)
char *CDE_locale;
{ {
_DtXlateDb db = NULL; _DtXlateDb db = NULL;
int ret = NoError; int ret = NoError;
@ -93,16 +92,14 @@ char *find_system_locale_name(CDE_locale)
/* ******** string manupilation ******** */ /* ******** string manupilation ******** */
char *strcpyx(dest, src) char *strcpyx(register char *dest, register char *src)
register char *dest, *src;
{ {
while (*dest++ = *src++) ; while (*dest++ = *src++) ;
return(--dest); return(--dest);
} }
#ifdef unused #ifdef unused
char *strcpy2(dest, src1, src2) char *strcpy2(register char *dest, register char *src1, register char *src2)
register char *dest, *src1, *src2;
{ {
while (*dest++ = *src1++) ; while (*dest++ = *src1++) ;
--dest; --dest;
@ -110,8 +107,7 @@ char *strcpy2(dest, src1, src2)
return(--dest); return(--dest);
} }
char *newstradded(src1, src2, src3) char *newstradded(register char *src1, register char *src2, register char *src3)
register char *src1, *src2, *src3;
{ {
register char *p; register char *p;
char *dest; char *dest;
@ -125,9 +121,7 @@ char *newstradded(src1, src2, src3)
#endif /* unused */ #endif /* unused */
int str_to_int(ptr, val) int str_to_int(char *ptr, int *val)
char *ptr;
int *val;
{ {
int base; int base;
char *pp; char *pp;
@ -140,9 +134,7 @@ int str_to_int(ptr, val)
return(True); return(True);
} }
bool str_to_bool(ptr, def_val) bool str_to_bool(char *ptr, bool def_val)
char *ptr;
bool def_val;
{ {
if (!ptr || !*ptr) return def_val; if (!ptr || !*ptr) return def_val;
skip_white(ptr); skip_white(ptr);
@ -168,8 +160,7 @@ bool str_to_bool(ptr, def_val)
return def_val; return def_val;
} }
char *trim_line(ptr) char *trim_line(char *ptr)
char *ptr;
{ {
register char *lastp; register char *lastp;
@ -180,9 +171,7 @@ char *trim_line(ptr)
return ptr; /* return lastp > ptr ? ptr : NULL; */ return ptr; /* return lastp > ptr ? ptr : NULL; */
} }
char **parse_strlist(ptr, sep_ch) char **parse_strlist(register char *ptr, char sep_ch)
register char *ptr;
char sep_ch;
{ {
char *pbuf[100], **new, **bp; char *pbuf[100], **new, **bp;
char *sep, *p; char *sep, *p;
@ -216,9 +205,7 @@ char **parse_strlist(ptr, sep_ch)
} }
#ifdef unused #ifdef unused
int pack_strlist(ptr, listp, sep_ch) int pack_strlist(char *ptr, char **listp, char sep_ch)
char *ptr, **listp;
char sep_ch;
{ {
register char *bp = ptr, **lp = listp; register char *bp = ptr, **lp = listp;
@ -240,8 +227,7 @@ int pack_strlist(ptr, listp, sep_ch)
} }
#endif /* unused */ #endif /* unused */
void free_strlist(pp) void free_strlist(char **pp)
char **pp;
{ {
register char **ptr = pp; register char **ptr = pp;
@ -253,9 +239,7 @@ void free_strlist(pp)
/* ******** display string ******** */ /* ******** display string ******** */
bool parse_dpy_str(display_str, host, dnum, snum, dnet) bool parse_dpy_str(char *display_str, char **host, int *dnum, int *snum, int *dnet)
char *display_str, **host;
int *dnum, *snum, *dnet;
{ {
char buf[BUFSIZ], hostbuf[BUFSIZ], *p, *hp, *pdnum, *psnum; char buf[BUFSIZ], hostbuf[BUFSIZ], *p, *hp, *pdnum, *psnum;
int isdnet = 0; int isdnet = 0;
@ -301,9 +285,7 @@ bool parse_dpy_str(display_str, host, dnum, snum, dnet)
return True; return True;
} }
char *std_dpy_str(display_str, snum) char *std_dpy_str(char *display_str, int *snum)
char *display_str;
int *snum;
{ {
char buf[BUFSIZ], *bp, val[20]; char buf[BUFSIZ], *bp, val[20];
char *host = NULL; char *host = NULL;
@ -330,8 +312,7 @@ char *std_dpy_str(display_str, snum)
/* ******** file & dir manipulation ******** */ /* ******** file & dir manipulation ******** */
int make_user_dir(path) int make_user_dir(char *path)
char *path;
{ {
if (!is_directory(path, False)) { if (!is_directory(path, False)) {
if (access(path, F_OK) == 0) if (access(path, F_OK) == 0)
@ -343,8 +324,7 @@ int make_user_dir(path)
return True; return True;
} }
char *dirname(path) char *dirname(char *path)
char *path;
{ {
static char dname[MAXPATHLEN]; static char dname[MAXPATHLEN];
register char *p = path; register char *p = path;
@ -371,9 +351,7 @@ char *dirname(path)
} }
int is_directory(path, must_writable) int is_directory(char *path, int must_writable)
char *path;
int must_writable;
{ {
struct stat stb; struct stat stb;
int mode = R_OK|X_OK; int mode = R_OK|X_OK;
@ -384,15 +362,13 @@ int is_directory(path, must_writable)
} }
#ifdef unused #ifdef unused
int is_regularfile(path) int is_regularfile(char *path)
char *path;
{ {
struct stat stb; struct stat stb;
return stat(path, &stb) == 0 && S_ISREG(stb.st_mode); return stat(path, &stb) == 0 && S_ISREG(stb.st_mode);
} }
int is_emptyfile(path) int is_emptyfile(char *path)
char *path;
{ {
struct stat stb; struct stat stb;
return stat(path, &stb) == 0 && S_ISREG(stb.st_mode) && stb.st_size == 0; return stat(path, &stb) == 0 && S_ISREG(stb.st_mode) && stb.st_size == 0;
@ -400,8 +376,7 @@ int is_emptyfile(path)
#endif /* unused */ #endif /* unused */
int is_executable(path) int is_executable(char *path)
char *path;
{ {
struct stat stb; struct stat stb;
return stat(path, &stb) == 0 && S_ISREG(stb.st_mode) return stat(path, &stb) == 0 && S_ISREG(stb.st_mode)
@ -409,8 +384,7 @@ int is_executable(path)
} }
#ifdef unused #ifdef unused
int is_writable(path) int is_writable(char *path)
char *path;
{ {
if (access(path, R_OK|W_OK) == 0) if (access(path, R_OK|W_OK) == 0)
return True; return True;
@ -421,9 +395,7 @@ int is_writable(path)
} }
#endif /* unused */ #endif /* unused */
int is_readable(path, allow_empty) int is_readable(char *path, int allow_empty)
char *path;
int allow_empty;
{ {
struct stat stb; struct stat stb;
return stat(path, &stb) == 0 && S_ISREG(stb.st_mode) 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_linebuf = NULL;
static char *tag_file = NULL; static char *tag_file = NULL;
int start_tag_line(fname) int start_tag_line(char *fname)
char *fname;
{ {
if (fname) { if (fname) {
if (!tag_linebuf) if (!tag_linebuf)
@ -453,9 +424,7 @@ int start_tag_line(fname)
return True; return True;
} }
int read_tag_line(fp, tagp, valp) int read_tag_line(FILE *fp, char **tagp, char **valp)
FILE *fp;
char **tagp, **valp;
{ {
char *lp, *lp2; char *lp, *lp2;
@ -483,9 +452,7 @@ int read_tag_line(fp, tagp, valp)
/* ******** put messages ******** */ /* ******** put messages ******** */
void put_xims_msg(msg_type, err_num, arg1, arg2, arg3) void put_xims_msg(int msg_type, int err_num, void *arg1, void *arg2, void *arg3)
int msg_type, err_num;
void *arg1, *arg2, *arg3;
{ {
int ret = -2; int ret = -2;
char *msg; char *msg;
@ -514,17 +481,13 @@ void put_xims_msg(msg_type, err_num, arg1, arg2, arg3)
return; return;
} }
void put_xims_errmsg(err_num, arg1, arg2, arg3) void put_xims_errmsg(int err_num, void *arg1, void *arg2, void *arg3)
int err_num;
void *arg1, *arg2, *arg3;
{ {
if (Verbose > 0) if (Verbose > 0)
put_xims_msg(MSGTYP_FATAL, err_num, arg1, arg2, arg3); put_xims_msg(MSGTYP_FATAL, err_num, arg1, arg2, arg3);
} }
void put_xims_warnmsg(err_num, arg1, arg2, arg3) void put_xims_warnmsg(int err_num, void *arg1, void *arg2, void *arg3)
int err_num;
void *arg1, *arg2, *arg3;
{ {
if (Verbose > 0) if (Verbose > 0)
put_xims_msg(MSGTYP_WARN, err_num, arg1, arg2, arg3); 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 #ifdef DEBUG
/* for DPR*() macro */ /* for DPR*() macro */
void print_msg(fmt, arg1, arg2, arg3, arg4, arg5) void print_msg(char *fmt, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5)
char *fmt;
void *arg1, *arg2, *arg3, *arg4, *arg5;
{ {
fprintf(LogFp, fmt, arg1, arg2, arg3, arg4, arg5); fprintf(LogFp, fmt, arg1, arg2, arg3, arg4, arg5);
} }
#endif #endif
int put_xims_log(fmt, arg1, arg2, arg3) int put_xims_log(char *fmt, void *arg1, void *arg2, void *arg3)
char *fmt;
void *arg1, *arg2, *arg3;
{ {
FILE *fp; FILE *fp;
char *logpath = Opt.LogPath; char *logpath = Opt.LogPath;
@ -570,8 +529,7 @@ int put_xims_log(fmt, arg1, arg2, arg3)
/* ******** clear structure ******** */ /* ******** clear structure ******** */
void clear_ImsConf(ims) void clear_ImsConf(ImsConf *ims)
ImsConf *ims;
{ {
FREE(ims->servername); FREE(ims->servername);
FREE(ims->servername2); FREE(ims->servername2);
@ -586,8 +544,7 @@ void clear_ImsConf(ims)
CLR(ims, ImsConf); CLR(ims, ImsConf);
} }
void clear_ImsEnt(ent) void clear_ImsEnt(ImsEnt *ent)
ImsEnt *ent;
{ {
FREE(ent->name); FREE(ent->name);
FREE(ent->fname); FREE(ent->fname);
@ -599,8 +556,7 @@ void clear_ImsEnt(ent)
CLR(ent, ImsEnt); CLR(ent, ImsEnt);
} }
void clear_ImsList(list) void clear_ImsList(ImsList *list)
ImsList *list;
{ {
int i; int i;
@ -616,8 +572,7 @@ void clear_ImsList(list)
} }
void clear_FileSel(fsel) void clear_FileSel(FileSel *fsel)
FileSel *fsel;
{ {
FREE(fsel->name); FREE(fsel->name);
FREE(fsel->hostname); FREE(fsel->hostname);
@ -640,8 +595,7 @@ void clear_FileSel(fsel)
fsel->dpy_specific = False; fsel->dpy_specific = False;
} }
void clear_UserSelection(sel) void clear_UserSelection(UserSelection *sel)
UserSelection *sel;
{ {
FREE(sel->name); FREE(sel->name);
FREE(sel->hostname); FREE(sel->hostname);
@ -666,8 +620,7 @@ void clear_UserSelection(sel)
} }
void clear_RunEnv(renv) void clear_RunEnv(RunEnv *renv)
RunEnv *renv;
{ {
FREE(renv->im_mod); FREE(renv->im_mod);
FREE(renv->atom_name); FREE(renv->atom_name);
@ -678,8 +631,7 @@ void clear_RunEnv(renv)
} }
void clear_OutEnv(oenv) void clear_OutEnv(OutEnv *oenv)
OutEnv *oenv;
{ {
EnvEnt *ep; EnvEnt *ep;
@ -696,7 +648,7 @@ void clear_OutEnv(oenv)
#ifdef unused #ifdef unused
void clear_UserEnv() void clear_UserEnv(void)
{ {
UserEnv *uenv = &userEnv; UserEnv *uenv = &userEnv;
@ -714,7 +666,7 @@ void clear_UserEnv()
return; return;
} }
void clear_CmdConf() void clear_CmdConf(void)
{ {
if (cmdconf_initialized) { if (cmdconf_initialized) {
CmdConf *conf = &Conf; CmdConf *conf = &Conf;
@ -775,17 +727,17 @@ void clear_CmdConf()
return; return;
} }
void clear_WinEnv() void clear_WinEnv(void)
{ {
CLR(&winEnv, WinEnv); CLR(&winEnv, WinEnv);
} }
void clear_CmdOpt() void clear_CmdOpt(void)
{ {
CLR(&Opt, CmdOpt); CLR(&Opt, CmdOpt);
} }
void clear_All() void clear_All(void)
{ {
UserSelection *sel = &userSel; UserSelection *sel = &userSel;
@ -815,8 +767,7 @@ void clear_All()
/* ******** print structure (for DEBUG) ******** */ /* ******** print structure (for DEBUG) ******** */
void pr_FileSel(fsel) void pr_FileSel(FileSel *fsel)
FileSel *fsel;
{ {
fprintf(LogFp, "FileSel:\tdpy_specific=%d real_fname=%s select_mode=%d\n", fprintf(LogFp, "FileSel:\tdpy_specific=%d real_fname=%s select_mode=%d\n",
fsel->dpy_specific, fsel->real_fname, fsel->select_mode); fsel->dpy_specific, fsel->real_fname, fsel->select_mode);
@ -831,8 +782,7 @@ void pr_FileSel(fsel)
} }
} }
void pr_UserSelection(sel) void pr_UserSelection(UserSelection *sel)
UserSelection *sel;
{ {
fprintf(LogFp, "userSelection:\tstatus=%s flag=%#x ims_idx=%d\n", fprintf(LogFp, "userSelection:\tstatus=%s flag=%#x ims_idx=%d\n",
error_name(sel->status), sel->flag, sel->ims_idx); error_name(sel->status), sel->flag, sel->ims_idx);
@ -844,9 +794,7 @@ void pr_UserSelection(sel)
if (sel->renv) pr_RunEnv(sel->renv); if (sel->renv) pr_RunEnv(sel->renv);
} }
void pr_ImsConf(conf, ims_name) void pr_ImsConf(ImsConf *conf, char *ims_name)
ImsConf *conf;
char *ims_name;
{ {
char **p; char **p;
@ -877,16 +825,13 @@ void pr_ImsConf(conf, ims_name)
fputc('\n', LogFp); fputc('\n', LogFp);
} }
void pr_ImsEnt(ent, idx) void pr_ImsEnt(ImsEnt *ent, int idx)
ImsEnt *ent;
int idx;
{ {
fprintf(LogFp, "ImsEnt[%d]:\tname=%s fname=%s label=%s ims=%#x\n", fprintf(LogFp, "ImsEnt[%d]:\tname=%s fname=%s label=%s ims=%#x\n",
idx, ent->name, ent->fname, ent->label, ent->ims); idx, ent->name, ent->fname, ent->label, ent->ims);
} }
void pr_ImsList(list) void pr_ImsList(ImsList *list)
ImsList *list;
{ {
int i; int i;
ImsEnt *ent; ImsEnt *ent;
@ -900,8 +845,7 @@ void pr_ImsList(list)
} }
} }
void pr_WinEnv(wenv) void pr_WinEnv(WinEnv *wenv)
WinEnv *wenv;
{ {
fprintf(LogFp, "WinEnv:\tstatus=%d Dpy=%#x topW=%#x appC=%#x\n", fprintf(LogFp, "WinEnv:\tstatus=%d Dpy=%#x topW=%#x appC=%#x\n",
wenv->status, wenv->Dpy, wenv->TopW, wenv->appC); 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); wenv->atom_owner, wenv->atom_main, wenv->atom_status, wenv->atom_data);
} }
void pr_RunEnv(renv) void pr_RunEnv(RunEnv *renv)
RunEnv *renv;
{ {
fprintf(LogFp, "RunEnv:\tstatus=%s is_remote=%d proto=%d\n", fprintf(LogFp, "RunEnv:\tstatus=%s is_remote=%d proto=%d\n",
error_name(renv->status), renv->is_remote, proto_name(renv->proto)); 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; UserEnv *uenv = &userEnv;
@ -936,8 +879,7 @@ void pr_UserEnv()
fprintf(LogFp, "\tscreen_num=%d\n", uenv->screen_num); fprintf(LogFp, "\tscreen_num=%d\n", uenv->screen_num);
} }
void pr_OutEnv(oenv) void pr_OutEnv(OutEnv *oenv)
OutEnv *oenv;
{ {
EnvEnt *ep; EnvEnt *ep;
@ -956,7 +898,7 @@ void pr_OutEnv(oenv)
} }
void pr_CmdConf() void pr_CmdConf(void)
{ {
int i; int i;
CmdConf *conf = &Conf; CmdConf *conf = &Conf;
@ -1034,7 +976,7 @@ void pr_CmdConf()
# endif /* old_hpux */ # endif /* old_hpux */
} }
void pr_CmdOpt() void pr_CmdOpt(void)
{ {
fprintf(LogFp, "CmdOpt:\tDisplayName=%s LocaleName=%s ShellName=%s\n", fprintf(LogFp, "CmdOpt:\tDisplayName=%s LocaleName=%s ShellName=%s\n",
Opt.DisplayName, Opt.LocaleName, Opt.ShellName); Opt.DisplayName, Opt.LocaleName, Opt.ShellName);
@ -1048,7 +990,7 @@ void pr_CmdOpt()
Opt.SelectMode, Opt.Timeout, Opt.Interval); Opt.SelectMode, Opt.Timeout, Opt.Interval);
} }
void pr_OpModeFlag() void pr_OpModeFlag(void)
{ {
char *name = "<unknown>"; char *name = "<unknown>";
@ -1107,7 +1049,7 @@ static char *StateNameTbl[] = {
}; };
#define NumStates (sizeof(StateNameTbl) / sizeof(char *)) #define NumStates (sizeof(StateNameTbl) / sizeof(char *))
char *StateName() char *StateName(void)
{ {
return (OpState >= 0 && OpState < NumStates) ? return (OpState >= 0 && OpState < NumStates) ?
StateNameTbl[OpState] : "<unknown>"; StateNameTbl[OpState] : "<unknown>";
@ -1116,8 +1058,7 @@ char *StateName()
/* ******** error name ******** */ /* ******** error name ******** */
char *error_name(error) char *error_name(ximsError error)
ximsError error;
{ {
char *name = "<unknown>"; char *name = "<unknown>";
@ -1196,8 +1137,7 @@ static char *_proto_names[NUM_PROTOCOLS] =
{ "None", "XIM", "Ximp", "Xsi" }; { "None", "XIM", "Ximp", "Xsi" };
# endif /* old_hpux */ # endif /* old_hpux */
char *proto_name(proto_idx) char *proto_name(int proto_idx)
int proto_idx;
{ {
if (proto_idx >= 0 && proto_idx < NUM_PROTOCOLS) if (proto_idx >= 0 && proto_idx < NUM_PROTOCOLS)
return _proto_names[proto_idx]; return _proto_names[proto_idx];
@ -1214,15 +1154,13 @@ static char *SigNames[] = { /* 1 ~ 32 */
#define MaxSigNum (sizeof(SigNames) / sizeof(char *)) #define MaxSigNum (sizeof(SigNames) / sizeof(char *))
char *sig_name(sig) char *sig_name(int sig)
int sig;
{ {
return (sig > 0 && sig <= MaxSigNum) ? SigNames[sig - 1] : "<unknown>"; return (sig > 0 && sig <= MaxSigNum) ? SigNames[sig - 1] : "<unknown>";
} }
void pr_brk(msg) void pr_brk(char *msg)
char *msg;
{ {
static char *last_brk = 0; static char *last_brk = 0;
char *new_brk = (char *) sbrk(0); char *new_brk = (char *) sbrk(0);

View file

@ -175,7 +175,7 @@ static void xt_timer_cb(/* client_data, timer_id */);
/* ******** window env ******** */ /* ******** window env ******** */
int open_display() int open_display(void)
{ {
if (Dpy) return NoError; /* already done */ if (Dpy) return NoError; /* already done */
@ -188,7 +188,7 @@ int open_display()
return NoError; return NoError;
} }
void close_display() void close_display(void)
{ {
if (TopW) return; /* Xt not finished */ if (TopW) return; /* Xt not finished */
@ -199,12 +199,12 @@ void close_display()
return; return;
} }
int window_env_ok() int window_env_ok(void)
{ {
return winEnv.status != WIN_ST_NONE ? True : False; 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, enum { XA_DTIMS_ATOM_MAIN, XA_DTIMS_ATOM_STATUS, XA_DTIMS_ATOM_DATA,
NUM_ATOMS }; NUM_ATOMS };
@ -288,7 +288,7 @@ int init_window_env()
return NoError; return NoError;
} }
void end_window_env() void end_window_env(void)
{ {
if (TopW) { if (TopW) {
disown_main_atom(XtWindow(TopW)); disown_main_atom(XtWindow(TopW));
@ -309,9 +309,8 @@ void end_window_env()
/* return; */ /* return; */
} }
/* clear WM_COMMAND property */
int clear_cmd_property(win) /* clear WM_COMMAND property */ int clear_cmd_property(Window win)
Window win;
{ {
int ret, ac = 0; int ret, ac = 0;
int clear_ok = False; int clear_ok = False;
@ -331,9 +330,7 @@ int clear_cmd_property(win) /* clear WM_COMMAND property */
return clear_ok; return clear_ok;
} }
static int ignoreBadWindow(dpy, error) static int ignoreBadWindow(Display *dpy, XErrorEvent *error)
Display *dpy;
XErrorEvent *error;
{ {
if (error->error_code == BadWindow || error->error_code == BadDrawable) { if (error->error_code == BadWindow || error->error_code == BadDrawable) {
return 0; return 0;
@ -343,9 +340,7 @@ static int ignoreBadWindow(dpy, error)
} }
#ifdef unused #ifdef unused
static void finish_window(w, end_window) static void finish_window(Widget *w, int end_window)
Widget *w;
int end_window;
{ {
if (*w) { if (*w) {
XtUnmapWidget(*w); XtUnmapWidget(*w);
@ -361,8 +356,8 @@ static void finish_window(w, end_window)
#endif /* unused */ #endif /* unused */
static int own_main_atom(win) /* own DTIMS_ATOM_MAIN */ /* own DTIMS_ATOM_MAIN */
Window win; static int own_main_atom(Window win)
{ {
Window owner = None; Window owner = None;
@ -383,8 +378,8 @@ static int own_main_atom(win) /* own DTIMS_ATOM_MAIN */
return winEnv.atom_owner == win ? True : False; return winEnv.atom_owner == win ? True : False;
} }
static int disown_main_atom(win) /* disown DTIMS_ATOM_MAIN */ /* disown DTIMS_ATOM_MAIN */
Window win; static int disown_main_atom(Window win)
{ {
if (winEnv.atom_main == None) return False; if (winEnv.atom_main == None) return False;
/* if (winEnv.atom_owner == 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 */ static char *saved_xdefs = NULL; /* should not be freed */
int save_RM() int save_RM(void)
{ {
if (!Dpy) return False; if (!Dpy) return False;
saved_xdefs = XResourceManagerString(Dpy); saved_xdefs = XResourceManagerString(Dpy);
return saved_xdefs ? True : False; return saved_xdefs ? True : False;
} }
int merge_RM(res1, res2) int merge_RM(char *res1, char *res2)
char *res1, *res2;
{ {
char cmdbuf[BUFSIZ*2]; char cmdbuf[BUFSIZ*2];
int ret; int ret;
@ -438,7 +432,7 @@ int merge_RM(res1, res2)
return ret == 0 ? True : False; return ret == 0 ? True : False;
} }
int restore_RM() int restore_RM(void)
{ {
int len = saved_xdefs ? strlen(saved_xdefs) : 0; int len = saved_xdefs ? strlen(saved_xdefs) : 0;
int max = (XMaxRequestSize(Dpy) << 2) - 28; int max = (XMaxRequestSize(Dpy) << 2) - 28;
@ -490,8 +484,7 @@ static ImsList *curList = 0;
static bool selection_changed = False; static bool selection_changed = False;
static void free_ims_list(list) static void free_ims_list(ImsList *list)
ImsList *list;
{ {
/* DPR(("free_ims_list(list=%p)\n", list)); */ /* DPR(("free_ims_list(list=%p)\n", list)); */
if (list && list != localList && list != userSel.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); free_ims_list(curList);
curList = (ImsList *) 0; curList = (ImsList *) 0;
@ -512,7 +505,7 @@ static void clear_selection_var()
selection_changed = False; selection_changed = False;
} }
int start_selection_window() int start_selection_window(void)
{ {
int ret = NoError; int ret = NoError;
@ -548,8 +541,7 @@ int start_selection_window()
return NoError; return NoError;
} }
static void finish_selection_window(end_window) static void finish_selection_window(int end_window)
int end_window;
{ {
DPR(("finish_selection_window(end=%s)\n", end_window ? "True" : "False")); DPR(("finish_selection_window(end=%s)\n", end_window ? "True" : "False"));
@ -582,9 +574,7 @@ static void finish_selection_window(end_window)
return; return;
} }
static void done_cb(w, client_data, call_data) static void done_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
int canceled = (int)(intptr_t) client_data == CANCEL_BTN; int canceled = (int)(intptr_t) client_data == CANCEL_BTN;
int idx; int idx;
@ -618,9 +608,7 @@ static void done_cb(w, client_data, call_data)
ximsMain(); ximsMain();
} }
static void select_cb(w, client_data, call_data) static void select_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
int new_idx = (int)(intptr_t) client_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; CurIdx = new_idx;
} }
static void host_btn_cb(w, client_data, call_data) static void host_btn_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
start_host_window(CurHost); start_host_window(CurHost);
} }
static void help_cb(w, client_data, call_data) static void help_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
ximsHelp(HELP_SELECTION); 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 form, sel_rc, host_rc, cmd_rc, lb, sep;
Widget w_tbl[8]; Widget w_tbl[8];
@ -752,9 +736,7 @@ static int create_selection_window()
} }
static int change_host(new_host, host_type) static int change_host(char *new_host, int host_type)
char *new_host;
int host_type;
{ {
int ret = NoError; int ret = NoError;
ImsList *new_list = (ImsList *) 0; ImsList *new_list = (ImsList *) 0;
@ -794,8 +776,7 @@ static int change_host(new_host, host_type)
#define createPB XmCreatePushButton #define createPB XmCreatePushButton
#define createTB XmCreateToggleButton #define createTB XmCreateToggleButton
static void add_btn_trans(btn) static void add_btn_trans(Widget btn)
Widget btn;
{ {
char btn_trans_str[] = "<Key>Return: ArmAndActivate()"; char btn_trans_str[] = "<Key>Return: ArmAndActivate()";
static XtTranslations btn_trans = 0; static XtTranslations btn_trans = 0;
@ -814,9 +795,7 @@ static void add_btn_trans(btn)
# endif /* SelectByReturn */ # endif /* SelectByReturn */
static void change_ims_list(last_ims_name, init_idx) static void change_ims_list(char *last_ims_name, int init_idx)
char *last_ims_name;
int init_idx;
{ {
int idx; int idx;
int i, j; int i, j;
@ -880,9 +859,7 @@ static void change_ims_list(last_ims_name, init_idx)
#undef IMS_OK #undef IMS_OK
} }
static void set_host_label(host_type, hostname) static void set_host_label(int host_type, char *hostname)
int host_type;
char *hostname;
{ {
static Widget lb_host = 0; 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) static void add_cmd_btn(Widget parent_rc, void (*cb_ok)(),
Widget parent_rc; void (*cb_clear)(), void (*cb_cancel)(),
void (*cb_ok)(), (*cb_cancel)(), (*cb_clear)(), void (*cb_host)(), void (*cb_help)())
(*cb_host)(), (*cb_help)();
{ {
Widget pb[4]; Widget pb[4];
Arg args[12]; 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 ***** */ /* ***** host window ***** */
static void start_host_window(cur_host) static void start_host_window(char *cur_host)
char *cur_host;
{ {
int ret; int ret;
@ -1026,7 +1001,7 @@ static void start_host_window(cur_host)
return; return;
} }
static void finish_host_window() static void finish_host_window(void)
{ {
DPR(("finish_host_window()\n")); DPR(("finish_host_window()\n"));
@ -1037,9 +1012,7 @@ static void finish_host_window()
} }
} }
static void host_done_cb(w, client_data, call_data) static void host_done_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
int cancel = (int)(intptr_t) client_data == CANCEL_BTN; int cancel = (int)(intptr_t) client_data == CANCEL_BTN;
int ret = NoError; int ret = NoError;
@ -1120,25 +1093,18 @@ static void host_done_cb(w, client_data, call_data)
#endif #endif
} }
static void host_clear_cb(w, client_data, call_data) static void host_clear_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
/* if (!HostText) return; */ /* if (!HostText) return; */
XtVaSetValues(HostText, XmNvalue, "", NULL); XtVaSetValues(HostText, XmNvalue, "", NULL);
} }
static void host_done_action(w, ev, args, num_args) static void host_done_action(Widget w, XEvent *ev, String *args, Cardinal *num_args)
Widget w;
XEvent *ev;
String *args;
Cardinal *num_args;
{ {
host_done_cb(w, (XtPointer) OK_BTN, 0); host_done_cb(w, (XtPointer) OK_BTN, 0);
} }
static void create_host_window(cur_host) static void create_host_window(char *cur_host)
char *cur_host;
{ {
Widget form, cmd_rc, lb1, sep, w_tbl[5]; Widget form, cmd_rc, lb1, sep, w_tbl[5];
Widget host_desc, host_rc, host_lb, host_txt; 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 OrgMode = SEL_MODE_NONE;
static int CurMode = SEL_MODE_NONE; static int CurMode = SEL_MODE_NONE;
int start_mode_window(cur_mode) int start_mode_window(int cur_mode)
int cur_mode;
{ {
int ret; int ret;
@ -1263,8 +1228,7 @@ int start_mode_window(cur_mode)
return NoError; return NoError;
} }
static void finish_mode_window(end_window) static void finish_mode_window(int end_window)
int end_window;
{ {
if (ModeW) { if (ModeW) {
XtUnmanageChild(ModeW); XtUnmanageChild(ModeW);
@ -1280,9 +1244,7 @@ static void finish_mode_window(end_window)
return; return;
} }
static void mode_done_cb(w, client_data, call_data) static void mode_done_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
int ret = NoError; int ret = NoError;
int canceled = (int)(intptr_t) client_data == CANCEL_BTN; 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 */ /* never returns */
} }
static void mode_cb(w, client_data, call_data) static void mode_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
int is_set = (int)((XmToggleButtonCallbackStruct *)call_data)->set; int is_set = (int)((XmToggleButtonCallbackStruct *)call_data)->set;
int is_auto = (int)(intptr_t) client_data; 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; CurMode = (is_auto && is_set) ? SEL_MODE_AUTO : SEL_MODE_NOAUTO;
} }
static void mode_help_cb(w, client_data, call_data) static void mode_help_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
ximsHelp(HELP_MODE); ximsHelp(HELP_MODE);
} }
static int create_mode_window(cur_mode) static int create_mode_window(int cur_mode)
int cur_mode;
{ {
Widget form, mode_rc, cmd_rc, lb1, sep, w_tbl[8]; Widget form, mode_rc, cmd_rc, lb1, sep, w_tbl[8];
Arg args[16]; Arg args[16];
@ -1415,14 +1372,12 @@ static int create_mode_window(cur_mode)
/* ******** ximsHelp ******** */ /* ******** ximsHelp ******** */
static void help_ok(w, client_data, call_data) static void help_ok(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
stop_help(); stop_help();
} }
void stop_help() void stop_help(void)
{ {
if (HelpW) { if (HelpW) {
XtUnmanageChild(HelpW); XtUnmanageChild(HelpW);
@ -1430,7 +1385,7 @@ void stop_help()
} }
} }
static void create_help() static void create_help(void)
{ {
int i; int i;
Arg args[10]; Arg args[10];
@ -1460,8 +1415,7 @@ static void create_help()
return; return;
} }
void ximsHelp(help_type) void ximsHelp(int help_type)
int help_type;
{ {
char *msg = NULL; char *msg = NULL;
XmString str; XmString str;
@ -1509,9 +1463,7 @@ void ximsHelp(help_type)
static int dialog_resp = XmCR_NONE; static int dialog_resp = XmCR_NONE;
static bool in_confirmation = False; static bool in_confirmation = False;
static void dialog_resp_cb(w, client_data, call_data) static void dialog_resp_cb(Widget w, XtPointer client_data, XtPointer call_data)
Widget w;
XtPointer client_data, call_data;
{ {
Widget msg_box = (Widget) client_data; Widget msg_box = (Widget) client_data;
XmAnyCallbackStruct *cbs = (XmAnyCallbackStruct *) call_data; XmAnyCallbackStruct *cbs = (XmAnyCallbackStruct *) call_data;
@ -1529,8 +1481,7 @@ static void dialog_resp_cb(w, client_data, call_data)
} }
#ifdef unused #ifdef unused
static int wait_confirmation(w) static int wait_confirmation(Widget w)
Widget w;
{ {
XtAppContext context; XtAppContext context;
@ -1550,9 +1501,7 @@ static int wait_confirmation(w)
} }
#endif /* unused */ #endif /* unused */
int put_msg_win(type, msg) int put_msg_win(int type, char *msg)
int type;
char *msg;
{ {
int reply; int reply;
Widget btn; Widget btn;
@ -1657,8 +1606,7 @@ int put_msg_win(type, msg)
#define LOC_RIGHT (1<<3) #define LOC_RIGHT (1<<3)
#define LOC_MARGIN 5 #define LOC_MARGIN 5
static int window_location(loc_str) static int window_location(char *loc_str)
char *loc_str;
{ {
int locate_type = LOC_CENTER; int locate_type = LOC_CENTER;
char *lower_str, *p; char *lower_str, *p;
@ -1676,8 +1624,7 @@ static int window_location(loc_str)
return locate_type; return locate_type;
} }
static void locate_window(w) static void locate_window(Widget w)
Widget w;
{ {
int scr; int scr;
int x, y; int x, y;
@ -1718,9 +1665,7 @@ static void locate_window(w)
/* ******** cursor (normal / wait) ******** */ /* ******** cursor (normal / wait) ******** */
static void set_cursor(w, is_wait) static void set_cursor(Widget w, int is_wait)
Widget w;
int is_wait;
{ {
static Cursor cursors[2] = { None, None }; static Cursor cursors[2] = { None, None };
int idx; int idx;
@ -1738,7 +1683,7 @@ static void set_cursor(w, is_wait)
/* ***** waiting functions ***** */ /* ***** waiting functions ***** */
void xevent_loop() void xevent_loop(void)
{ {
if (appC) if (appC)
XtAppMainLoop(appC); XtAppMainLoop(appC);
@ -1748,7 +1693,7 @@ static time_t xt_start_tm = 0L; /* in sec */
static XtIntervalId xt_last_timer = (XtIntervalId)0; static XtIntervalId xt_last_timer = (XtIntervalId)0;
static bool xt_waiting = False; static bool xt_waiting = False;
void xt_start_waiting() void xt_start_waiting(void)
{ {
if (!appC) return; if (!appC) return;
@ -1763,7 +1708,7 @@ void xt_start_waiting()
XtAppMainLoop(appC); XtAppMainLoop(appC);
} }
void xt_stop_waiting() void xt_stop_waiting(void)
{ {
if (xt_last_timer) { if (xt_last_timer) {
XtRemoveTimeOut(xt_last_timer); XtRemoveTimeOut(xt_last_timer);
@ -1774,9 +1719,7 @@ void xt_stop_waiting()
ximsWaitDone(); ximsWaitDone();
} }
static void xt_timer_cb(client_data, timer_id) static void xt_timer_cb(XtPointer client_data, XtIntervalId *timer_id)
XtPointer client_data;
XtIntervalId *timer_id;
{ {
int lapse; int lapse;

View file

@ -125,9 +125,9 @@ extern char *strcpyx(/* dest, src */);
extern char *strcpy2(/* dest, src1, src2 */); extern char *strcpy2(/* dest, src1, src2 */);
extern char *newstradded(/* src1, src2, src3 */); extern char *newstradded(/* src1, src2, src3 */);
extern int str_to_int(/* ptr, val */); 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 *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 int pack_strlist(/* ptr, listp, sep_ch */);
extern void free_strlist(/* pp */); extern void free_strlist(/* pp */);
extern bool parse_dpy_str(/* display_str, host, dnum, snum, dnet */); extern bool parse_dpy_str(/* display_str, host, dnum, snum, dnet */);