/[emacs]/emacs/src/fileio.c
ViewVC logotype

Diff of /emacs/src/fileio.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.422 by eliz, Fri Oct 26 21:38:40 2001 UTC revision 1.423 by pj, Fri Nov 2 20:24:41 2001 UTC
# Line 338  use the standard functions without calli Line 338  use the standard functions without calli
338    /* This function must not munge the match data.  */    /* This function must not munge the match data.  */
339    Lisp_Object chain, inhibited_handlers;    Lisp_Object chain, inhibited_handlers;
340    
341    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
342    
343    if (EQ (operation, Vinhibit_file_name_operation))    if (EQ (operation, Vinhibit_file_name_operation))
344      inhibited_handlers = Vinhibit_file_name_handlers;      inhibited_handlers = Vinhibit_file_name_handlers;
# Line 384  on VMS, perhaps instead a string ending Line 384  on VMS, perhaps instead a string ending
384    register unsigned char *p;    register unsigned char *p;
385    Lisp_Object handler;    Lisp_Object handler;
386    
387    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
388    
389    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
390       call the corresponding file handler.  */       call the corresponding file handler.  */
# Line 459  or the entire name if it contains no sla Line 459  or the entire name if it contains no sla
459    register unsigned char *beg, *p, *end;    register unsigned char *beg, *p, *end;
460    Lisp_Object handler;    Lisp_Object handler;
461    
462    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
463    
464    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
465       call the corresponding file handler.  */       call the corresponding file handler.  */
# Line 614  On VMS, converts \"[X]FOO.DIR\" to \"[X. Line 614  On VMS, converts \"[X]FOO.DIR\" to \"[X.
614    char *buf;    char *buf;
615    Lisp_Object handler;    Lisp_Object handler;
616    
617    CHECK_STRING (file, 0);    CHECK_STRING (file);
618    if (NILP (file))    if (NILP (file))
619      return Qnil;      return Qnil;
620    
# Line 805  it returns a file name such as \"[X]Y.DI Line 805  it returns a file name such as \"[X]Y.DI
805    char *buf;    char *buf;
806    Lisp_Object handler;    Lisp_Object handler;
807    
808    CHECK_STRING (directory, 0);    CHECK_STRING (directory);
809    
810    if (NILP (directory))    if (NILP (directory))
811      return Qnil;      return Qnil;
# Line 870  make_temp_name (prefix, base64_p) Line 870  make_temp_name (prefix, base64_p)
870    char pidbuf[20];    char pidbuf[20];
871    int pidlen;    int pidlen;
872            
873    CHECK_STRING (prefix, 0);    CHECK_STRING (prefix);
874    
875    /* VAL is created by adding 6 characters to PREFIX.  The first    /* VAL is created by adding 6 characters to PREFIX.  The first
876       three are the PID of this process, in base 64, and the second       three are the PID of this process, in base 64, and the second
# Line 1019  See also the function `substitute-in-fil Line 1019  See also the function `substitute-in-fil
1019    int length;    int length;
1020    Lisp_Object handler;    Lisp_Object handler;
1021    
1022    CHECK_STRING (name, 0);    CHECK_STRING (name);
1023    
1024    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
1025       call the corresponding file handler.  */       call the corresponding file handler.  */
# Line 1686  See also the function `substitute-in-fil Line 1686  See also the function `substitute-in-fil
1686    int dots = 0;    int dots = 0;
1687  #endif /* VMS */  #endif /* VMS */
1688    
1689    CHECK_STRING (name, 0);    CHECK_STRING (name);
1690    
1691  #ifdef VMS  #ifdef VMS
1692    /* Filenames on VMS are always upper case.  */    /* Filenames on VMS are always upper case.  */
# Line 1862  See also the function `substitute-in-fil Line 1862  See also the function `substitute-in-fil
1862      {      {
1863        if (NILP (defalt))        if (NILP (defalt))
1864          defalt = current_buffer->directory;          defalt = current_buffer->directory;
1865        CHECK_STRING (defalt, 1);        CHECK_STRING (defalt);
1866        newdir = XSTRING (defalt)->data;        newdir = XSTRING (defalt)->data;
1867      }      }
1868    
# Line 2004  duplicates what `expand-file-name' does. Line 2004  duplicates what `expand-file-name' does.
2004    unsigned char *xnm;    unsigned char *xnm;
2005    Lisp_Object handler;    Lisp_Object handler;
2006    
2007    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
2008    
2009    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
2010       call the corresponding file handler.  */       call the corresponding file handler.  */
# Line 2318  A prefix arg makes KEEP-TIME non-nil.  * Line 2318  A prefix arg makes KEEP-TIME non-nil.  *
2318    
2319    encoded_file = encoded_newname = Qnil;    encoded_file = encoded_newname = Qnil;
2320    GCPRO4 (file, newname, encoded_file, encoded_newname);    GCPRO4 (file, newname, encoded_file, encoded_newname);
2321    CHECK_STRING (file, 0);    CHECK_STRING (file);
2322    CHECK_STRING (newname, 1);    CHECK_STRING (newname);
2323    
2324    if (!NILP (Ffile_directory_p (newname)))    if (!NILP (Ffile_directory_p (newname)))
2325      newname = Fexpand_file_name (file, newname);      newname = Fexpand_file_name (file, newname);
# Line 2472  DEFUN ("make-directory-internal", Fmake_ Line 2472  DEFUN ("make-directory-internal", Fmake_
2472    Lisp_Object handler;    Lisp_Object handler;
2473    Lisp_Object encoded_dir;    Lisp_Object encoded_dir;
2474    
2475    CHECK_STRING (directory, 0);    CHECK_STRING (directory);
2476    directory = Fexpand_file_name (directory, Qnil);    directory = Fexpand_file_name (directory, Qnil);
2477    
2478    handler = Ffind_file_name_handler (directory, Qmake_directory_internal);    handler = Ffind_file_name_handler (directory, Qmake_directory_internal);
# Line 2502  DEFUN ("delete-directory", Fdelete_direc Line 2502  DEFUN ("delete-directory", Fdelete_direc
2502    Lisp_Object handler;    Lisp_Object handler;
2503    Lisp_Object encoded_dir;    Lisp_Object encoded_dir;
2504    
2505    CHECK_STRING (directory, 0);    CHECK_STRING (directory);
2506    directory = Fdirectory_file_name (Fexpand_file_name (directory, Qnil));    directory = Fdirectory_file_name (Fexpand_file_name (directory, Qnil));
2507    
2508    handler = Ffind_file_name_handler (directory, Qdelete_directory);    handler = Ffind_file_name_handler (directory, Qdelete_directory);
# Line 2528  If file has multiple names, it continues Line 2528  If file has multiple names, it continues
2528    Lisp_Object handler;    Lisp_Object handler;
2529    Lisp_Object encoded_file;    Lisp_Object encoded_file;
2530    
2531    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
2532    filename = Fexpand_file_name (filename, Qnil);    filename = Fexpand_file_name (filename, Qnil);
2533    
2534    handler = Ffind_file_name_handler (filename, Qdelete_file);    handler = Ffind_file_name_handler (filename, Qdelete_file);
# Line 2579  This is what happens in interactive use Line 2579  This is what happens in interactive use
2579    
2580    encoded_file = encoded_newname = Qnil;    encoded_file = encoded_newname = Qnil;
2581    GCPRO4 (file, newname, encoded_file, encoded_newname);    GCPRO4 (file, newname, encoded_file, encoded_newname);
2582    CHECK_STRING (file, 0);    CHECK_STRING (file);
2583    CHECK_STRING (newname, 1);    CHECK_STRING (newname);
2584    file = Fexpand_file_name (file, Qnil);    file = Fexpand_file_name (file, Qnil);
2585    newname = Fexpand_file_name (newname, Qnil);    newname = Fexpand_file_name (newname, Qnil);
2586    
# Line 2655  This is what happens in interactive use Line 2655  This is what happens in interactive use
2655    
2656    GCPRO4 (file, newname, encoded_file, encoded_newname);    GCPRO4 (file, newname, encoded_file, encoded_newname);
2657    encoded_file = encoded_newname = Qnil;    encoded_file = encoded_newname = Qnil;
2658    CHECK_STRING (file, 0);    CHECK_STRING (file);
2659    CHECK_STRING (newname, 1);    CHECK_STRING (newname);
2660    file = Fexpand_file_name (file, Qnil);    file = Fexpand_file_name (file, Qnil);
2661    newname = Fexpand_file_name (newname, Qnil);    newname = Fexpand_file_name (newname, Qnil);
2662    
# Line 2718  This happens for interactive use with M- Line 2718  This happens for interactive use with M-
2718    
2719    GCPRO4 (filename, linkname, encoded_filename, encoded_linkname);    GCPRO4 (filename, linkname, encoded_filename, encoded_linkname);
2720    encoded_filename = encoded_linkname = Qnil;    encoded_filename = encoded_linkname = Qnil;
2721    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
2722    CHECK_STRING (linkname, 1);    CHECK_STRING (linkname);
2723    /* If the link target has a ~, we must expand it to get    /* If the link target has a ~, we must expand it to get
2724       a truly valid file name.  Otherwise, do not expand;       a truly valid file name.  Otherwise, do not expand;
2725       we want to permit links to relative file names.  */       we want to permit links to relative file names.  */
# Line 2786  If STRING is nil or a null string, the l Line 2786  If STRING is nil or a null string, the l
2786       Lisp_Object name;       Lisp_Object name;
2787       Lisp_Object string;       Lisp_Object string;
2788  {  {
2789    CHECK_STRING (name, 0);    CHECK_STRING (name);
2790    if (NILP (string))    if (NILP (string))
2791      delete_logical_name (XSTRING (name)->data);      delete_logical_name (XSTRING (name)->data);
2792    else    else
2793      {      {
2794        CHECK_STRING (string, 1);        CHECK_STRING (string);
2795    
2796        if (XSTRING (string)->size == 0)        if (XSTRING (string)->size == 0)
2797          delete_logical_name (XSTRING (name)->data);          delete_logical_name (XSTRING (name)->data);
# Line 2812  DEFUN ("sysnetunam", Fsysnetunam, Ssysne Line 2812  DEFUN ("sysnetunam", Fsysnetunam, Ssysne
2812  {  {
2813    int netresult;    int netresult;
2814    
2815    CHECK_STRING (path, 0);    CHECK_STRING (path);
2816    CHECK_STRING (login, 0);    CHECK_STRING (login);
2817    
2818    netresult = netunam (XSTRING (path)->data, XSTRING (login)->data);    netresult = netunam (XSTRING (path)->data, XSTRING (login)->data);
2819    
# Line 2833  On Unix, this is a name starting with a Line 2833  On Unix, this is a name starting with a
2833  {  {
2834    unsigned char *ptr;    unsigned char *ptr;
2835    
2836    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
2837    ptr = XSTRING (filename)->data;    ptr = XSTRING (filename)->data;
2838    if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~'    if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~'
2839  #ifdef VMS  #ifdef VMS
# Line 2920  See also `file-readable-p' and `file-att Line 2920  See also `file-readable-p' and `file-att
2920    Lisp_Object handler;    Lisp_Object handler;
2921    struct stat statbuf;    struct stat statbuf;
2922    
2923    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
2924    absname = Fexpand_file_name (filename, Qnil);    absname = Fexpand_file_name (filename, Qnil);
2925    
2926    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
# Line 2943  For a directory, this means you can acce Line 2943  For a directory, this means you can acce
2943    Lisp_Object absname;    Lisp_Object absname;
2944    Lisp_Object handler;    Lisp_Object handler;
2945    
2946    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
2947    absname = Fexpand_file_name (filename, Qnil);    absname = Fexpand_file_name (filename, Qnil);
2948    
2949    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
# Line 2969  See also `file-exists-p' and `file-attri Line 2969  See also `file-exists-p' and `file-attri
2969    int flags;    int flags;
2970    struct stat statbuf;    struct stat statbuf;
2971    
2972    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
2973    absname = Fexpand_file_name (filename, Qnil);    absname = Fexpand_file_name (filename, Qnil);
2974    
2975    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
# Line 3017  DEFUN ("file-writable-p", Ffile_writable Line 3017  DEFUN ("file-writable-p", Ffile_writable
3017    Lisp_Object handler;    Lisp_Object handler;
3018    struct stat statbuf;    struct stat statbuf;
3019    
3020    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
3021    absname = Fexpand_file_name (filename, Qnil);    absname = Fexpand_file_name (filename, Qnil);
3022    
3023    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
# Line 3065  If there is no error, we return nil.  */ Line 3065  If there is no error, we return nil.  */
3065    Lisp_Object handler, encoded_filename, absname;    Lisp_Object handler, encoded_filename, absname;
3066    int fd;    int fd;
3067    
3068    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
3069    absname = Fexpand_file_name (filename, Qnil);    absname = Fexpand_file_name (filename, Qnil);
3070    
3071    CHECK_STRING (string, 1);    CHECK_STRING (string);
3072    
3073    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
3074       call the corresponding file handler.  */       call the corresponding file handler.  */
# Line 3100  Otherwise returns nil.  */) Line 3100  Otherwise returns nil.  */)
3100    Lisp_Object val;    Lisp_Object val;
3101    Lisp_Object handler;    Lisp_Object handler;
3102    
3103    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
3104    filename = Fexpand_file_name (filename, Qnil);    filename = Fexpand_file_name (filename, Qnil);
3105    
3106    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
# Line 3287  Only the 12 low bits of MODE are used. Line 3287  Only the 12 low bits of MODE are used.
3287    Lisp_Object handler;    Lisp_Object handler;
3288    
3289    absname = Fexpand_file_name (filename, current_buffer->directory);    absname = Fexpand_file_name (filename, current_buffer->directory);
3290    CHECK_NUMBER (mode, 1);    CHECK_NUMBER (mode);
3291    
3292    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
3293       call the corresponding file handler.  */       call the corresponding file handler.  */
# Line 3310  This setting is inherited by subprocesse Line 3310  This setting is inherited by subprocesse
3310       (mode)       (mode)
3311       Lisp_Object mode;       Lisp_Object mode;
3312  {  {
3313    CHECK_NUMBER (mode, 0);    CHECK_NUMBER (mode);
3314    
3315    umask ((~ XINT (mode)) & 0777);    umask ((~ XINT (mode)) & 0777);
3316    
# Line 3361  otherwise, if FILE2 does not exist, the Line 3361  otherwise, if FILE2 does not exist, the
3361    Lisp_Object handler;    Lisp_Object handler;
3362    struct gcpro gcpro1, gcpro2;    struct gcpro gcpro1, gcpro2;
3363    
3364    CHECK_STRING (file1, 0);    CHECK_STRING (file1);
3365    CHECK_STRING (file2, 0);    CHECK_STRING (file2);
3366    
3367    absname1 = Qnil;    absname1 = Qnil;
3368    GCPRO2 (absname1, file2);    GCPRO2 (absname1, file2);
# Line 3542  actually used.  */) Line 3542  actually used.  */)
3542    
3543    GCPRO4 (filename, val, p, orig_filename);    GCPRO4 (filename, val, p, orig_filename);
3544    
3545    CHECK_STRING (filename, 0);    CHECK_STRING (filename);
3546    filename = Fexpand_file_name (filename, Qnil);    filename = Fexpand_file_name (filename, Qnil);
3547    
3548    /* If the file name has special constructs in it,    /* If the file name has special constructs in it,
# Line 3636  actually used.  */) Line 3636  actually used.  */)
3636      }      }
3637    
3638    if (!NILP (beg))    if (!NILP (beg))
3639      CHECK_NUMBER (beg, 0);      CHECK_NUMBER (beg);
3640    else    else
3641      XSETFASTINT (beg, 0);      XSETFASTINT (beg, 0);
3642    
3643    if (!NILP (end))    if (!NILP (end))
3644      CHECK_NUMBER (end, 0);      CHECK_NUMBER (end);
3645    else    else
3646      {      {
3647        if (! not_regular)        if (! not_regular)
# Line 4458  actually used.  */) Line 4458  actually used.  */)
4458                        
4459        insval = call3 (Qformat_decode,        insval = call3 (Qformat_decode,
4460                        Qnil, make_number (inserted), visit);                        Qnil, make_number (inserted), visit);
4461        CHECK_NUMBER (insval, 0);        CHECK_NUMBER (insval);
4462        inserted = XFASTINT (insval);        inserted = XFASTINT (insval);
4463                
4464        if (!NILP (visit))        if (!NILP (visit))
# Line 4484  actually used.  */) Line 4484  actually used.  */)
4484        insval = call1 (Fcar (p), make_number (inserted));        insval = call1 (Fcar (p), make_number (inserted));
4485        if (!NILP (insval))        if (!NILP (insval))
4486          {          {
4487            CHECK_NUMBER (insval, 0);            CHECK_NUMBER (insval);
4488            inserted = XFASTINT (insval);            inserted = XFASTINT (insval);
4489          }          }
4490        QUIT;        QUIT;
# Line 5290  This means that the file has not been ch Line 5290  This means that the file has not been ch
5290    Lisp_Object handler;    Lisp_Object handler;
5291    Lisp_Object filename;    Lisp_Object filename;
5292    
5293    CHECK_BUFFER (buf, 0);    CHECK_BUFFER (buf);
5294    b = XBUFFER (buf);    b = XBUFFER (buf);
5295    
5296    if (!STRINGP (b->filename)) return Qt;    if (!STRINGP (b->filename)) return Qt;
# Line 5723  DEFUN ("read-file-name-internal", Fread_ Line 5723  DEFUN ("read-file-name-internal", Fread_
5723    int changed;    int changed;
5724    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
5725    
5726    CHECK_STRING (string, 0);    CHECK_STRING (string);
5727    
5728    realdir = dir;    realdir = dir;
5729    name = string;    name = string;
# Line 5853  provides a file dialog box.  */) Line 5853  provides a file dialog box.  */)
5853      }      }
5854    if (!NILP (default_filename))    if (!NILP (default_filename))
5855      {      {
5856        CHECK_STRING (default_filename, 3);        CHECK_STRING (default_filename);
5857        default_filename = double_dollars (default_filename);        default_filename = double_dollars (default_filename);
5858      }      }
5859    

Legend:
Removed from v.1.422  
changed lines
  Added in v.1.423

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26