Lines Matching +defs:pathname +defs:device

30 /* $XFree86: xc/programs/xedit/lisp/pathname.c,v 1.17tsi Exp $ */
37 #include "lisp/pathname.h"
151 * (directory "<pathname-spec>/" :all t)
153 * echo <pathname-spec>, but normally, not in the
157 * <pathname-spec> ends with PATH_SEP char.
165 directory pathname &key all if-cannot-read
179 LispObj *pathname, *all, *if_cannot_read, *result, *cons, *object;
183 pathname = ARGUMENT(0);
202 if (PATHNAMEP(pathname))
203 pathname = CAR(pathname->data.pathname);
204 else if (STREAMP(pathname) && pathname->data.stream.type == LispStreamFile)
205 pathname = CAR(pathname->data.stream.pathname->data.pathname);
206 else if (!STRINGP(pathname))
207 LispDestroy("%s: %s is not a pathname",
208 STRFUN(builtin), STROBJ(pathname));
210 strncpy(name, THESTR(pathname), sizeof(name) - 1);
213 if (length < STRLEN(pathname))
214 LispDestroy("%s: pathname too long %s",
262 LispDestroy("%s: pathname too long %s", STRFUN(builtin), directory);
337 LispDestroy("%s: pathname too long %s",
465 object = object->data.stream.pathname;
518 defaults = defaults->data.pathname;
531 /* device */
572 /* defaults specify directory and pathname doesn't */
703 make-pathname &key host device directory name type version defaults
708 char *string, pathname[PATH_MAX + 1];
711 LispObj *host, *device, *directory, *name, *type, *version, *defaults;
718 device = ARGUMENT(1);
724 if (device != UNSPEC) {
725 CHECK_STRING(device);
768 (host == UNSPEC || device == UNSPEC || directory == UNSPEC ||
775 defaults = defaults->data.pathname;
779 defaults = CDR(defaults); /* device */
780 if (device == UNSPEC)
781 device = CAR(defaults);
800 pathname[length++] = PATH_SEP;
809 if (length + alength + 2 > sizeof(pathname))
810 alength = sizeof(pathname) - length - 2;
811 memcpy(pathname + length, string, alength);
813 pathname[length++] = PATH_SEP;
827 if (length + alength + 2 > sizeof(pathname))
828 alength = sizeof(pathname) - length - 2;
829 memcpy(pathname + length, string, alength);
833 if (length + 2 < sizeof(pathname))
834 pathname[length++] = PATH_TYPESEP;
837 if (length + alength + 2 > sizeof(pathname))
838 alength = sizeof(pathname) - length - 2;
839 memcpy(pathname + length, string, alength);
842 pathname[length] = '\0';
843 result = cons = CONS(LSTRING(pathname, length), NIL);
850 /* device */
851 RPLACD(cons, CONS(device == UNSPEC ? NIL : device, NIL));
881 pathname-host pathname
890 pathname-device pathname
899 pathname-device pathname
908 pathname-name pathname
917 pathname-type pathname
926 pathname-version pathname
935 file-namestring pathname
944 directory-namestring pathname
953 enough-pathname pathname &optional defaults
956 LispObj *pathname, *defaults;
959 pathname = ARGUMENT(0);
964 if (!STRINGP(pathname)) {
965 if (PATHNAMEP(pathname))
966 pathname = CAR(pathname->data.pathname);
967 else if (STREAMP(pathname) &&
968 pathname->data.stream.type == LispStreamFile)
969 pathname = CAR(pathname->data.stream.pathname->data.pathname);
972 STRFUN(builtin), STROBJ(pathname));
977 defaults = CAR(defaults->data.pathname);
980 defaults = CAR(defaults->data.stream.pathname->data.pathname);
986 ppathname = pp = THESTR(pathname);
1005 if (STRINGP(pathname))
1006 return (pathname);
1007 else if (PATHNAMEP(pathname))
1008 return (CAR(pathname->data.pathname));
1009 else if (STREAMP(pathname)) {
1010 if (pathname->data.stream.type == LispStreamFile)
1011 return (CAR(pathname->data.stream.pathname->data.pathname));
1014 LispDestroy("%s: bad PATHNAME %s", STRFUN(builtin), STROBJ(pathname));
1022 namestring pathname
1031 host-namestring pathname
1055 user-homedir-pathname &optional host