Lines Matching refs:path

61   PathName *path;  /* The object to be returned */
65 path = (PathName *) malloc(sizeof(PathName));
66 if(!path) {
75 path->name = NULL;
76 path->dim = 0;
80 path->dim = _pu_pathname_dim();
81 if(path->dim == 0)
82 return _del_PathName(path);
86 path->name = (char *)malloc(path->dim * sizeof(char));
87 if(!path->name) {
89 return _del_PathName(path);
91 return path;
98 * path PathName * The object to be deleted.
102 PathName *_del_PathName(PathName *path)
104 if(path) {
105 if(path->name)
106 free(path->name);
107 free(path);
116 * path PathName * The pathname container.
120 char *_pn_clear_path(PathName *path)
125 if(!path) {
129 path->name[0] = '\0';
130 return path->name;
138 * path PathName * The pathname container.
148 * return char * The pathname string path->name[], which may
152 char *_pn_append_to_path(PathName *path, const char *string, int slen,
160 if(!path || !string) {
167 pathlen = strlen(path->name);
176 if(!_pn_resize_path(path, pathlen + slen))
187 path->name[pathlen++] = string[i];
192 path->name[pathlen] = '\0';
197 memcpy(path->name + pathlen, string, slen);
198 path->name[pathlen + slen] = '\0';
200 return path->name;
208 * path PathName * The pathname container.
218 * return char * The pathname string path->name[], which may
222 char *_pn_prepend_to_path(PathName *path, const char *string, int slen,
231 if(!path || !string) {
238 pathlen = strlen(path->name);
245 * Work out how far we need to shift the original path string to make
263 if(!_pn_resize_path(path, pathlen + shift))
268 memmove(path->name + shift, path->name, pathlen+1);
278 path->name[j++] = string[i];
281 memcpy(path->name, string, slen);
283 return path->name;
291 * path PathName * The pathname container object.
298 char *_pn_resize_path(PathName *path, size_t length)
303 if(!path) {
314 if(length + 1 > path->dim) {
316 char *name = (char *) realloc(path->name, dim);
319 path->name = name;
320 path->dim = dim;
322 return path->name;
363 * Return non-zero if the specified path name refers to a directory.
366 * pathname const char * The path to test.
386 * Return non-zero if the specified path name refers to a regular file.
389 * pathname const char * The path to test.
409 * Return non-zero if the specified path name refers to an executable.
412 * pathname const char * The path to test.
527 * Return non-zero if the specified path name refers to an existing file.
530 * pathname const char * The path to test.