2
3
4
5
6
7
8
11
12
13
14
15
16
17
18
19
20
29Menu *
new_menu(Init *init,
int,
char **,
int,
int);
30Pick *
new_pick(Init *init,
int,
char **,
int,
int);
31Form *
new_form(Init *init,
int,
char **,
int,
int);
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
72 Init *init = calloc(1,
sizeof(Init));
88 for (i = 0; i < init
->argc; i++)
92 init
->sio = (SIO *)calloc(1,
sizeof(SIO));
101
102
103
104
139
140
141
142
143
144
145
146
147
148Menu *
new_menu(Init *init,
int argc,
char **argv,
int begy,
int begx) {
149 init
->menu = (Menu *)calloc(1,
sizeof(Menu));
157 abend(-1
, "init_menu_files failed");
165
166
167
168
191
192
193
194
195
196
197
198
199
200Pick *
new_pick(Init *init,
int argc,
char **argv,
int begy,
int begx) {
201 init
->pick = (Pick *)calloc(1,
sizeof(Pick));
209 abend(-1
, "init_pick_files failed");
216 "calloc pick->object = calloc(%d, %d) failed\n",
219 abend(-1
, "User terminated program");
226
227
228
229
244
245
246
247
248
249
250
251
252
253Form *
new_form(Init *init,
int argc,
char **argv,
int begy,
int begx) {
254 init
->form = (Form *)calloc(1,
sizeof(Form));
262 abend(-1
, "init_form_files failed");
272
273
274
275
297
298
299
302 init
->view = (View *)calloc(1,
sizeof(View));
306 __LINE__ - 1
, errno
);
311 abend(-1
, "calloc init->view failed");
321 __LINE__ - 1
, errno
);
326 abend(-1
, "User terminated program");
336 abend(-1
, "init_view_files failed");
342
343
344
345
382
383
384
385
386
387
388
389
390
391
392
411 s1 = strtok(try_spec,
" \t\n");
420 if (try_spec[0] ==
'/') {
429 if (!f_dir && dir[0]) {
430 if (strcmp(dir,
"$PATH") == 0) {
448 if (!f_spec && alt_dir && alt_dir[0] !=
'\0') {
449 if (strcmp(alt_dir,
"$PATH") == 0) {
472 if (!f_spec && mode == W_OK) {
474 FILE *fp = fopen(try_spec,
"a");
485 if (try_spec[0] ==
'\0' && idio_spec[0] !=
'\0')
489 if (s2_s[0] !=
'\0') {
499
500
501
502
503
504
505
512 "~/menuapp/msrc", R_OK
);
519 "~/menuapp/help", R_OK
);
546
547
548
549
550
551
552
553
567 if (init
->cmd[0] !=
'\0') {
580 "~/menuapp/help", R_OK
);
584 "~/menuapp/data", R_OK
);
596 if (argv[optind][0] !=
'\0') {
609 if (argv[optind][0] !=
'\0') {
621 if (argv[optind][0] !=
'\0') {
636 "~/menuapp/help", R_OK
);
645
646
647
648
649
650
656 "~/menuapp/msrc", R_OK
);
667 if (init
->cmd[0] !=
'\0') {
678 "~/menuapp/help", R_OK
);
682 "~/menuapp/msrc", R_OK
);
689 "~/menuapp/data", R_OK
);
701 if (argv[optind][0] !=
'\0') {
714 if (argv[optind][0] !=
'\0') {
726 if (argv[optind][0] !=
'\0') {
741 "~/menuapp/help", R_OK
);
753
754
755
765 e = getenv(
"VIEW_HELP_FILE");
766 if (e && e[0] !=
'\0') {
771 "~/menuapp/help", R_OK
);
int Perror(char *)
Display a simple error message window or print to stderr.
int display_error(char *em0, char *em1, char *em2, char *em3)
Display an error message window or print to stderr.
void abend(int, char *)
Abnormal program termination.
bool locate_file_in_path(char *, char *)
Locates a file in the system PATH.
void destroy_argv(int argc, char **argv)
Deallocates memory allocated for argument strings in argv.
size_t canonicalize_file_spec(char *)
Removes quotes and trims at first space.
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
bool stripz_quotes(char *)
removes leading and trailing double quotes if present
size_t ssnprintf(char *, size_t, const char *,...)
ssnprintf was designed to be a safer alternative to snprintf.
bool strip_quotes(char *)
removes leading and trailing double quotes if present
char * strnz_dup(char *, size_t)
Allocates memory for and duplicates string s up to length l or until line feed or carriage return.
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
bool verify_file(char *, int)
Verifies that the file specified by "in_spec" exists and is accessible with the permissions specified...
bool expand_tilde(char *, int)
Replace Leading Tilde With Home Directory.
bool verify_dir(char *, int)
Verifies that the directory specified by "spec" exists and is accessible with the permissions specifi...
bool base_name(char *, char *)
Returns the base name of a file specification.
bool init_form_files(Init *, int, char **)
Initialize Form file specifications.
View * destroy_view(Init *init)
Destroy View structure.
Form * new_form(Init *, int, char **, int, int)
Create and initialize Form structure.
bool init_menu_files(Init *, int, char **)
Initialize Menu file specifications.
bool verify_spec_arg(char *, char *, char *, char *, int)
Verify file specification argument.
Init * new_init(int, char **)
Create and initialize Init structure.
Menu * new_menu(Init *, int, char **, int, int)
Create and initialize Menu structure.
Menu * destroy_menu(Init *init)
Destroy Menu structure.
Form * destroy_form(Init *init)
Destroy Form structure.
View * new_view(Init *)
Create and initialize View structure.
Pick * new_pick(Init *, int, char **, int, int)
Create and initialize Pick structure.
Init * destroy_init(Init *init)
Destroy Init structure.
bool init_pick_files(Init *, int, char **)
Initialize Pick file specifications.
bool init_view_files(Init *)
Initialize View file specifications.
Pick * destroy_pick(Init *init)
Destroy Pick structure.
char receiver_cmd[MAXLEN]
char provider_cmd[MAXLEN]
Text * text[FIELD_MAXCNT]
Field * field[FIELD_MAXCNT]
char receiver_cmd[MAXLEN]
char provider_cmd[MAXLEN]
char mapp_spec[FIELD_MAXLEN]
Line * line[MAX_MENU_LINES]
char receiver_cmd[MAXLEN]
char provider_cmd[MAXLEN]
char provider_cmd[MAXLEN]
char receiver_cmd[MAXLEN]