1 |
/* Header for coding system handler. |
/* Header for coding system handler. |
2 |
|
Copyright (C) 2004 Free Software Foundation, Inc. |
3 |
Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. |
Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. |
4 |
Licensed to the Free Software Foundation. |
Licensed to the Free Software Foundation. |
5 |
Copyright (C) 2003 |
Copyright (C) 2003 |
580 |
for file names, if any. */ |
for file names, if any. */ |
581 |
#define ENCODE_FILE(name) \ |
#define ENCODE_FILE(name) \ |
582 |
(! NILP (Vfile_name_coding_system) \ |
(! NILP (Vfile_name_coding_system) \ |
583 |
&& XFASTINT (Vfile_name_coding_system) != 0 \ |
&& !EQ (Vfile_name_coding_system, make_number (0)) \ |
584 |
? code_convert_string_norecord (name, Vfile_name_coding_system, 1) \ |
? code_convert_string_norecord (name, Vfile_name_coding_system, 1) \ |
585 |
: (! NILP (Vdefault_file_name_coding_system) \ |
: (! NILP (Vdefault_file_name_coding_system) \ |
586 |
&& XFASTINT (Vdefault_file_name_coding_system) != 0 \ |
&& !EQ (Vdefault_file_name_coding_system, make_number (0)) \ |
587 |
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \ |
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 1) \ |
588 |
: name)) |
: name)) |
589 |
|
|
592 |
for file names, if any. */ |
for file names, if any. */ |
593 |
#define DECODE_FILE(name) \ |
#define DECODE_FILE(name) \ |
594 |
(! NILP (Vfile_name_coding_system) \ |
(! NILP (Vfile_name_coding_system) \ |
595 |
&& XFASTINT (Vfile_name_coding_system) != 0 \ |
&& !EQ (Vfile_name_coding_system, make_number (0)) \ |
596 |
? code_convert_string_norecord (name, Vfile_name_coding_system, 0) \ |
? code_convert_string_norecord (name, Vfile_name_coding_system, 0) \ |
597 |
: (! NILP (Vdefault_file_name_coding_system) \ |
: (! NILP (Vdefault_file_name_coding_system) \ |
598 |
&& XFASTINT (Vdefault_file_name_coding_system) != 0 \ |
&& !EQ (Vdefault_file_name_coding_system, make_number (0)) \ |
599 |
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \ |
? code_convert_string_norecord (name, Vdefault_file_name_coding_system, 0) \ |
600 |
: name)) |
: name)) |
601 |
|
|
603 |
#ifdef WINDOWSNT |
#ifdef WINDOWSNT |
604 |
/* Encode the string STR using the specified coding system |
/* Encode the string STR using the specified coding system |
605 |
for w32 system functions, if any. */ |
for w32 system functions, if any. */ |
606 |
#define ENCODE_SYSTEM(str) \ |
#define ENCODE_SYSTEM(str) \ |
607 |
(! NILP (Vlocale_coding_system) \ |
(! NILP (Vlocale_coding_system) \ |
608 |
&& XFASTINT (Vlocale_coding_system) != 0 \ |
&& !EQ (Vlocale_coding_system, make_number (0)) \ |
609 |
? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ |
? code_convert_string_norecord (str, Vlocale_coding_system, 1) \ |
610 |
: str) |
: str) |
611 |
|
|
612 |
/* Decode the string STR using the specified coding system |
/* Decode the string STR using the specified coding system |
613 |
for w32 system functions, if any. */ |
for w32 system functions, if any. */ |
614 |
#define DECODE_SYSTEM(name) \ |
#define DECODE_SYSTEM(name) \ |
615 |
(! NILP (Vlocale_coding_system) \ |
(! NILP (Vlocale_coding_system) \ |
616 |
&& XFASTINT (Vlocale_coding_system) != 0 \ |
&& !EQ (Vlocale_coding_system, make_number (0)) \ |
617 |
? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ |
? code_convert_string_norecord (str, Vlocale_coding_system, 0) \ |
618 |
: str) |
: str) |
619 |
|
|
620 |
#else /* WINDOWSNT */ |
#else /* WINDOWSNT */ |