diff options
| author | Kenichi Handa | 1998-03-03 07:18:46 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-03-03 07:18:46 +0000 |
| commit | 290591c8fb6ac1e41686342d6a72619ba3c7c377 (patch) | |
| tree | bbc2a9da84a3dc1ea772c8a9753a84cefc5f012b /src/coding.h | |
| parent | bd33479f0a26736420e12d2b74b644f776765d40 (diff) | |
| download | emacs-290591c8fb6ac1e41686342d6a72619ba3c7c377.tar.gz emacs-290591c8fb6ac1e41686342d6a72619ba3c7c377.zip | |
(ENCODE_FILE): Moved from fileio.c. Use
default-file-name-coding-system if file-name-coding-system is nil.
(DECODE_FILE): New macro.
Diffstat (limited to 'src/coding.h')
| -rw-r--r-- | src/coding.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/coding.h b/src/coding.h index 61b4402a902..1c1e3f798de 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -487,6 +487,28 @@ struct coding_system | |||
| 487 | s2 = c2 + 0x7E; \ | 487 | s2 = c2 + 0x7E; \ |
| 488 | } while (0) | 488 | } while (0) |
| 489 | 489 | ||
| 490 | /* Encode the file name NAME using the specified coding system | ||
| 491 | for file names, if any. */ | ||
| 492 | #define ENCODE_FILE(name) \ | ||
| 493 | (! NILP (Vfile_name_coding_system) \ | ||
| 494 | && XFASTINT (Vfile_name_coding_system) != 0 \ | ||
| 495 | ? Fencode_coding_string (name, Vfile_name_coding_system, Qt) \ | ||
| 496 | : (! NILP (Vdefault_file_name_coding_system) \ | ||
| 497 | && XFASTINT (Vdefault_file_name_coding_system) \ | ||
| 498 | ? Fencode_coding_string (name, Vdefault_file_name_coding_system, Qt) \ | ||
| 499 | : name)) | ||
| 500 | |||
| 501 | /* Decode the file name NAME using the specified coding system | ||
| 502 | for file names, if any. */ | ||
| 503 | #define DECODE_FILE(name) \ | ||
| 504 | (! NILP (Vfile_name_coding_system) \ | ||
| 505 | && XFASTINT (Vfile_name_coding_system) != 0 \ | ||
| 506 | ? Fdecode_coding_string (name, Vfile_name_coding_system, Qt) \ | ||
| 507 | : (! NILP (Vdefault_file_name_coding_system) \ | ||
| 508 | && XFASTINT (Vdefault_file_name_coding_system) \ | ||
| 509 | ? Fdecode_coding_string (name, Vdefault_file_name_coding_system, Qt) \ | ||
| 510 | : name)) | ||
| 511 | |||
| 490 | /* Extern declarations. */ | 512 | /* Extern declarations. */ |
| 491 | extern int decode_coding P_ ((struct coding_system *, unsigned char *, | 513 | extern int decode_coding P_ ((struct coding_system *, unsigned char *, |
| 492 | unsigned char *, int, int)); | 514 | unsigned char *, int, int)); |