25 #include "pips_config.h"
30 #include <xview/xview.h>
31 #include <xview/panel.h>
34 #include <sys/param.h>
39 #define MAXNAMELEN NAME_MAX
43 #define MAXNAMELEN MAXNAMLEN
76 if (op == MENU_DISPLAY) {
78 char * parent_directory;
79 Menu parent = xv_get(menu_item, MENU_PARENT);
81 debug(2,
"directory_gen_pullright",
"menu_item = %#x (%s), parent = %#x\n",
82 menu_item, (
char *) xv_get(menu_item, MENU_STRING), parent);
85 parent_directory = (
char *) xv_get(parent,
87 debug(2,
"directory_gen_pullright",
" parent_directory = %s\n",
91 (void) sprintf(directory,
"%s/%s",
93 (
char *) xv_get(menu_item, MENU_STRING));
95 if ((
char *)(menu = (Menu) xv_get(menu_item, MENU_PULLRIGHT)) != NULL) {
108 menu = (Menu)xv_get(menu_item, MENU_PULLRIGHT);
118 char * directory_name = (
char *) xv_get(menu_item, MENU_STRING);
119 char * parent_path_name =
122 (void) sprintf(full_directory_name,
"%s/%s",
123 parent_path_name, directory_name);
132 int file_list_length;
137 menu = (Menu) xv_create(
140 MENU_TITLE_ITEM,
strdup(directory),
147 pips_debug(2,
"menu = %p (%s)\n", (
void *) menu, directory);
150 xv_set(menu, MENU_APPEND_ITEM,
151 xv_create(XV_NULL, MENUITEM,
153 "* Close the current workspace before "
154 "changing directory *",
171 if (return_code == -1 || file_list_length == 0)
172 xv_set(menu, MENU_APPEND_ITEM,
173 xv_create(XV_NULL, MENUITEM,
175 "* No file in this directory or cannot be open *",
181 xv_set(menu, MENU_APPEND_ITEM,
182 xv_create(XV_NULL, MENUITEM,
184 "* Too many files. Type directly in the Directory "
185 "line of the main panel *",
191 "Too many files in the \"%s\" directory.\n", directory);
195 for(i = 0; i < file_list_length; i++)
203 Menu_item menu_item =
204 xv_create(XV_NULL, MENUITEM,
212 (void) sprintf(complete_file_name,
"%s/%s",
214 if (((stat(complete_file_name, &
buf) == 0)
215 && (
buf.st_mode & S_IFDIR))) {
220 MENU_APPEND_ITEM, menu_item,
224 xv_create(XV_NULL, MENUITEM,
239 xv_set(menu_item, MENU_INACTIVE, TRUE, NULL);
241 xv_set(menu, MENU_APPEND_ITEM, menu_item, NULL);
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
size_t gen_array_nitems(const gen_array_t a)
void gen_array_full_free(gen_array_t a)
gen_array_t gen_array_make(size_t size)
declarations...
void * gen_array_item(const gen_array_t a, size_t i)
bool directory_exists_p(const char *name)
int safe_list_files_in_directory(gen_array_t files, string dir, string re, bool(*file_name_predicate)(const char *))
returns a sorted arg list of files matching regular expression re in directory 'dir' and with file_na...
success end_directory_notify(const char *dir)
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define user_warning(fn,...)
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...