2
3
4
5
6
7
8
11
12
13
14
15
16
17
18
19
20
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
62 Init *init = calloc(1,
sizeof(Init));
63 if (init ==
nullptr) {
68 if (init
->argv ==
nullptr) {
78 for (i = 0; i < init
->argc; i++)
87
88
89
90
107 if (init
->argv !=
nullptr)
109 if (init !=
nullptr) {
117
118
119
120
121
122
123
124
125
126Menu *
new_menu(Init *init,
int argc,
char **argv, uint begy, uint begx) {
127 init
->menu = (Menu *)calloc(1,
sizeof(Menu));
143
144
145
146
169
170
171
172
173
174
175
176
177
178Pick *
new_pick(Init *init,
int argc,
char **argv, uint begy, uint begx) {
179 init
->pick = (Pick *)calloc(1,
sizeof(Pick));
194 "calloc pick->m_object = calloc(%d, %d) failed\n",
203 "calloc pick->d_object = calloc(%d, %d) failed\n",
213
214
215
216
235
236
237
238
239
240
241
242
243
244Form *
new_form(Init *init,
int argc,
char **argv, uint begy, uint begx) {
245 init
->form = (Form *)calloc(1,
sizeof(Form));
263
264
265
266
288
289
290
293 init
->view = (View *)calloc(1,
sizeof(View));
297 __LINE__ - 1
, errno
);
312 __LINE__ - 1
, errno
);
333
334
335
336
350
351
352
353
354
355
356
357
358
359
360
370 char file_name[
MAXLEN] = {};
371 char try_spec[
MAXLEN] = {};
372 char idio_spec[
MAXLEN] = {};
381 s1 = strtok(try_spec,
" \t\n");
384 s2 = strtok(
nullptr,
"\n");
394 if (try_spec[0] ==
'/') {
405 if (!f_dir && dir[0]) {
406 if (strcmp(dir,
_(
"$PATH")) == 0) {
425 if (!f_spec && alt_dir && alt_dir[0] !=
'\0') {
426 if (strcmp(alt_dir,
_(
"$PATH")) == 0) {
449 if (!f_spec && mode == W_OK) {
451 FILE *fp = fopen(try_spec,
"a");
462 if (try_spec[0] ==
'\0' && idio_spec[0] !=
'\0')
466 if (s2_s[0] !=
'\0') {
476
477
478
479
480
481
482
489 _(
"~/menuapp/msrc"), R_OK
);
496 _(
"~/menuapp/help"), R_OK
);
513 nullptr, nullptr, R_OK
);
523
524
525
526
527
528
529
530
544 if (init
->cmd[0] !=
'\0') {
557 _(
"~/menuapp/help"), R_OK
);
561 _(
"~/menuapp/data"), R_OK
);
573 if (argv[optind][0] !=
'\0') {
586 if (argv[optind][0] !=
'\0') {
598 if (argv[optind][0] !=
'\0') {
613 _(
"~/menuapp/help"), R_OK
);
628
629
630
631
632
633
639 _(
"~/menuapp/msrc"), R_OK
);
650 if (init
->cmd[0] !=
'\0') {
661 _(
"~/menuapp/help"), R_OK
);
665 _(
"~/menuapp/msrc"), R_OK
);
672 _(
"~/menuapp/data"), R_OK
);
684 if (argv[optind][0] !=
'\0') {
697 if (argv[optind][0] !=
'\0') {
709 if (argv[optind][0] !=
'\0') {
724 _(
"~/menuapp/help"), R_OK
);
743
744
745
760 e = getenv(
_(
"VIEW_HELP_FILE"));
761 if (e && e[0] !=
'\0') {
766 _(
"~/menuapp/help"), R_OK
);
void ui_abend(int ec, char *s)
Convert multibyte string to complex character array.
bool locate_file_in_path(char *, char *)
Locates a file in the system PATH.
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
bool expand_tilde(char *, uint)
Replaces "~/" in string with the user's home directory.
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 *, uint)
Verifies that the file specified by "in_spec" exists and is accessible with the permissions specified...
int destroy_argv(uint argc, char **argv)
Deallocates memory allocated for argument strings in argv.
bool base_name(char *, char *)
Returns the base name of a file specification.
bool verify_dir(char *, uint)
Verifies that the directory specified by "spec" exists and is accessible with the permissions specifi...
bool verify_spec_arg(char *, char *, char *, char *, uint)
Verify file specification argument.
Pick * new_pick(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Pick structure.
bool init_form_files(Init *init, int argc, char **argv)
Initialize Form file specifications.
View * destroy_view(Init *init)
Destroy View structure.
Menu * new_menu(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Menu structure.
bool init_menu_files(Init *init, int argc, char **argv)
Initialize Menu file specifications.
Init * new_init(int argc, char **argv)
Create and initialize Init structure.
Menu * destroy_menu(Init *init)
Destroy Menu structure.
Form * destroy_form(Init *init)
Destroy Form structure.
View * new_view(Init *init)
Create and initialize View structure.
Init * destroy_init(Init *init)
Destroy Init structure.
bool init_pick_files(Init *init, int argc, char **argv)
Initialize Pick file specifications.
Form * new_form(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Form structure.
bool init_view_files(Init *init)
Initialize View file specifications.
Pick * destroy_pick(Init *init)
Destroy Pick structure.
int ui_perror(char *emsg_str)
Display a simple error message window or print to stderr.
int ui_display_error(char *msg0, char *msg1, char *msg2, char *msg3)
Display an error message window or print to stderr.
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]