diff options
| author | Richard M. Stallman | 1992-09-19 21:24:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-09-19 21:24:30 +0000 |
| commit | 3ed991aac189b43d5a11c093fbcf0c0f031ddd4e (patch) | |
| tree | 2ca212c11656af14e8e2a290820ebf7eaa326b8d /src/dired.c | |
| parent | 88191e3635211f85ecb9bfa97b1f202348e7109e (diff) | |
| download | emacs-3ed991aac189b43d5a11c093fbcf0c0f031ddd4e.tar.gz emacs-3ed991aac189b43d5a11c093fbcf0c0f031ddd4e.zip | |
[VMS]: Include string.h, rms.h, rmsdef.h.
[VMS] (Ffile_version_limit): New function.
Diffstat (limited to 'src/dired.c')
| -rw-r--r-- | src/dired.c | 61 |
1 files changed, 48 insertions, 13 deletions
diff --git a/src/dired.c b/src/dired.c index 3beb9d1d055..a222e940928 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -24,6 +24,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 24 | 24 | ||
| 25 | #include "config.h" | 25 | #include "config.h" |
| 26 | 26 | ||
| 27 | #ifdef VMS | ||
| 28 | #include <string.h> | ||
| 29 | #include <rms.h> | ||
| 30 | #include <rmsdef.h> | ||
| 31 | #endif | ||
| 32 | |||
| 27 | #ifdef SYSV_SYSTEM_DIR | 33 | #ifdef SYSV_SYSTEM_DIR |
| 28 | 34 | ||
| 29 | #include <dirent.h> | 35 | #include <dirent.h> |
| @@ -216,19 +222,6 @@ These are all file names in directory DIR which begin with FILE.") | |||
| 216 | return file_name_completion (file, dirname, 1, 0); | 222 | return file_name_completion (file, dirname, 1, 0); |
| 217 | } | 223 | } |
| 218 | 224 | ||
| 219 | #ifdef VMS | ||
| 220 | |||
| 221 | DEFUN ("file-name-all-versions", Ffile_name_all_versions, | ||
| 222 | Sfile_name_all_versions, 2, 2, 0, | ||
| 223 | "Return a list of all versions of file name FILE in directory DIR.") | ||
| 224 | (file, dirname) | ||
| 225 | Lisp_Object file, dirname; | ||
| 226 | { | ||
| 227 | return file_name_completion (file, dirname, 1, 1); | ||
| 228 | } | ||
| 229 | |||
| 230 | #endif /* VMS */ | ||
| 231 | |||
| 232 | Lisp_Object | 225 | Lisp_Object |
| 233 | file_name_completion (file, dirname, all_flag, ver_flag) | 226 | file_name_completion (file, dirname, all_flag, ver_flag) |
| 234 | Lisp_Object file, dirname; | 227 | Lisp_Object file, dirname; |
| @@ -412,6 +405,47 @@ file_name_completion_stat (dirname, dp, st_addr) | |||
| 412 | return stat (fullname, st_addr); | 405 | return stat (fullname, st_addr); |
| 413 | } | 406 | } |
| 414 | 407 | ||
| 408 | #ifdef VMS | ||
| 409 | |||
| 410 | DEFUN ("file-name-all-versions", Ffile_name_all_versions, | ||
| 411 | Sfile_name_all_versions, 2, 2, 0, | ||
| 412 | "Return a list of all versions of file name FILE in directory DIR.") | ||
| 413 | (file, dirname) | ||
| 414 | Lisp_Object file, dirname; | ||
| 415 | { | ||
| 416 | return file_name_completion (file, dirname, 1, 1); | ||
| 417 | } | ||
| 418 | |||
| 419 | DEFUN ("file-version-limit", Ffile_version_limit, Sfile_version_limit, 1, 1, 0, | ||
| 420 | "Return the maximum number of versions allowed for FILE.\n\ | ||
| 421 | Returns nil if the file cannot be opened or if there is no version limit.") | ||
| 422 | (filename) | ||
| 423 | Lisp_Object filename; | ||
| 424 | { | ||
| 425 | Lisp_Object retval; | ||
| 426 | struct FAB fab; | ||
| 427 | struct RAB rab; | ||
| 428 | struct XABFHC xabfhc; | ||
| 429 | int status; | ||
| 430 | |||
| 431 | filename = Fexpand_file_name (filename, Qnil); | ||
| 432 | fab = cc$rms_fab; | ||
| 433 | xabfhc = cc$rms_xabfhc; | ||
| 434 | fab.fab$l_fna = XSTRING (filename)->data; | ||
| 435 | fab.fab$b_fns = strlen (fab.fab$l_fna); | ||
| 436 | fab.fab$l_xab = (char *) &xabfhc; | ||
| 437 | status = sys$open (&fab, 0, 0); | ||
| 438 | if (status != RMS$_NORMAL) /* Probably non-existent file */ | ||
| 439 | return Qnil; | ||
| 440 | sys$close (&fab, 0, 0); | ||
| 441 | if (xabfhc.xab$w_verlimit == 32767) | ||
| 442 | return Qnil; /* No version limit */ | ||
| 443 | else | ||
| 444 | return make_number (xabfhc.xab$w_verlimit); | ||
| 445 | } | ||
| 446 | |||
| 447 | #endif /* VMS */ | ||
| 448 | |||
| 415 | Lisp_Object | 449 | Lisp_Object |
| 416 | make_time (time) | 450 | make_time (time) |
| 417 | int time; | 451 | int time; |
| @@ -512,6 +546,7 @@ syms_of_dired () | |||
| 512 | defsubr (&Sfile_name_completion); | 546 | defsubr (&Sfile_name_completion); |
| 513 | #ifdef VMS | 547 | #ifdef VMS |
| 514 | defsubr (&Sfile_name_all_versions); | 548 | defsubr (&Sfile_name_all_versions); |
| 549 | defsubr (&Sfile_version_limit); | ||
| 515 | #endif /* VMS */ | 550 | #endif /* VMS */ |
| 516 | defsubr (&Sfile_name_all_completions); | 551 | defsubr (&Sfile_name_all_completions); |
| 517 | defsubr (&Sfile_attributes); | 552 | defsubr (&Sfile_attributes); |