Merge branch 'master' into autotools-conversion
Lost the ksh93 submodule so will re-add in a later commit.
This commit is contained in:
@@ -318,7 +318,7 @@ clear_display(void)
|
||||
v->defState = 1 ;
|
||||
i = 0 ;
|
||||
mpcim(&i, v->MPdisp_val) ;
|
||||
STRCPY(v->display, make_number(v->MPdisp_val, FALSE)) ;
|
||||
strcpy(v->display, make_number(v->MPdisp_val, FALSE)) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
|
||||
v->hyperbolic = 0 ;
|
||||
@@ -419,7 +419,7 @@ void
|
||||
doerr(char *errmes)
|
||||
{
|
||||
if (!v->started) return ;
|
||||
STRCPY(v->display, errmes) ;
|
||||
strcpy(v->display, errmes) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
v->error = 1 ;
|
||||
beep() ;
|
||||
@@ -434,7 +434,7 @@ get_bool_resource(enum res_type rtype, int *boolval)
|
||||
int len, n ;
|
||||
|
||||
if ((val = get_resource(rtype)) == NULL) return(0) ;
|
||||
STRCPY(tempstr, val) ;
|
||||
strcpy(tempstr, val) ;
|
||||
len = strlen(tempstr) ;
|
||||
for (n = 0; n < len; n++)
|
||||
if (isupper(tempstr[n])) tempstr[n] = tolower(tempstr[n]) ;
|
||||
@@ -504,9 +504,9 @@ get_label(int n)
|
||||
temp = buttons[n].str;
|
||||
|
||||
if(temp != NULL)
|
||||
STRCPY(v->pstr, temp) ;
|
||||
strcpy(v->pstr, temp) ;
|
||||
else
|
||||
STRCPY(v->pstr, "");
|
||||
strcpy(v->pstr, "");
|
||||
}
|
||||
|
||||
/* Extract command line options. */
|
||||
@@ -546,7 +546,7 @@ get_options(int argc, char *argv[])
|
||||
sprintf(msg, opts[(int) O_MODE], next);
|
||||
getparam(next, argv, msg) ;
|
||||
XtFree(msg);
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
@@ -571,7 +571,7 @@ get_options(int argc, char *argv[])
|
||||
break ;
|
||||
case 'b' : INC ;
|
||||
getparam(next, argv, opts[(int) O_BASE]) ;
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
@@ -605,7 +605,7 @@ get_options(int argc, char *argv[])
|
||||
sprintf(msg, opts[(int) O_DISPLAY], next);
|
||||
getparam(next, argv, msg) ;
|
||||
XtFree(msg);
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
@@ -645,7 +645,7 @@ get_options(int argc, char *argv[])
|
||||
sprintf(msg, opts[(int) O_TRIG], next);
|
||||
getparam(next, argv, msg) ;
|
||||
XtFree(msg);
|
||||
STRCPY(strval, next) ;
|
||||
strcpy(strval, next) ;
|
||||
len = strlen(strval) ;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
@@ -695,14 +695,14 @@ getparam(char *s, char *argv[], char *errmes)
|
||||
{
|
||||
char *msg;
|
||||
|
||||
if (*argv != NULL && argv[0][0] != '-') STRCPY(s, *argv) ;
|
||||
if (*argv != NULL && argv[0][0] != '-') strcpy(s, *argv) ;
|
||||
else
|
||||
{
|
||||
msg = (char *) XtMalloc(strlen(mess[(int) MESS_PARAM]) +
|
||||
strlen(errmes) + 3);
|
||||
sprintf(msg, mess[(int) MESS_PARAM], errmes);
|
||||
_DtSimpleError (v->appname, DtError, NULL, msg);
|
||||
FPRINTF(stderr, mess[(int) MESS_PARAM], errmes) ;
|
||||
fprintf(stderr, mess[(int) MESS_PARAM], errmes) ;
|
||||
exit(1) ;
|
||||
}
|
||||
}
|
||||
@@ -783,8 +783,8 @@ get_rcfile(char *name)
|
||||
}
|
||||
else if (isval == 'f')
|
||||
{
|
||||
SSCANF(&line[3], "%s", tmp) ;
|
||||
STRCPY(v->fun_vals[i], convert(tmp)) ;
|
||||
sscanf(&line[3], "%s", tmp) ;
|
||||
strcpy(v->fun_vals[i], convert(tmp)) ;
|
||||
}
|
||||
else if (isval == 'r')
|
||||
{
|
||||
@@ -800,18 +800,18 @@ get_rcfile(char *name)
|
||||
line[strlen(line)-1] = '\0' ;
|
||||
if (isval == 'c')
|
||||
{
|
||||
STRCPY(tmp, make_number(v->MPcon_vals[i], TRUE)) ;
|
||||
SPRINTF(v->con_names[i], "%1d: %s [%s]",
|
||||
strcpy(tmp, make_number(v->MPcon_vals[i], TRUE)) ;
|
||||
sprintf(v->con_names[i], "%1d: %s [%s]",
|
||||
i, tmp, &line[n]) ;
|
||||
}
|
||||
else
|
||||
SPRINTF(v->fun_names[i], "%1d: %s [%s]",
|
||||
sprintf(v->fun_names[i], "%1d: %s [%s]",
|
||||
i, tmp, &line[n]) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
FCLOSE(rcfd) ;
|
||||
fclose(rcfd) ;
|
||||
}
|
||||
|
||||
/* Get a string resource from database. */
|
||||
@@ -822,7 +822,7 @@ get_str_resource(enum res_type rtype, char *strval)
|
||||
int i, len ;
|
||||
|
||||
if ((val = get_resource(rtype)) == NULL) return(0) ;
|
||||
STRCPY(strval, val) ;
|
||||
strcpy(strval, val) ;
|
||||
len = strlen(strval) ;
|
||||
if(rtype != R_TRIG && rtype != R_DISPLAY)
|
||||
{
|
||||
@@ -1013,7 +1013,7 @@ make_eng_sci(int *MPnumber)
|
||||
}
|
||||
}
|
||||
|
||||
STRCPY(fixed, make_fixed(MPmant, MAX_DIGITS-6)) ;
|
||||
strcpy(fixed, make_fixed(MPmant, MAX_DIGITS-6)) ;
|
||||
len = strlen(fixed) ;
|
||||
for (i = 0; i < len; i++) *optr++ = fixed[i] ;
|
||||
|
||||
@@ -1515,7 +1515,7 @@ process_stack(int startop, int startnum, int n)
|
||||
int i ;
|
||||
int nptr ; /* Pointer to next number from numeric stack. */
|
||||
|
||||
STRCPY(sdisp, v->display) ; /* Save current display. */
|
||||
strcpy(sdisp, v->display) ; /* Save current display. */
|
||||
nptr = startnum ;
|
||||
v->pending = 0 ;
|
||||
v->cur_op = '?' ; /* Current operation is initially undefined. */
|
||||
@@ -1546,7 +1546,7 @@ process_stack(int startop, int startnum, int n)
|
||||
v->opsptr = startop - 1 ;
|
||||
push_op(-1) ;
|
||||
save_pending_values(KEY_LPAR) ;
|
||||
STRCPY(v->display, sdisp) ; /* Restore current display. */
|
||||
strcpy(v->display, sdisp) ; /* Restore current display. */
|
||||
}
|
||||
|
||||
|
||||
@@ -1557,8 +1557,8 @@ process_str(char *str, enum menu_type mtype)
|
||||
char save[80];
|
||||
|
||||
len = strlen(str) ;
|
||||
STRCPY(save, v->display) ;
|
||||
STRCPY(v->display, " ") ;
|
||||
strcpy(save, v->display) ;
|
||||
strcpy(v->display, " ") ;
|
||||
set_item(DISPLAYITEM, v->display);
|
||||
for (i = 0 ; i < len; i++)
|
||||
{
|
||||
@@ -1568,7 +1568,7 @@ process_str(char *str, enum menu_type mtype)
|
||||
{
|
||||
if(mtype == M_FUN)
|
||||
{
|
||||
STRCPY(v->display, save);
|
||||
strcpy(v->display, save);
|
||||
set_item(DISPLAYITEM, v->display);
|
||||
v->error = 0;
|
||||
}
|
||||
@@ -1613,11 +1613,11 @@ read_rcfiles(void) /* Read .dtcalcrc's from home and current directories. */
|
||||
|
||||
for (n = 0; n < MAXREGS; n++)
|
||||
{
|
||||
STRCPY(tmp, make_number(v->MPcon_vals[n], FALSE)) ;
|
||||
SPRINTF(name, "%1d: %s [%s]", n, tmp, v->con_names[n]) ;
|
||||
strcpy(tmp, make_number(v->MPcon_vals[n], FALSE)) ;
|
||||
sprintf(name, "%1d: %s [%s]", n, tmp, v->con_names[n]) ;
|
||||
|
||||
STRCPY(v->con_names[n], name) ;
|
||||
STRCPY(v->fun_vals[n], "") ; /* Initially empty function strings. */
|
||||
strcpy(v->con_names[n], name) ;
|
||||
strcpy(v->fun_vals[n], "") ; /* Initially empty function strings. */
|
||||
}
|
||||
|
||||
if ((home = getenv("HOME")) == NULL)
|
||||
@@ -1638,7 +1638,7 @@ show_display(int *MPval)
|
||||
{
|
||||
if (!v->error)
|
||||
{
|
||||
STRCPY(v->display, make_number(MPval, TRUE)) ;
|
||||
strcpy(v->display, make_number(MPval, TRUE)) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
}
|
||||
}
|
||||
@@ -1647,9 +1647,9 @@ show_display(int *MPval)
|
||||
void
|
||||
usage(char *progname)
|
||||
{
|
||||
FPRINTF(stderr, ustrs[(int) USAGE1], PATCHLEVEL) ;
|
||||
FPRINTF(stderr, "%s", ustrs[(int) USAGE2]) ;
|
||||
FPRINTF(stderr, "%s", ustrs[(int) USAGE3]) ;
|
||||
fprintf(stderr, ustrs[(int) USAGE1], PATCHLEVEL) ;
|
||||
fprintf(stderr, "%s", ustrs[(int) USAGE2]) ;
|
||||
fprintf(stderr, "%s", ustrs[(int) USAGE3]) ;
|
||||
exit(1) ;
|
||||
}
|
||||
|
||||
@@ -1668,7 +1668,7 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen
|
||||
struct passwd *entry ; /* The user's /etc/passwd entry. */
|
||||
|
||||
rcexists = 0 ;
|
||||
SPRINTF(rcname, "%s/%s", getcwd(pathname, MAXPATHLEN), RCNAME) ;
|
||||
sprintf(rcname, "%s/%s", getcwd(pathname, MAXPATHLEN), RCNAME) ;
|
||||
if (access(rcname, F_OK) == 0) rcexists = 1 ;
|
||||
else
|
||||
{
|
||||
@@ -1677,17 +1677,17 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen
|
||||
if ((entry = getpwuid(getuid())) == NULL) return ;
|
||||
home = entry->pw_dir ;
|
||||
}
|
||||
SPRINTF(rcname, "%s/%s", home, RCNAME) ;
|
||||
sprintf(rcname, "%s/%s", home, RCNAME) ;
|
||||
if (access(rcname, F_OK) == 0) rcexists = 1 ;
|
||||
}
|
||||
STRCPY(tmp_filename, "/tmp/.dtcalcrcXXXXXX") ;
|
||||
MKTEMP(tmp_filename) ;
|
||||
strcpy(tmp_filename, "/tmp/.dtcalcrcXXXXXX") ;
|
||||
mktemp(tmp_filename) ;
|
||||
if ((tmpfd = fopen(tmp_filename, "w+")) == NULL) return ;
|
||||
|
||||
if (rcexists)
|
||||
{
|
||||
rcfd = fopen(rcname, "r") ;
|
||||
SPRINTF(sval, " %1d", cfno) ;
|
||||
sprintf(sval, " %1d", cfno) ;
|
||||
while (fgets(str, MAXLINE, rcfd))
|
||||
{
|
||||
if (exists)
|
||||
@@ -1695,40 +1695,40 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen
|
||||
switch (mtype)
|
||||
{
|
||||
case M_CON : sval[0] = 'c' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
sval[0] = 'C' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
break ;
|
||||
case M_FUN : sval[0] = 'f' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
sval[0] = 'F' ;
|
||||
if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ;
|
||||
if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
FPRINTF(tmpfd, "%s", str) ;
|
||||
fprintf(tmpfd, "%s", str) ;
|
||||
}
|
||||
FCLOSE(rcfd) ;
|
||||
fclose(rcfd) ;
|
||||
}
|
||||
|
||||
switch (mtype)
|
||||
{
|
||||
case M_CON : FPRINTF(tmpfd, "\nC%1d %s %s\n", cfno, val, comment) ;
|
||||
case M_CON : fprintf(tmpfd, "\nC%1d %s %s\n", cfno, val, comment) ;
|
||||
break ;
|
||||
case M_FUN :
|
||||
if(strcmp(val, "") != 0)
|
||||
FPRINTF(tmpfd, "\nF%1d %s %s\n", cfno, val, comment) ;
|
||||
fprintf(tmpfd, "\nF%1d %s %s\n", cfno, val, comment) ;
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
UNLINK(rcname) ;
|
||||
unlink(rcname) ;
|
||||
rcfd = fopen(rcname, "w") ;
|
||||
REWIND(tmpfd) ;
|
||||
while (fgets(str, MAXLINE, tmpfd)) FPRINTF(rcfd, "%s", str) ;
|
||||
FCLOSE(rcfd) ;
|
||||
FCLOSE(tmpfd);
|
||||
UNLINK(tmp_filename) ;
|
||||
rewind(tmpfd) ;
|
||||
while (fgets(str, MAXLINE, tmpfd)) fprintf(rcfd, "%s", str) ;
|
||||
fclose(rcfd) ;
|
||||
fclose(tmpfd);
|
||||
unlink(tmp_filename) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -1738,7 +1738,7 @@ write_resources(char *filename)
|
||||
char intval[5] ;
|
||||
int MPtemp[MP_SIZE];
|
||||
|
||||
SPRINTF(intval, "%d", v->accuracy) ;
|
||||
sprintf(intval, "%d", v->accuracy) ;
|
||||
put_resource(R_ACCURACY, intval) ;
|
||||
put_resource(R_DISPLAYED, v->display) ;
|
||||
put_resource(R_BASE, base_str[(int) v->base]) ;
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
|
||||
* (c) Copyright 1993, 1994 Novell, Inc. *
|
||||
*/
|
||||
#ifndef _calctool_h
|
||||
#define _calctool_h
|
||||
|
||||
|
||||
#include <float.h>
|
||||
|
||||
@@ -88,14 +91,6 @@ extern char *_DtGetMessage(char *filename, int set, int n, char *s);
|
||||
#endif
|
||||
#endif /* sun */
|
||||
|
||||
/* For all function declarations, if ANSI then use a prototype. */
|
||||
|
||||
#if defined(__STDC__)
|
||||
#define P(args) args
|
||||
#else /* ! __STDC__ */
|
||||
#define P(args) ()
|
||||
#endif /* STDC */
|
||||
|
||||
#ifdef hpux
|
||||
#define HIL_PC101_KBD 1
|
||||
#define HIL_ITF_KBD 2
|
||||
@@ -116,19 +111,6 @@ extern char *_DtGetMessage(char *filename, int set, int n, char *s);
|
||||
|
||||
#define MP_SIZE 150 /* Size of the multiple precision values. */
|
||||
|
||||
#define FCLOSE (void) fclose /* To make lint happy. */
|
||||
#define FPRINTF (void) fprintf
|
||||
#define FPUTS (void) fputs
|
||||
#define FREE (void) free
|
||||
#define MEMCPY (void) memcpy
|
||||
#define MKTEMP (void) mktemp
|
||||
#define REWIND (void) rewind
|
||||
#define SPRINTF (void) sprintf
|
||||
#define SSCANF (void) sscanf
|
||||
#define STRCPY (void) strcpy
|
||||
#define STRNCAT (void) strncat
|
||||
#define UNLINK (void) unlink
|
||||
|
||||
/* Various pseudo events used by the dtcalc program. */
|
||||
#define KEYBOARD_DOWN 100 /* Keyboard character was pressed. */
|
||||
#define KEYBOARD_UP 101 /* Keyboard character was released. */
|
||||
@@ -581,205 +563,206 @@ extern ApplicationArgs application_args;
|
||||
#define dmax(a, b) (double) max(a, b)
|
||||
#define dmin(a, b) (double) min(a, b)
|
||||
|
||||
BOOLEAN ibool P((double)) ;
|
||||
BOOLEAN ibool2 P((double)) ;
|
||||
BOOLEAN ibool(double);
|
||||
BOOLEAN ibool2(double);
|
||||
|
||||
char *convert P((char *)) ;
|
||||
char *get_resource P((enum res_type)) ;
|
||||
char *make_eng_sci P((int *)) ;
|
||||
char *make_fixed P((int *, int)) ;
|
||||
char *make_number P((int *, BOOLEAN)) ;
|
||||
char *convert(char *);
|
||||
char *get_resource(enum res_type);
|
||||
char *make_eng_sci(int *);
|
||||
char *make_fixed(int *, int);
|
||||
char *make_number(int *, BOOLEAN);
|
||||
|
||||
double mppow_di P((double *, int *)) ;
|
||||
double mppow_ri P((float *, int *)) ;
|
||||
double setbool P((BOOLEAN)) ;
|
||||
double mppow_di(double *, int *);
|
||||
double mppow_ri(float *, int *);
|
||||
double setbool(BOOLEAN);
|
||||
|
||||
int char_val P((char)) ;
|
||||
int get_bool_resource P((enum res_type, int *)) ;
|
||||
int get_index P((char)) ;
|
||||
int get_int_resource P((enum res_type, int *)) ;
|
||||
int get_str_resource P((enum res_type, char *)) ;
|
||||
int main P((int, char **)) ;
|
||||
int char_val(char);
|
||||
int get_bool_resource(enum res_type, int *);
|
||||
int get_index(char);
|
||||
int get_int_resource(enum res_type, int *);
|
||||
int get_str_resource(enum res_type, char *);
|
||||
int main(int, char **);
|
||||
|
||||
void beep P(()) ;
|
||||
void check_ow_beep P(()) ;
|
||||
void clear_display P(()) ;
|
||||
void doerr P((char *)) ;
|
||||
void do_accuracy P(()) ;
|
||||
void do_ascii P(()) ;
|
||||
void do_base P(()) ;
|
||||
void set_base P(()) ;
|
||||
void do_business P(()) ;
|
||||
void do_calc P(()) ;
|
||||
void do_dtcalc P((int, char **)) ;
|
||||
void do_clear P(()) ;
|
||||
void do_constant P(()) ;
|
||||
void do_delete P(()) ;
|
||||
void do_exchange P(()) ;
|
||||
void do_expno P(()) ;
|
||||
void do_factorial P((int *, int *)) ;
|
||||
void do_frame P(()) ;
|
||||
void do_function P(()) ;
|
||||
void do_immed P(()) ;
|
||||
void do_keys P(()) ;
|
||||
void do_mode P(()) ;
|
||||
void do_none P(()) ;
|
||||
void do_number P(()) ;
|
||||
void do_numtype P(()) ;
|
||||
void do_paren P(()) ;
|
||||
void set_numtype P((enum num_type dtype));
|
||||
void do_nothing P(()) ;
|
||||
void do_pending P(()) ;
|
||||
void do_point P(()) ;
|
||||
void do_portion P(()) ;
|
||||
double do_round P((double, int)) ;
|
||||
void do_shift P(()) ;
|
||||
void do_sto_rcl P(()) ;
|
||||
void do_trig P(()) ;
|
||||
void do_trigtype P(()) ;
|
||||
void draw_button P((int, enum fcp_type, int, int, int)) ;
|
||||
void get_display P(()) ;
|
||||
void get_key_val P((char *, char *)) ;
|
||||
void get_label P((int)) ;
|
||||
void get_options P((int, char **)) ;
|
||||
void getparam P((char *, char **, char *)) ;
|
||||
void get_rcfile P((char *)) ;
|
||||
void grey_button P((int, int, int)) ;
|
||||
void grey_buttons P((enum base_type)) ;
|
||||
void handle_menu_selection P((int, int)) ;
|
||||
void handle_selection P(()) ;
|
||||
void initialize P(()) ;
|
||||
void init_cmdline_opts P(()) ;
|
||||
void init_graphics P(()) ;
|
||||
void init_options P(()) ;
|
||||
void init_text P(()) ;
|
||||
void init_vars P(()) ;
|
||||
void key_init P(()) ;
|
||||
void load_resources P(()) ;
|
||||
void make_frames P(()) ;
|
||||
void make_items P(()) ;
|
||||
void make_modewin P(()) ;
|
||||
void make_fin_registers P(()) ;
|
||||
void make_registers P((int)) ;
|
||||
void MPstr_to_num P((char *, enum base_type, int *)) ;
|
||||
void paren_disp P((char)) ;
|
||||
void process_event P((int)) ;
|
||||
void process_item P((int)) ;
|
||||
void process_parens P((char)) ;
|
||||
void process_stack P((int, int, int)) ;
|
||||
void process_str P((char *, enum menu_type)) ;
|
||||
void push_num P((int *)) ;
|
||||
void push_op P((int)) ;
|
||||
void put_resource P((enum res_type, char *)) ;
|
||||
void read_rcfiles P(()) ;
|
||||
void read_resources P(()) ;
|
||||
void redraw_buttons P(()) ;
|
||||
void save_cmdline P((int, char **)) ;
|
||||
void save_pending_values P((int)) ;
|
||||
void save_resources P((char *)) ;
|
||||
void blank_display P(()) ;
|
||||
void ErrorDialog P((char *string));
|
||||
void set_item P((enum item_type, char *)) ;
|
||||
void set_title P((enum fcp_type, char *)) ;
|
||||
void show_ascii_frame P(()) ;
|
||||
void show_display P((int *)) ;
|
||||
void srand48 P(()) ;
|
||||
void start_tool P(()) ;
|
||||
void switch_hands P((int)) ;
|
||||
void usage P((char *)) ;
|
||||
void win_display P((enum fcp_type, int)) ;
|
||||
void write_cmdline P(()) ;
|
||||
void write_rcfile P((enum menu_type, int, int, char *, char *)) ;
|
||||
void write_resources P((char *)) ;
|
||||
void RestoreSession P(()) ;
|
||||
void TimerEvent P(( XtPointer, XtIntervalId *)) ;
|
||||
void ErrDialog P(( char *, Widget ));
|
||||
void beep(void);
|
||||
void check_ow_beep(void);
|
||||
void clear_display(void);
|
||||
void doerr(char *);
|
||||
void do_accuracy(void);
|
||||
void do_ascii(void);
|
||||
void do_base(void);
|
||||
void set_base(enum base_type type);
|
||||
void do_business(void);
|
||||
void do_calc(void);
|
||||
void do_dtcalc(int, char **);
|
||||
void do_clear(void);
|
||||
void do_constant(void);
|
||||
void do_delete(void);
|
||||
void do_exchange(void);
|
||||
void do_expno(void);
|
||||
void do_factorial(int *, int *);
|
||||
void do_frame(void);
|
||||
void do_function(void);
|
||||
void do_immed(void);
|
||||
void do_keys(void);
|
||||
void do_mode(void);
|
||||
void do_none(void);
|
||||
void do_number(void);
|
||||
void do_numtype(void);
|
||||
void do_paren(void);
|
||||
void set_numtype(enum num_type dtype);
|
||||
void do_nothing(void);
|
||||
void do_pending(void);
|
||||
void do_point(void);
|
||||
void do_portion(void);
|
||||
double do_round(double, int);
|
||||
void do_shift(void);
|
||||
void do_sto_rcl(void);
|
||||
void do_trig(void);
|
||||
void do_trigtype(void);
|
||||
void draw_button(int, enum fcp_type, int, int, int);
|
||||
void get_display(void);
|
||||
void get_key_val(char *, char *);
|
||||
void get_label(int);
|
||||
void get_options(int, char **);
|
||||
void getparam(char *, char **, char *);
|
||||
void get_rcfile(char *);
|
||||
void grey_button(int, int, int);
|
||||
void grey_buttons(enum base_type);
|
||||
void handle_menu_selection(int, int);
|
||||
void handle_selection(void);
|
||||
void initialize(void);
|
||||
void init_cmdline_opts(void);
|
||||
void init_graphics(void);
|
||||
void init_options(void);
|
||||
void init_text(void);
|
||||
void init_vars(void);
|
||||
void key_init(void);
|
||||
void load_resources(void);
|
||||
void make_frames(void);
|
||||
void make_items(void);
|
||||
void make_modewin(void);
|
||||
void make_fin_registers(void);
|
||||
void make_registers(int);
|
||||
void MPstr_to_num(char *, enum base_type, int *);
|
||||
void paren_disp(char);
|
||||
void process_event(int);
|
||||
void process_item(int);
|
||||
void process_parens(char);
|
||||
void process_stack(int, int, int);
|
||||
void process_str(char *, enum menu_type);
|
||||
void push_num(int *);
|
||||
void push_op(int);
|
||||
void put_resource(enum res_type, char *);
|
||||
void read_rcfiles(void);
|
||||
void read_resources(void);
|
||||
void redraw_buttons(void);
|
||||
void save_cmdline(int, char **);
|
||||
void save_pending_values(int);
|
||||
void save_resources(char *);
|
||||
void blank_display(void);
|
||||
void ErrorDialog(char *string);
|
||||
void set_item(enum item_type, char *);
|
||||
void set_title(enum fcp_type, char *);
|
||||
void show_ascii_frame(void);
|
||||
void show_display(int *);
|
||||
void srand48(long);
|
||||
void start_tool(void);
|
||||
void switch_hands(int);
|
||||
void usage(char *);
|
||||
void win_display(enum fcp_type, int);
|
||||
void write_cmdline(void);
|
||||
void write_rcfile(enum menu_type, int, int, char *, char *);
|
||||
void write_resources(char *);
|
||||
void RestoreSession(void);
|
||||
void TimerEvent(XtPointer, XtIntervalId *);
|
||||
void ErrDialog(char *, Widget );
|
||||
|
||||
/* MP routines not found in the Brent FORTRAN package. */
|
||||
void mpacos P((int *, int *)) ;
|
||||
void mpacosh P((int *, int *)) ;
|
||||
void mpasinh P((int *, int *)) ;
|
||||
void mpatanh P((int *, int *)) ;
|
||||
void mplog10 P((int *, int *)) ;
|
||||
void mpacos(int *, int *);
|
||||
void mpacosh(int *, int *);
|
||||
void mpasinh(int *, int *);
|
||||
void mpatanh(int *, int *);
|
||||
void mplog10(int *, int *);
|
||||
|
||||
/* Brent MP routines in mp.c. */
|
||||
int mpcmpi P((int *, int *)) ;
|
||||
int mpcmpr P((int *, float *)) ;
|
||||
int mpcomp P((int *, int *)) ;
|
||||
int pow_ii P((int *, int *)) ;
|
||||
int mpcmpi(int *, int *);
|
||||
int mpcmpr(int *, float *);
|
||||
int mpcomp(int *, int *);
|
||||
int pow_ii(int *, int *);
|
||||
|
||||
int mpeq P((int *, int *)) ;
|
||||
int mpge P((int *, int *)) ;
|
||||
int mpgt P((int *, int *)) ;
|
||||
int mple P((int *, int *)) ;
|
||||
int mplt P((int *, int *)) ;
|
||||
int mpeq(int *, int *);
|
||||
int mpge(int *, int *);
|
||||
int mpgt(int *, int *);
|
||||
int mple(int *, int *);
|
||||
int mplt(int *, int *);
|
||||
|
||||
void mpabs P((int *, int *)) ;
|
||||
void mpadd P((int *, int *, int *)) ;
|
||||
void mpadd2 P((int *, int *, int *, int *, int *)) ;
|
||||
void mpadd3 P((int *, int *, int *, int *, int *)) ;
|
||||
void mpaddi P((int *, int *, int *)) ;
|
||||
void mpaddq P((int *, int *, int *, int *)) ;
|
||||
void mpart1 P((int *, int *)) ;
|
||||
void mpasin P((int *, int *)) ;
|
||||
void mpatan P((int *, int *)) ;
|
||||
void mpcdm P((double *, int *)) ;
|
||||
void mpchk P((int *, int *)) ;
|
||||
void mpcim P((int *, int *)) ;
|
||||
void mpcmd P((int *, double *)) ;
|
||||
void mpcmf P((int *, int *)) ;
|
||||
void mpcmi P((int *, int *)) ;
|
||||
void mpcmim P((int *, int *)) ;
|
||||
void mpcmr P((int *, float *)) ;
|
||||
void mpcos P((int *, int *)) ;
|
||||
void mpcosh P((int *, int *)) ;
|
||||
void mpcqm P((int *, int *, int *)) ;
|
||||
void mpcrm P((float *, int *)) ;
|
||||
void mpdiv P((int *, int *, int *)) ;
|
||||
void mpdivi P((int *, int *, int *)) ;
|
||||
void mperr P(()) ;
|
||||
void mpexp P((int *, int *)) ;
|
||||
void mpexp1 P((int *, int *)) ;
|
||||
void mpext P((int *, int *, int *)) ;
|
||||
void mpgcd P((int *, int *)) ;
|
||||
void mpln P((int *, int *)) ;
|
||||
void mplns P((int *, int *)) ;
|
||||
void mpmaxr P((int *)) ;
|
||||
void mpmlp P((int *, int *, int *, int *)) ;
|
||||
void mpmul P((int *, int *, int *)) ;
|
||||
void mpmul2 P((int *, int *, int *, int *)) ;
|
||||
void mpmuli P((int *, int *, int *)) ;
|
||||
void mpmulq P((int *, int *, int *, int *)) ;
|
||||
void mpneg P((int *, int *)) ;
|
||||
void mpnzr P((int *, int *, int *, int *)) ;
|
||||
void mpovfl P((int *)) ;
|
||||
void mppi P((int *)) ;
|
||||
void mppwr P((int *, int *, int *)) ;
|
||||
void mppwr2 P((int *, int *, int *)) ;
|
||||
void mprec P((int *, int *)) ;
|
||||
void mproot P((int *, int *, int *)) ;
|
||||
void mpset P((int *, int *, int *)) ;
|
||||
void mpsin P((int *, int *)) ;
|
||||
void mpsin1 P((int *, int *, int *)) ;
|
||||
void mpsinh P((int *, int *)) ;
|
||||
void mpsqrt P((int *, int *)) ;
|
||||
void mpstr P((int *, int *)) ;
|
||||
void mpsub P((int *, int *, int *)) ;
|
||||
void mptanh P((int *, int *)) ;
|
||||
void mpunfl P((int *)) ;
|
||||
void mpabs(int *, int *);
|
||||
void mpadd(int *, int *, int *);
|
||||
void mpadd2(int *, int *, int *, int *, int *);
|
||||
void mpadd3(int *, int *, int *, int *, int *);
|
||||
void mpaddi(int *, int *, int *);
|
||||
void mpaddq(int *, int *, int *, int *);
|
||||
void mpart1(int *, int *);
|
||||
void mpasin(int *, int *);
|
||||
void mpatan(int *, int *);
|
||||
void mpcdm(double *, int *);
|
||||
void mpchk(int *, int *);
|
||||
void mpcim(int *, int *);
|
||||
void mpcmd(int *, double *);
|
||||
void mpcmf(int *, int *);
|
||||
void mpcmi(int *, int *);
|
||||
void mpcmim(int *, int *);
|
||||
void mpcmr(int *, float *);
|
||||
void mpcos(int *, int *);
|
||||
void mpcosh(int *, int *);
|
||||
void mpcqm(int *, int *, int *);
|
||||
void mpcrm(float *, int *);
|
||||
void mpdiv(int *, int *, int *);
|
||||
void mpdivi(int *, int *, int *);
|
||||
void mperr(void);
|
||||
void mpexp(int *, int *);
|
||||
void mpexp1(int *, int *);
|
||||
void mpext(int *, int *, int *);
|
||||
void mpgcd(int *, int *);
|
||||
void mpln(int *, int *);
|
||||
void mplns(int *, int *);
|
||||
void mpmaxr(int *);
|
||||
void mpmlp(int *, int *, int *, int *);
|
||||
void mpmul(int *, int *, int *);
|
||||
void mpmul2(int *, int *, int *, int *);
|
||||
void mpmuli(int *, int *, int *);
|
||||
void mpmulq(int *, int *, int *, int *);
|
||||
void mpneg(int *, int *);
|
||||
void mpnzr(int *, int *, int *, int *);
|
||||
void mpovfl(int *);
|
||||
void mppi(int *);
|
||||
void mppwr(int *, int *, int *);
|
||||
void mppwr2(int *, int *, int *);
|
||||
void mprec(int *, int *);
|
||||
void mproot(int *, int *, int *);
|
||||
void mpset(int *, int *, int *);
|
||||
void mpsin(int *, int *);
|
||||
void mpsin1(int *, int *, int *);
|
||||
void mpsinh(int *, int *);
|
||||
void mpsqrt(int *, int *);
|
||||
void mpstr(int *, int *);
|
||||
void mpsub(int *, int *, int *);
|
||||
void mptanh(int *, int *);
|
||||
void mpunfl(int *);
|
||||
|
||||
/* Help routines */
|
||||
void Help P((char *, char *)) ;
|
||||
void HelpRequestCB P(()) ;
|
||||
void HelpModeCB P(()) ;
|
||||
void HelpCloseCB P(()) ;
|
||||
void HelpHyperlinkCB P(()) ;
|
||||
void DisplayHelp P((char *, char *)) ;
|
||||
void CenterMsgCB P(()) ;
|
||||
void HelpHelp P(()) ;
|
||||
void SetWmHnts P(()) ;
|
||||
void Help(char *, char *);
|
||||
void HelpRequestCB(Widget, caddr_t, caddr_t);
|
||||
void HelpModeCB(Widget, caddr_t, caddr_t);
|
||||
void HelpCloseCB(Widget, caddr_t, caddr_t);
|
||||
void HelpHyperlinkCB(Widget, caddr_t, caddr_t);
|
||||
void DisplayHelp(char *, char *);
|
||||
void CenterMsgCB(Widget, XtPointer, XtPointer);
|
||||
void HelpHelp(void);
|
||||
void SetWmHnts(void);
|
||||
|
||||
void _DtmapCB P((Widget, XtPointer, XtPointer)) ;
|
||||
void _DtmapCB(Widget, XtPointer, XtPointer);
|
||||
|
||||
void set_option_menu P((int, int)) ;
|
||||
void set_option_menu(int, int);
|
||||
|
||||
#endif /* _calctool_h */
|
||||
|
||||
@@ -36,18 +36,14 @@
|
||||
#include <stdlib.h>
|
||||
#include "ds_common.h"
|
||||
|
||||
#define FREE (void) free
|
||||
#define STRCPY (void) strcpy
|
||||
|
||||
|
||||
void
|
||||
read_str(char **str, char *value)
|
||||
{
|
||||
if (*str != NULL) FREE(*str) ;
|
||||
if (*str != NULL) free(*str) ;
|
||||
if (value != NULL && strlen(value))
|
||||
{
|
||||
*str = (char *) malloc((unsigned) (strlen(value) + 1)) ;
|
||||
STRCPY(*str, value) ;
|
||||
strcpy(*str, value) ;
|
||||
}
|
||||
else *str = NULL ;
|
||||
}
|
||||
|
||||
@@ -38,16 +38,8 @@
|
||||
#include <X11/Xresource.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
/* For all function declarations, if ANSI then use a prototype. */
|
||||
char *set_bool(int);
|
||||
|
||||
#if defined(__STDC__)
|
||||
#define P(args) args
|
||||
#else /* ! __STDC__ */
|
||||
#define P(args) ()
|
||||
#endif /* STDC */
|
||||
|
||||
char *set_bool P((int)) ;
|
||||
|
||||
void read_str P((char **, char *)) ;
|
||||
void read_str(char **, char *);
|
||||
|
||||
#endif /*_ds_common_h*/
|
||||
|
||||
@@ -50,7 +50,7 @@ extern XmWidgetExtData _XmGetWidgetExtData(
|
||||
#include "calctool.h"
|
||||
#include "motif.h"
|
||||
|
||||
void _DtChildPosition P((Widget, Widget, Position *, Position *)) ;
|
||||
void _DtChildPosition(Widget, Widget, Position *, Position *);
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
|
||||
@@ -38,14 +38,6 @@
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
/* For all function declarations, if ANSI then use a prototype. */
|
||||
|
||||
#if defined(__STDC__)
|
||||
#define P(args) args
|
||||
#else /* ! __STDC__ */
|
||||
#define P(args) ()
|
||||
#endif /* STDC */
|
||||
|
||||
/* Location ops for ds_position_popup(). */
|
||||
|
||||
enum ds_location_op {
|
||||
@@ -58,12 +50,12 @@ enum ds_location_op {
|
||||
DS_POPUP_CENTERED /* Center popup within baseframe */
|
||||
} ;
|
||||
|
||||
int ds_position_popup P((Widget, Widget, enum ds_location_op)) ;
|
||||
int ds_force_popup_on_screen P((Widget, int *, int *)) ;
|
||||
int ds_position_popup(Widget, Widget, enum ds_location_op);
|
||||
int ds_force_popup_on_screen(Widget, int *, int *);
|
||||
|
||||
void ds_get_screen_size P((Widget, int *, int *)) ;
|
||||
void ds_get_screen_size(Widget, int *, int *);
|
||||
|
||||
void _DtGenericMapWindow P((Widget shell, Widget parent ));
|
||||
void _DtChildPosition P((Widget w, Widget parent, Position *newX, Position *newY));
|
||||
void _DtGenericMapWindow(Widget shell, Widget parent);
|
||||
void _DtChildPosition(Widget w, Widget parent, Position *newX, Position *newY);
|
||||
|
||||
#endif /*!_ds_popup_h*/
|
||||
|
||||
@@ -45,14 +45,6 @@
|
||||
#include <Xm/PushB.h>
|
||||
#include <Xm/TextF.h>
|
||||
|
||||
/* For all function declarations, if ANSI then use a prototype. */
|
||||
|
||||
#if defined(__STDC__)
|
||||
#define P(args) args
|
||||
#else /* ! __STDC__ */
|
||||
#define P(args) ()
|
||||
#endif /* STDC */
|
||||
|
||||
enum choice_type { CH_ACTIVE, CH_VALUE } ; /* Choice operations. */
|
||||
|
||||
/* Text widget operations. */
|
||||
@@ -74,20 +66,20 @@ struct tW_struct { /* Text widget structure. */
|
||||
Widget textfield ; /* xmTextWidgetClass. */
|
||||
} ;
|
||||
|
||||
int get_choice P((struct cW_struct *, enum choice_type)) ;
|
||||
int get_choice(struct cW_struct *, enum choice_type);
|
||||
|
||||
struct cW_struct *make_choiceW P((Widget, char *, char **, int, int,
|
||||
int, void (*)())) ;
|
||||
struct tW_struct *make_textW P((Widget, char *)) ;
|
||||
struct cW_struct *make_choiceW(Widget, char *, char **, int, int,
|
||||
int, void (*)());
|
||||
struct tW_struct *make_textW(Widget, char *);
|
||||
|
||||
Widget make_butW P((Widget, char *)) ;
|
||||
Widget make_labelW P((Widget, char *)) ;
|
||||
Widget make_manW P((char *, Widget, int, int)) ;
|
||||
Widget make_toggleW P((Widget, char *)) ;
|
||||
Widget make_butW(Widget, char *);
|
||||
Widget make_labelW(Widget, char *);
|
||||
Widget make_manW(char *, Widget, int, int);
|
||||
Widget make_toggleW(Widget, char *);
|
||||
|
||||
void set_choice P((struct cW_struct *, enum choice_type, int)) ;
|
||||
void set_choice_help P((struct cW_struct *, char *)) ;
|
||||
void set_text_help P((struct tW_struct *, char *)) ;
|
||||
void set_text_str P((struct tW_struct *, enum text_type, char *)) ;
|
||||
void set_choice(struct cW_struct *, enum choice_type, int);
|
||||
void set_choice_help(struct cW_struct *, char *);
|
||||
void set_text_help(struct tW_struct *, char *);
|
||||
void set_text_str(struct tW_struct *, enum text_type, char *);
|
||||
|
||||
#endif /*_ds_widget_h*/
|
||||
|
||||
@@ -39,31 +39,23 @@
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
/* For all function declarations, if ANSI then use a prototype. */
|
||||
|
||||
#if defined(__STDC__)
|
||||
#define P(args) args
|
||||
#else /* ! __STDC__ */
|
||||
#define P(args) ()
|
||||
#endif /* STDC */
|
||||
|
||||
/* Function declarations. */
|
||||
|
||||
char *ds_get_resource P((XrmDatabase, char *, char *)) ;
|
||||
char *ds_get_resource(XrmDatabase, char *, char *);
|
||||
|
||||
int ds_get_choice_value P((Widget)) ;
|
||||
int ds_get_strwidth P((XFontStruct *, char *)) ;
|
||||
int ds_save_resources P((XrmDatabase, char *)) ;
|
||||
int ds_get_choice_value(Widget) ;
|
||||
int ds_get_strwidth(XFontStruct *, char *);
|
||||
int ds_save_resources(XrmDatabase, char *) ;
|
||||
|
||||
void ds_add_help P((Widget, char *)) ;
|
||||
void ds_beep P((Display *)) ;
|
||||
void ds_get_geometry_size P((char *, int *, int *)) ;
|
||||
void ds_get_frame_size P((Widget, int *, int *, int *, int *)) ;
|
||||
void ds_put_resource P((XrmDatabase *, char *, char *, char *)) ;
|
||||
void ds_save_cmdline P((Display *, Window, int, char **)) ;
|
||||
void ds_set_choice_value P((Widget, int)) ;
|
||||
void ds_set_frame_size P((Widget, int, int, int, int)) ;
|
||||
void ds_add_help(Widget, char *);
|
||||
void ds_beep(Display *);
|
||||
void ds_get_geometry_size(char *, int *, int *);
|
||||
void ds_get_frame_size(Widget, int *, int *, int *, int *);
|
||||
void ds_put_resource(XrmDatabase *, char *, char *, char *);
|
||||
void ds_save_cmdline(Display *, Window, int, char **);
|
||||
void ds_set_choice_value(Widget, int);
|
||||
void ds_set_frame_size(Widget, int, int, int, int);
|
||||
|
||||
XrmDatabase ds_load_resources P((Display *)) ;
|
||||
XrmDatabase ds_load_resources(Display *);
|
||||
|
||||
#endif /*_ds_xlib_h*/
|
||||
|
||||
@@ -336,7 +336,7 @@ do_business(void) /* Perform special business mode calculations. */
|
||||
make_registers(FIN) ;
|
||||
v->funstate = 1;
|
||||
|
||||
STRCPY(v->display, display_number);
|
||||
strcpy(v->display, display_number);
|
||||
set_item(DISPLAYITEM, v->display);
|
||||
need_show = FALSE;
|
||||
}
|
||||
@@ -641,15 +641,15 @@ do_expno(void) /* Get exponential number. */
|
||||
v->pointed = (strchr(v->display, '.') != NULL) ;
|
||||
if (!v->new_input)
|
||||
{
|
||||
STRCPY(v->display, "1.0 +") ;
|
||||
strcpy(v->display, "1.0 +") ;
|
||||
v->new_input = v->pointed = 1 ;
|
||||
}
|
||||
else if (!v->pointed)
|
||||
{
|
||||
STRNCAT(v->display, ". +", 3) ;
|
||||
strncat(v->display, ". +", 3) ;
|
||||
v->pointed = 1 ;
|
||||
}
|
||||
else if (!v->key_exp) STRNCAT(v->display, " +", 2) ;
|
||||
else if (!v->key_exp) strncat(v->display, " +", 2) ;
|
||||
v->toclear = 0 ;
|
||||
v->key_exp = 1 ;
|
||||
v->exp_posn = strchr(v->display, '+') ;
|
||||
@@ -910,7 +910,7 @@ do_number(void)
|
||||
|
||||
if (v->toclear)
|
||||
{
|
||||
SPRINTF(v->display, "%c", nextchar) ;
|
||||
sprintf(v->display, "%c", nextchar) ;
|
||||
v->toclear = 0 ;
|
||||
}
|
||||
else
|
||||
@@ -990,7 +990,7 @@ do_paren(void)
|
||||
if(tmpdb == 0.0)
|
||||
{
|
||||
v->cur_op = '?';
|
||||
STRCPY(v->display, "") ;
|
||||
strcpy(v->display, "") ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
}
|
||||
else
|
||||
@@ -1009,7 +1009,7 @@ do_paren(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
STRCPY(v->display, "") ;
|
||||
strcpy(v->display, "") ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
}
|
||||
}
|
||||
@@ -1127,10 +1127,10 @@ do_point(void) /* Handle numeric point. */
|
||||
{
|
||||
if (v->toclear)
|
||||
{
|
||||
STRCPY(v->display, ".") ;
|
||||
strcpy(v->display, ".") ;
|
||||
v->toclear = 0 ;
|
||||
}
|
||||
else STRNCAT(v->display, ".", 1) ;
|
||||
else strncat(v->display, ".", 1) ;
|
||||
v->pointed = 1 ;
|
||||
}
|
||||
else
|
||||
@@ -1644,7 +1644,7 @@ process_parens(char current)
|
||||
{
|
||||
set_item(DISPLAYITEM, vstrs[(int) V_ERROR]) ;
|
||||
set_item(OPITEM, vstrs[(int) V_CLR]) ;
|
||||
STRCPY(v->display, vstrs[(int) V_ERROR]) ;
|
||||
strcpy(v->display, vstrs[(int) V_ERROR]) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1664,7 +1664,7 @@ push_num(int *MPval) /* Try to push value onto the numeric stack. */
|
||||
if (v->numsptr < 0) return ;
|
||||
if (v->numsptr >= MAXSTACK)
|
||||
{
|
||||
STRCPY(v->display, vstrs[(int) V_NUMSTACK]) ;
|
||||
strcpy(v->display, vstrs[(int) V_NUMSTACK]) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
v->error = 1 ;
|
||||
beep() ;
|
||||
@@ -1686,7 +1686,7 @@ push_op(int val) /* Try to push value onto the operand stack. */
|
||||
if (v->opsptr < 0) return ;
|
||||
if (v->opsptr >= MAXSTACK)
|
||||
{
|
||||
STRCPY(v->display, vstrs[(int) V_OPSTACK]) ;
|
||||
strcpy(v->display, vstrs[(int) V_OPSTACK]) ;
|
||||
set_item(DISPLAYITEM, v->display) ;
|
||||
v->error = 1 ;
|
||||
set_item(OPITEM, vstrs[(int) V_CLR]) ;
|
||||
|
||||
@@ -56,7 +56,7 @@ extern struct button buttons[] ; /* Calculator button values. */
|
||||
|
||||
extern Boolean ignore_event;
|
||||
extern XtIntervalId timerId;
|
||||
extern void _DtChildPosition P((Widget, Widget, Position *, Position *)) ;
|
||||
extern void _DtChildPosition(Widget, Widget, Position *, Position *);
|
||||
|
||||
typedef struct _helpStruct {
|
||||
struct _helpStruct *pNext;
|
||||
@@ -65,8 +65,8 @@ typedef struct _helpStruct {
|
||||
Boolean inUse;
|
||||
} HelpStruct;
|
||||
|
||||
static Widget GetHelpDialog P(()) ;
|
||||
static void UnmanageCB P(()) ;
|
||||
static Widget GetHelpDialog(void);
|
||||
static void UnmanageCB(Widget, XtPointer, XtPointer) ;
|
||||
|
||||
void
|
||||
Help(char *helpVolume, char *locationId)
|
||||
|
||||
@@ -187,47 +187,47 @@ typedef struct
|
||||
Window icon;
|
||||
} WM_STATE;
|
||||
|
||||
void menu_proc P((Widget, XtPointer, XtPointer)) ;
|
||||
void show_ascii P((Widget, XtPointer, XtPointer)) ;
|
||||
void write_cf_value P((Widget, XtPointer, XtPointer)) ;
|
||||
void close_cf P((Widget, XtPointer, XtPointer)) ;
|
||||
void close_ascii P((Widget, XtPointer, XtPointer)) ;
|
||||
void move_cf P((Widget, XtPointer, XtPointer)) ;
|
||||
void FocusInCB P((Widget, XtPointer, XtPointer)) ;
|
||||
void map_popup P((Widget, XtPointer, XtPointer)) ;
|
||||
void menu_proc(Widget, XtPointer, XtPointer);
|
||||
void show_ascii(Widget, XtPointer, XtPointer);
|
||||
void write_cf_value(Widget, XtPointer, XtPointer);
|
||||
void close_cf(Widget, XtPointer, XtPointer);
|
||||
void close_ascii(Widget, XtPointer, XtPointer);
|
||||
void move_cf(Widget, XtPointer, XtPointer);
|
||||
void FocusInCB(Widget, XtPointer, XtPointer);
|
||||
void map_popup(Widget, XtPointer, XtPointer);
|
||||
|
||||
static int event_is_keypad P((XEvent *)) ;
|
||||
static int get_next_event P((Widget, int, XEvent *)) ;
|
||||
static int is_window_showing P((Widget)) ;
|
||||
static int event_is_keypad(XEvent *);
|
||||
static int get_next_event(Widget, int, XEvent *);
|
||||
static int is_window_showing(Widget);
|
||||
|
||||
static KeySym keypad_keysym P((XEvent *)) ;
|
||||
static KeySym keypad_keysym(XEvent *);
|
||||
|
||||
static void modelineValueChanged P((Widget, XtPointer, XtPointer)) ;
|
||||
static void dtcalc_kkeyboard_create P((Widget)) ;
|
||||
static void dtcalc_kpanel_create P((Widget)) ;
|
||||
static void confirm_callback P((Widget, XtPointer, XtPointer)) ;
|
||||
static void create_cfframe P(()) ;
|
||||
static void create_menu P((enum menu_type, Widget, int)) ;
|
||||
static void do_button P((Widget, XtPointer, XtPointer)) ;
|
||||
static void do_confirm_notice P((Widget, char *)) ;
|
||||
static void do_continue_notice P((Widget, char *)) ;
|
||||
static void close_reg P((Widget, XtPointer, XtPointer)) ;
|
||||
static void event_proc P((Widget, XtPointer, XEvent *, Boolean *)) ;
|
||||
static void frame_interpose P((Widget, XtPointer, XEvent *, Boolean *)) ;
|
||||
static void menu_handler P((Widget, XtPointer, XEvent *, Boolean *)) ;
|
||||
static void popupHandler P((Widget, XtPointer, XEvent *, Boolean *)) ;
|
||||
static void new_cf_value P((Widget, XtPointer, XtPointer)) ;
|
||||
static void do_memory P((Widget, XtPointer, XtPointer)) ;
|
||||
static void switch_mode P((enum mode_type)) ;
|
||||
static void update_cf_value P(()) ;
|
||||
static void xerror_interpose P((Display *, XErrorEvent *)) ;
|
||||
static void modelineValueChanged(Widget, XtPointer, XtPointer);
|
||||
static void dtcalc_kkeyboard_create(Widget);
|
||||
static void dtcalc_kpanel_create(Widget);
|
||||
static void confirm_callback(Widget, XtPointer, XtPointer);
|
||||
static void create_cfframe(void);
|
||||
static void create_menu(enum menu_type, Widget, int);
|
||||
static void do_button(Widget, XtPointer, XtPointer);
|
||||
static void do_confirm_notice(Widget, char *);
|
||||
static void do_continue_notice(Widget, char *);
|
||||
static void close_reg(Widget, XtPointer, XtPointer);
|
||||
static void event_proc(Widget, XtPointer, XEvent *, Boolean *);
|
||||
static void frame_interpose(Widget, XtPointer, XEvent *, Boolean *);
|
||||
static void menu_handler(Widget, XtPointer, XEvent *, Boolean *);
|
||||
static void popupHandler(Widget, XtPointer, XEvent *, Boolean *);
|
||||
static void new_cf_value(Widget, XtPointer, XtPointer);
|
||||
static void do_memory(Widget, XtPointer, XtPointer);
|
||||
static void switch_mode(enum mode_type);
|
||||
static void update_cf_value(void);
|
||||
static void xerror_interpose(Display *, XErrorEvent *);
|
||||
|
||||
static Widget button_create P((Widget, int, int, int, int)) ;
|
||||
static void save_state P((Widget, XtPointer, XtPointer)) ;
|
||||
static void SaveSession P(( char *, char * )) ;
|
||||
static void setCalcHints P(()) ;
|
||||
static Widget button_create(Widget, int, int, int, int);
|
||||
static void save_state(Widget, XtPointer, XtPointer);
|
||||
static void SaveSession(char *, char *);
|
||||
static void setCalcHints(void);
|
||||
|
||||
static char * _DtcalcStripSpaces P(( char * )) ;
|
||||
static char * _DtcalcStripSpaces(char *);
|
||||
|
||||
static void ProcessMotifSelection(Widget);
|
||||
static void create_menu_bar(Widget parent);
|
||||
@@ -295,7 +295,7 @@ main(int argc, char **argv)
|
||||
|
||||
tmpStr = GETMESSAGE(2, 31, "Could not open display.\n");
|
||||
msg = XtNewString(tmpStr);
|
||||
FPRINTF(stderr, "%s", msg) ;
|
||||
fprintf(stderr, "%s", msg) ;
|
||||
exit(1) ;
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ button_create(Widget owner, int row, int column, int maxrows, int maxcols)
|
||||
if (mtype != M_NONE) create_menu(mtype, button, n) ;
|
||||
val = (v->curwin << 16) + n ;
|
||||
XtAddCallback(button, XmNactivateCallback, do_button, (XtPointer) val) ;
|
||||
XtAddCallback(button, XmNhelpCallback, HelpRequestCB, (XtPointer) val) ;
|
||||
XtAddCallback(button, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) val) ;
|
||||
XtAddEventHandler(button, KeyPressMask | KeyReleaseMask,
|
||||
FALSE, event_proc, NULL) ;
|
||||
|
||||
@@ -504,7 +504,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
||||
XmNdefaultPosition, FALSE,
|
||||
NULL) ;
|
||||
|
||||
SPRINTF(str, "register%1d", 0) ;
|
||||
sprintf(str, "register%1d", 0) ;
|
||||
X->registers[0] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
@@ -518,7 +518,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
||||
|
||||
for (i = 1; i < MAXREGS; i++)
|
||||
{
|
||||
SPRINTF(str, "register%1d", i) ;
|
||||
sprintf(str, "register%1d", i) ;
|
||||
X->registers[i] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
@@ -587,7 +587,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
||||
XmNdefaultPosition, FALSE,
|
||||
NULL) ;
|
||||
|
||||
SPRINTF(str, "fregister%1d", 0) ;
|
||||
sprintf(str, "fregister%1d", 0) ;
|
||||
X->fregisters[0] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
@@ -601,7 +601,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
||||
|
||||
for (i = 1; i < FINREGS; i++)
|
||||
{
|
||||
SPRINTF(str, "fregister%1d", i) ;
|
||||
sprintf(str, "fregister%1d", i) ;
|
||||
X->fregisters[i] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
@@ -615,7 +615,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
||||
NULL) ;
|
||||
}
|
||||
|
||||
SPRINTF(str, "fregistervals%1d", 0) ;
|
||||
sprintf(str, "fregistervals%1d", 0) ;
|
||||
X->fregistersvals[0] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
@@ -632,7 +632,7 @@ dtcalc_initialize_rframe(Widget owner, int type)
|
||||
|
||||
for (i = 1; i < FINREGS; i++)
|
||||
{
|
||||
SPRINTF(str, "fregistervals%1d", i) ;
|
||||
sprintf(str, "fregistervals%1d", i) ;
|
||||
X->fregistersvals[i] = XtVaCreateManagedWidget(str,
|
||||
xmLabelWidgetClass,
|
||||
form,
|
||||
@@ -806,7 +806,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL) ;
|
||||
XtAddCallback(X->textFrame, XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->textFrame, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer)HELP_DISPLAY) ;
|
||||
|
||||
X->textForm = XtVaCreateManagedWidget("textForm",
|
||||
@@ -816,7 +816,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XmNbackground, tmp_pixelbg,
|
||||
XmNforeground, tmp_pixelfg,
|
||||
NULL) ;
|
||||
XtAddCallback(X->textForm, XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->textForm, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer)HELP_DISPLAY) ;
|
||||
|
||||
X->modevals[(int) DISPLAYITEM] = XtVaCreateManagedWidget("display",
|
||||
@@ -833,7 +833,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XmNbackground, tmp_pixelbg,
|
||||
XmNforeground, tmp_pixelfg,
|
||||
NULL) ;
|
||||
XtAddCallback(X->modevals[(int) DISPLAYITEM], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[(int) DISPLAYITEM], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_DISPLAY) ;
|
||||
XtAddEventHandler(X->modevals[(int) DISPLAYITEM],
|
||||
KeyPressMask | KeyReleaseMask, FALSE, event_proc, NULL) ;
|
||||
@@ -851,7 +851,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XmNleftAttachment, XmATTACH_FORM,
|
||||
XmNnavigationType, XmTAB_GROUP,
|
||||
NULL) ;
|
||||
XtAddCallback(X->modeFrame, XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modeFrame, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_MODELINE) ;
|
||||
|
||||
X->modeline = XtVaCreateManagedWidget("modeline",
|
||||
@@ -859,7 +859,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
X->modeFrame,
|
||||
XmNshadowThickness, 0,
|
||||
NULL) ;
|
||||
XtAddCallback(X->modeline, XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modeline, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_MODELINE) ;
|
||||
|
||||
label_string = XmStringCreateLocalized (" ");
|
||||
@@ -873,7 +873,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XmNalignment, XmALIGNMENT_CENTER,
|
||||
XmNlabelString, label_string,
|
||||
NULL) ;
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_MODELINE) ;
|
||||
|
||||
i = (int) HYPITEM;
|
||||
@@ -887,7 +887,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XmNalignment, XmALIGNMENT_CENTER,
|
||||
XmNlabelString, label_string,
|
||||
NULL) ;
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_MODELINE) ;
|
||||
|
||||
i = (int) INVITEM;
|
||||
@@ -901,7 +901,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XmNalignment, XmALIGNMENT_CENTER,
|
||||
XmNlabelString, label_string,
|
||||
NULL) ;
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_MODELINE) ;
|
||||
XmStringFree(label_string);
|
||||
|
||||
@@ -952,7 +952,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XtSetArg(args[n], XmNmenuHistory, modeArry[(int)v->modetype]); n++;
|
||||
X->modevals[i] = XmCreateOptionMenu(X->modeline, "mode", args, n);
|
||||
XtManageChild (X->modevals[i]);
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_MODE) ;
|
||||
|
||||
XtOverrideTranslations(X->modevals[i], trans_table);
|
||||
@@ -1016,7 +1016,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XtSetArg(args[n], XmNmenuHistory, X->baseWidgArry[(int)v->base]); n++;
|
||||
X->modevals[i] = XmCreateOptionMenu(X->modeline, "base", args, n);
|
||||
XtManageChild (X->modevals[i]);
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_BASE) ;
|
||||
|
||||
XtOverrideTranslations(X->modevals[i], trans_table);
|
||||
@@ -1070,7 +1070,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XtSetArg(args[n], XmNmenuHistory, X->numWidgArry[(int)v->dtype]); n++;
|
||||
X->modevals[i] = XmCreateOptionMenu(X->modeline, "num", args, n);
|
||||
XtManageChild (X->modevals[i]);
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_NOTATION) ;
|
||||
|
||||
XtOverrideTranslations(X->modevals[i], trans_table);
|
||||
@@ -1128,7 +1128,7 @@ dtcalc_kpanel_create(Widget owner)
|
||||
XtSetArg(args[n], XmNmenuHistory, X->ttypeWidgArry[(int)v->ttype]); n++;
|
||||
X->modevals[i] = XmCreateOptionMenu(X->modeline, "trig", args, n);
|
||||
XtManageChild (X->modevals[i]);
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_TRIG) ;
|
||||
|
||||
XtOverrideTranslations(X->modevals[i], trans_table);
|
||||
@@ -1825,7 +1825,7 @@ ProcessMotifSelection(Widget W)
|
||||
display[i+1] = '\0';
|
||||
}
|
||||
|
||||
STRCPY(v->display, display);
|
||||
strcpy(v->display, display);
|
||||
XtFree(display);
|
||||
}
|
||||
|
||||
@@ -2054,7 +2054,7 @@ get_resource(enum res_type rtype)
|
||||
{
|
||||
char str[MAXLINE] ;
|
||||
|
||||
STRCPY(str, calc_res[(int) rtype]) ;
|
||||
strcpy(str, calc_res[(int) rtype]) ;
|
||||
return(ds_get_resource(X->rDB, v->appname, str)) ;
|
||||
}
|
||||
|
||||
@@ -2174,7 +2174,7 @@ make_frames(void)
|
||||
{
|
||||
tool_label = (char *) calloc(1, strlen(lstrs[(int) L_UCALC]) + 3);
|
||||
|
||||
SPRINTF(tool_label, "%s", lstrs[(int) L_UCALC]);
|
||||
sprintf(tool_label, "%s", lstrs[(int) L_UCALC]);
|
||||
}
|
||||
else read_str(&tool_label, v->titleline) ;
|
||||
|
||||
@@ -2227,7 +2227,7 @@ make_registers(int type)
|
||||
{
|
||||
for (i = 0; i < MAXREGS; i++)
|
||||
{
|
||||
SPRINTF(line, "%s: %s", menu_entries[i + 10].str,
|
||||
sprintf(line, "%s: %s", menu_entries[i + 10].str,
|
||||
make_number(v->MPmvals[i], FALSE)) ;
|
||||
|
||||
{
|
||||
@@ -2350,7 +2350,7 @@ new_cf_value(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
XmStringFree(cstr) ;
|
||||
|
||||
XtRemoveAllCallbacks(X->CFpi_butHelp, XmNactivateCallback);
|
||||
XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, HelpRequestCB,
|
||||
XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_CONSTANT);
|
||||
}
|
||||
else
|
||||
@@ -2363,7 +2363,7 @@ new_cf_value(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
XmStringFree(cstr) ;
|
||||
|
||||
XtRemoveAllCallbacks(X->CFpi_butHelp, XmNactivateCallback);
|
||||
XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, HelpRequestCB,
|
||||
XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_FUNCTION);
|
||||
}
|
||||
|
||||
@@ -2633,7 +2633,7 @@ show_ascii_frame(void) /* Display ASCII popup. */
|
||||
XtAddCallback(X->Api_butOK, XmNactivateCallback, show_ascii, NULL) ;
|
||||
XtAddCallback(X->Api_butClose, XmNactivateCallback, close_ascii,
|
||||
(XtPointer) NULL) ;
|
||||
XtAddCallback(X->Api_butHelp, XmNactivateCallback, HelpRequestCB,
|
||||
XtAddCallback(X->Api_butHelp, XmNactivateCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer) HELP_ASCII) ;
|
||||
|
||||
j = 0;
|
||||
@@ -2975,7 +2975,7 @@ update_cf_value(void)
|
||||
}
|
||||
/* need to run a "compute" of what was typed in */
|
||||
len = strlen(X->vval) ;
|
||||
STRCPY(str, X->vval);
|
||||
strcpy(str, X->vval);
|
||||
if(X->vval[len - 1] != '=')
|
||||
{
|
||||
/* need to add an '=' at the end of the string so it
|
||||
@@ -3007,8 +3007,8 @@ update_cf_value(void)
|
||||
toclear = v->toclear;
|
||||
tstate = v->tstate;
|
||||
pending = v->pending;
|
||||
STRCPY(display, v->display);
|
||||
STRCPY(fnum, v->fnum);
|
||||
strcpy(display, v->display);
|
||||
strcpy(fnum, v->fnum);
|
||||
mpstr(v->MPdisp_val, MPdisp_val);
|
||||
mpstr(v->MPlast_input, MPlast_input);
|
||||
mpstr(v->MPresult, MPresult);
|
||||
@@ -3025,7 +3025,7 @@ update_cf_value(void)
|
||||
/* get the computed value */
|
||||
accuracy = v->accuracy;
|
||||
v->accuracy = 9 ;
|
||||
STRCPY(result, make_number(v->MPresult, FALSE)) ;
|
||||
strcpy(result, make_number(v->MPresult, FALSE)) ;
|
||||
v->accuracy = accuracy ;
|
||||
|
||||
/* return to previous state */
|
||||
@@ -3036,8 +3036,8 @@ update_cf_value(void)
|
||||
v->toclear = toclear;
|
||||
v->tstate = tstate;
|
||||
v->pending = pending;
|
||||
STRCPY(v->display, display);
|
||||
STRCPY(v->fnum, fnum);
|
||||
strcpy(v->display, display);
|
||||
strcpy(v->fnum, fnum);
|
||||
mpstr(MPdisp_val, v->MPdisp_val);
|
||||
mpstr(MPlast_input, v->MPlast_input);
|
||||
mpstr(MPresult, v->MPresult);
|
||||
@@ -3048,7 +3048,7 @@ update_cf_value(void)
|
||||
ptr = DtStrchr(result, 'e');
|
||||
if (n != 1 || ptr != NULL || v->error == TRUE)
|
||||
{
|
||||
SPRINTF(message, "%s\n%s", vstrs[(int) V_INVCON],
|
||||
sprintf(message, "%s\n%s", vstrs[(int) V_INVCON],
|
||||
vstrs[(int) V_NOCHANGE]) ;
|
||||
do_continue_notice(X->CFframe, message) ;
|
||||
set_item(OPITEM, "") ;
|
||||
@@ -3066,7 +3066,7 @@ update_cf_value(void)
|
||||
{
|
||||
len = strlen(result);
|
||||
|
||||
STRCPY(str, result);
|
||||
strcpy(str, result);
|
||||
for(i=0; i < len; i++)
|
||||
str[i] = str[i+1];
|
||||
MPstr_to_num(str, DEC, v->MPcon_vals[X->cfno]) ;
|
||||
@@ -3085,7 +3085,7 @@ update_cf_value(void)
|
||||
len--;
|
||||
}
|
||||
}
|
||||
SPRINTF(v->con_names[X->cfno], "%1d: %s [%s]",
|
||||
sprintf(v->con_names[X->cfno], "%1d: %s [%s]",
|
||||
X->cfno, result, X->dval) ;
|
||||
break ;
|
||||
case M_FUN : tmpStr = GETMESSAGE(3, 45, ".");
|
||||
@@ -3100,14 +3100,14 @@ update_cf_value(void)
|
||||
ptr = DtStrchr(X->vval, tmpStr[0]);
|
||||
}
|
||||
}
|
||||
STRCPY(v->fun_vals[X->cfno], convert(X->vval)) ;
|
||||
strcpy(v->fun_vals[X->cfno], convert(X->vval)) ;
|
||||
if(strcmp(X->vval, "") != 0)
|
||||
{
|
||||
SPRINTF(v->fun_names[X->cfno], "%1d: %s [%s]",
|
||||
sprintf(v->fun_names[X->cfno], "%1d: %s [%s]",
|
||||
X->cfno, X->vval, X->dval) ;
|
||||
}
|
||||
else
|
||||
STRCPY(v->fun_names[X->cfno], "");
|
||||
strcpy(v->fun_names[X->cfno], "");
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
@@ -3211,13 +3211,13 @@ write_cf_value(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
X->dval[40] = '\0';
|
||||
X->vval = XmTextFieldGetString(X->CFpi_vtext->textfield);
|
||||
X->cfval = XmTextFieldGetString(X->CFpi_cftext->textfield);
|
||||
SSCANF(X->cfval, "%d", &X->cfno) ;
|
||||
sscanf(X->cfval, "%d", &X->cfno) ;
|
||||
if ((strcmp(X->cfval, "") == 0) || X->cfval[0] < '0' || X->cfval[0] > '9' ||
|
||||
X->cfno < 0 || X->cfno > 9)
|
||||
{
|
||||
SPRINTF(str, "%s", (X->CFtype == M_CON) ? vstrs[(int) V_LCON]
|
||||
sprintf(str, "%s", (X->CFtype == M_CON) ? vstrs[(int) V_LCON]
|
||||
: vstrs[(int) V_LFUN]) ;
|
||||
SPRINTF(message, "%s\n%s", str, vstrs[(int) V_RANGE]) ;
|
||||
sprintf(message, "%s\n%s", str, vstrs[(int) V_RANGE]) ;
|
||||
do_continue_notice(X->CFframe, message) ;
|
||||
return ;
|
||||
}
|
||||
@@ -3234,10 +3234,10 @@ write_cf_value(Widget widget, XtPointer client_data, XtPointer call_data)
|
||||
}
|
||||
if (X->cfexists)
|
||||
{
|
||||
SPRINTF(str, mess[(int) MESS_CON],
|
||||
sprintf(str, mess[(int) MESS_CON],
|
||||
(X->CFtype == M_CON) ? vstrs[(int) V_UCON]
|
||||
: vstrs[(int) V_UFUN], X->cfno) ;
|
||||
SPRINTF(message, "%s\n%s", str, vstrs[(int) V_OWRITE]) ;
|
||||
sprintf(message, "%s\n%s", str, vstrs[(int) V_OWRITE]) ;
|
||||
XtUnmanageChild(X->CFframe) ;
|
||||
do_confirm_notice(X->CFframe, message) ;
|
||||
}
|
||||
@@ -3310,7 +3310,7 @@ create_menu_bar(Widget parent)
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++;
|
||||
X->menubar = XmCreateMenuBar(parent, "mainMenu", args, n);
|
||||
XtManageChild(X->menubar);
|
||||
XtAddCallback(X->menubar, XmNhelpCallback, HelpRequestCB,
|
||||
XtAddCallback(X->menubar, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB,
|
||||
(XtPointer)HELP_MENUBAR);
|
||||
|
||||
mnemonic = GETMESSAGE(2, 13, "O");
|
||||
@@ -4402,7 +4402,7 @@ RestoreSession(void)
|
||||
|
||||
if (get_str_resource(R_DISPLAYED, str))
|
||||
{
|
||||
STRCPY(v->display, str);
|
||||
strcpy(v->display, str);
|
||||
MPstr_to_num(str, v->base, v->MPdisp_val) ;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ extern struct menu_entry menu_entries[] ; /* All the menu strings. */
|
||||
|
||||
extern Vars v ; /* Calctool variables and options. */
|
||||
|
||||
void init_mess P(()) ;
|
||||
void init_mess(void);
|
||||
|
||||
/* The following are all the strings used by the dtcalc program.
|
||||
* They are initialized in init_text() to the local language equivalents.
|
||||
@@ -395,16 +395,16 @@ init_text(void) /* Setup text strings depending upon language. */
|
||||
calc_res[(int) R_MENUBAR] = DGET("postMenuBar") ;
|
||||
calc_res[(int) R_KEYS] = DGET("keys") ;
|
||||
|
||||
STRCPY(v->con_names[0], LGET(GETMESSAGE(3, 119, "kilometers per hour <=> miles per hour."))) ;
|
||||
STRCPY(v->con_names[1], LGET(GETMESSAGE(3, 120, "square root of 2."))) ;
|
||||
STRCPY(v->con_names[2], LGET(GETMESSAGE(3, 121, "e."))) ;
|
||||
STRCPY(v->con_names[3], LGET(GETMESSAGE(3, 122, "pi."))) ;
|
||||
STRCPY(v->con_names[4], LGET(GETMESSAGE(3, 123, "centimeters <=> inch."))) ;
|
||||
STRCPY(v->con_names[5], LGET(GETMESSAGE(3, 124, "degrees in a radian."))) ;
|
||||
STRCPY(v->con_names[6], LGET(GETMESSAGE(3, 125, "2 ^ 20."))) ;
|
||||
STRCPY(v->con_names[7], LGET(GETMESSAGE(3, 126, "grams <=> ounce."))) ;
|
||||
STRCPY(v->con_names[8], LGET(GETMESSAGE(3, 127, "kilojoules <=> British thermal units."))) ;
|
||||
STRCPY(v->con_names[9], LGET(GETMESSAGE(3, 128, "cubic centimeters <=> cubic inches."))) ;
|
||||
strcpy(v->con_names[0], LGET(GETMESSAGE(3, 119, "kilometers per hour <=> miles per hour."))) ;
|
||||
strcpy(v->con_names[1], LGET(GETMESSAGE(3, 120, "square root of 2."))) ;
|
||||
strcpy(v->con_names[2], LGET(GETMESSAGE(3, 121, "e."))) ;
|
||||
strcpy(v->con_names[3], LGET(GETMESSAGE(3, 122, "pi."))) ;
|
||||
strcpy(v->con_names[4], LGET(GETMESSAGE(3, 123, "centimeters <=> inch."))) ;
|
||||
strcpy(v->con_names[5], LGET(GETMESSAGE(3, 124, "degrees in a radian."))) ;
|
||||
strcpy(v->con_names[6], LGET(GETMESSAGE(3, 125, "2 ^ 20."))) ;
|
||||
strcpy(v->con_names[7], LGET(GETMESSAGE(3, 126, "grams <=> ounce."))) ;
|
||||
strcpy(v->con_names[8], LGET(GETMESSAGE(3, 127, "kilojoules <=> British thermal units."))) ;
|
||||
strcpy(v->con_names[9], LGET(GETMESSAGE(3, 128, "cubic centimeters <=> cubic inches."))) ;
|
||||
|
||||
/* Keyboard equivalents for the dtcalc menu entries. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user