47 #if defined(NEED_STRDUP) 51 char * strdup(
char *p)
55 if ((
new =
NEW(
char, strlen(p) + 1)) !=
NULL)
69 v1 = (
CONST char **)p1;
70 v2 = (
CONST char **)p2;
71 return strcmp(*v1, *v2);
80 #if !defined(SYSTEM_IS_WIN32) 89 if ((dp = opendir(dir)) ==
NULL)
95 while ((ep = readdir(dp)) !=
NULL) {
97 if (p[0] ==
'.' && (p[1] ==
'\0' || (p[1] ==
'.' && p[2] ==
'\0')))
99 if (len && strncmp(p, file, len) != 0)
103 if ((neww =
NEW(
char*, ac + MEM_INC)) ==
NULL)
136 static char DOT[] =
".";
140 if ((fpart = strrchr(path,
'/')) ==
NULL) {
151 dpart[fpart - path] =
'\0';
156 if (dpart[0] ==
'\0')
184 if (
SplitPath(pathname, &dir, &file) < 0)
197 j = strlen(av[0]) - len + 2;
198 if ((p =
NEW(
char, j + 1)) !=
NULL) {
200 if ((neww =
NEW(
char, strlen(dir) + strlen(av[0]) + 2)) !=
NULL) {
201 (void)strcpy(neww, dir);
202 (void)strcat(neww,
"/");
203 (void)strcat(neww, av[0]);
213 for (i = len, end = strlen(av[0]); i <
end; i++)
214 for (j = 1; j < ac; j++)
215 if (av[0][i] != av[j][i])
220 if ((p =
NEW(
char, j)) !=
NULL) {
231 for (i = 0; i < ac; i++)
243 char *file, *path, *tt;
246 if (
SplitPath(pathname, &dir, &file) < 0)
250 for (i = 0; i < ac; i++)
252 path =
walloc(
char,strlen(dir)+strlen((*avp)[i])+3);
253 sprintf(path,
"%s/%s",dir,(*avp)[i]);
256 tt =
walloc(
char,strlen((*avp)[i])+2);
257 sprintf(tt,
"%s/",(*avp)[i]);
float end(const EST_Item &item)
#define walloc(TYPE, SIZE)
void qsort(EST_TList< T > &a)
STATIC int compare(CONST void *p1, CONST void *p2)
void rl_add_slash(char *path, char *p)
char * rl_complete(char *pathname, int *unique)
int el_is_directory(char *path)
int rl_list_possib(char *pathname, char ***avp)
STATIC int SplitPath(char *path, char **dirpart, char **filepart)
#define COPYFROMTO(new, p, len)
STATIC int FindMatches(char *dir, char *file, char ***avp)