Mercurial > hg > xemacs-beta
comparison src/syswindows.h @ 867:804517e16990
[xemacs-hg @ 2002-06-05 09:54:39 by ben]
Textual renaming: text/char names
abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, callint.c, casefiddle.c, casetab.c, charset.h, chartab.c, chartab.h, cmds.c, console-gtk.h, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console-x.h, console.h, data.c, device-msw.c, device-x.c, dialog-msw.c, dired-msw.c, dired.c, doc.c, doprnt.c, editfns.c, eldap.c, emodules.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-unixoid.c, events.c, events.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, font-lock.c, frame-gtk.c, frame-msw.c, frame-x.c, frame.c, glyphs-eimage.c, glyphs-msw.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-x.c, gui-x.h, gui.c, gui.h, hpplay.c, indent.c, insdel.c, insdel.h, intl-win32.c, keymap.c, line-number.c, line-number.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, md5.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-ccl.c, mule-charset.c, mule-coding.c, mule-wnnfns.c, ndir.h, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, procimpl.h, realpath.c, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, redisplay.h, regex.c, search.c, select-common.h, select-gtk.c, select-x.c, sound.h, symbols.c, syntax.c, syntax.h, sysdep.c, sysdep.h, sysdir.h, sysfile.h, sysproc.h, syspwd.h, systime.h, syswindows.h, termcap.c, tests.c, text.c, text.h, toolbar-common.c, tooltalk.c, ui-gtk.c, unexnt.c, unicode.c, win32.c: Text/char naming rationalization.
[a] distinguish between "charptr" when it refers to operations on
the pointer itself and when it refers to operations on text; and
[b] use consistent naming for everything referring to internal
format, i.e.
Itext == text in internal format
Ibyte == a byte in such text
Ichar == a char as represented in internal character format
thus e.g.
set_charptr_emchar -> set_itext_ichar
The pre and post tags on either side of this change are:
pre-internal-format-textual-renaming
post-internal-format-textual-renaming
See the Internals Manual for details of exactly how this was done,
how to handle the change in your workspace, etc.
author | ben |
---|---|
date | Wed, 05 Jun 2002 09:58:45 +0000 |
parents | e7ee5f8bde58 |
children | 79c6ff3eef26 |
comparison
equal
deleted
inserted
replaced
866:613552a02607 | 867:804517e16990 |
---|---|
796 } | 796 } |
797 | 797 |
798 Extbyte *convert_multibyte_to_unicode_malloc (const Extbyte *src, | 798 Extbyte *convert_multibyte_to_unicode_malloc (const Extbyte *src, |
799 Bytecount n, | 799 Bytecount n, |
800 int cp, Bytecount *size_out); | 800 int cp, Bytecount *size_out); |
801 Intbyte *convert_multibyte_to_internal_malloc (const Extbyte *src, | 801 Ibyte *convert_multibyte_to_internal_malloc (const Extbyte *src, |
802 Bytecount n, | 802 Bytecount n, |
803 int cp, Bytecount *size_out); | 803 int cp, Bytecount *size_out); |
804 void convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n, | 804 void convert_multibyte_to_unicode_dynarr (const Extbyte *src, Bytecount n, |
805 int cp, unsigned_char_dynarr *dst); | 805 int cp, unsigned_char_dynarr *dst); |
806 | 806 |
825 #endif | 825 #endif |
826 #endif | 826 #endif |
827 | 827 |
828 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ | 828 #define LOCAL_FILE_FORMAT_TO_TSTR(path, out) \ |
829 do { \ | 829 do { \ |
830 Intbyte *lttff; \ | 830 Ibyte *lttff; \ |
831 \ | 831 \ |
832 LOCAL_TO_WIN32_FILE_FORMAT (XSTRING_DATA (path), lttff); \ | 832 LOCAL_TO_WIN32_FILE_FORMAT (XSTRING_DATA (path), lttff); \ |
833 C_STRING_TO_TSTR (lttff, out); \ | 833 C_STRING_TO_TSTR (lttff, out); \ |
834 } while (0) | 834 } while (0) |
835 | 835 |
852 with external-format data. But in point of fact, the Cygwin \ | 852 with external-format data. But in point of fact, the Cygwin \ |
853 conversion functions are *NOT* localized, and will fail if they \ | 853 conversion functions are *NOT* localized, and will fail if they \ |
854 get 7-bit ISO2022-encoded data. We know that our internal format \ | 854 get 7-bit ISO2022-encoded data. We know that our internal format \ |
855 is ASCII-compatible, and so these functions will work fine with \ | 855 is ASCII-compatible, and so these functions will work fine with \ |
856 this data. */ \ | 856 this data. */ \ |
857 Intbyte *ltwffp = (path); \ | 857 Ibyte *ltwffp = (path); \ |
858 if (isalpha (ltwffp[0]) && (IS_DEVICE_SEP (ltwffp[1]))) \ | 858 if (isalpha (ltwffp[0]) && (IS_DEVICE_SEP (ltwffp[1]))) \ |
859 pathout = ltwffp; \ | 859 pathout = ltwffp; \ |
860 else \ | 860 else \ |
861 { \ | 861 { \ |
862 int ltwff2 = \ | 862 int ltwff2 = \ |
863 cygwin_posix_to_win32_path_list_buf_size ((char *) ltwffp); \ | 863 cygwin_posix_to_win32_path_list_buf_size ((char *) ltwffp); \ |
864 pathout = (Intbyte *) ALLOCA (ltwff2); \ | 864 pathout = (Ibyte *) ALLOCA (ltwff2); \ |
865 cygwin_posix_to_win32_path_list ((char *) ltwffp, (char *) pathout); \ | 865 cygwin_posix_to_win32_path_list ((char *) ltwffp, (char *) pathout); \ |
866 } \ | 866 } \ |
867 } while (0) | 867 } while (0) |
868 #else | 868 #else |
869 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \ | 869 #define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout) \ |
873 #endif | 873 #endif |
874 | 874 |
875 #ifdef CYGWIN | 875 #ifdef CYGWIN |
876 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ | 876 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ |
877 do { \ | 877 do { \ |
878 Intbyte *wtlff1 = (path); \ | 878 Ibyte *wtlff1 = (path); \ |
879 int wtlff2 = \ | 879 int wtlff2 = \ |
880 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ | 880 cygwin_win32_to_posix_path_list_buf_size ((char *) wtlff1); \ |
881 Intbyte *wtlff3 = (Intbyte *) ALLOCA (wtlff2); \ | 881 Ibyte *wtlff3 = (Ibyte *) ALLOCA (wtlff2); \ |
882 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ | 882 cygwin_win32_to_posix_path_list ((char *) wtlff1, (char *) wtlff3); \ |
883 (pathout) = wtlff3; \ | 883 (pathout) = wtlff3; \ |
884 } while (0) | 884 } while (0) |
885 #else | 885 #else |
886 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ | 886 #define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout) \ |
895 #ifdef CYGWIN | 895 #ifdef CYGWIN |
896 | 896 |
897 #define LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ | 897 #define LOCAL_FILE_FORMAT_MAYBE_URL_TO_TSTR(lispstr, pathout) \ |
898 do \ | 898 do \ |
899 { \ | 899 { \ |
900 Intbyte *lffmutt_fname1; \ | 900 Ibyte *lffmutt_fname1; \ |
901 Intbyte *lffmutt_pathint = XSTRING_DATA (lispstr); \ | 901 Ibyte *lffmutt_pathint = XSTRING_DATA (lispstr); \ |
902 \ | 902 \ |
903 if ((lffmutt_fname1 = qxestrchr (lffmutt_pathint, ':')) != NULL \ | 903 if ((lffmutt_fname1 = qxestrchr (lffmutt_pathint, ':')) != NULL \ |
904 && *++lffmutt_fname1 == '/' && *++lffmutt_fname1 == '/') \ | 904 && *++lffmutt_fname1 == '/' && *++lffmutt_fname1 == '/') \ |
905 { \ | 905 { \ |
906 /* If URL style file, the innards may have Cygwin mount points and \ | 906 /* If URL style file, the innards may have Cygwin mount points and \ |
907 the like. so separate out the innards, process them, and put back \ | 907 the like. so separate out the innards, process them, and put back \ |
908 together. */ \ | 908 together. */ \ |
909 if (qxestrncasecmp_c (lffmutt_pathint, "file://", 7) == 0) \ | 909 if (qxestrncasecmp_c (lffmutt_pathint, "file://", 7) == 0) \ |
910 { \ | 910 { \ |
911 Intbyte *lffmutt_path1, *lffmutt_path2; \ | 911 Ibyte *lffmutt_path1, *lffmutt_path2; \ |
912 LOCAL_TO_WIN32_FILE_FORMAT (lffmutt_pathint + 7, lffmutt_path1); \ | 912 LOCAL_TO_WIN32_FILE_FORMAT (lffmutt_pathint + 7, lffmutt_path1); \ |
913 if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */ \ | 913 if (lffmutt_path1 == lffmutt_pathint + 7) /* Optimization */ \ |
914 lffmutt_path2 = lffmutt_pathint; \ | 914 lffmutt_path2 = lffmutt_pathint; \ |
915 else \ | 915 else \ |
916 { \ | 916 { \ |
917 lffmutt_path2 = alloca_intbytes (7 + qxestrlen (lffmutt_path1) \ | 917 lffmutt_path2 = alloca_ibytes (7 + qxestrlen (lffmutt_path1) \ |
918 + 1); \ | 918 + 1); \ |
919 qxestrncpy (lffmutt_path2, lffmutt_pathint, 7); \ | 919 qxestrncpy (lffmutt_path2, lffmutt_pathint, 7); \ |
920 qxestrcpy (lffmutt_path2 + 7, lffmutt_path1); \ | 920 qxestrcpy (lffmutt_path2 + 7, lffmutt_path1); \ |
921 } \ | 921 } \ |
922 C_STRING_TO_TSTR (lffmutt_path2, pathout); \ | 922 C_STRING_TO_TSTR (lffmutt_path2, pathout); \ |
937 LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout) | 937 LOCAL_FILE_FORMAT_TO_TSTR (lispstr, pathout) |
938 | 938 |
939 #endif /* not CYGWIN */ | 939 #endif /* not CYGWIN */ |
940 | 940 |
941 | 941 |
942 Intbyte *urlify_filename (Intbyte *filename); | 942 Ibyte *urlify_filename (Ibyte *filename); |
943 Intbyte *mswindows_canonicalize_filename (Intbyte *name); | 943 Ibyte *mswindows_canonicalize_filename (Ibyte *name); |
944 #define MSWINDOWS_NORMALIZE_FILENAME(name) \ | 944 #define MSWINDOWS_NORMALIZE_FILENAME(name) \ |
945 INTBYTE_STRING_TO_ALLOCA (mswindows_canonicalize_filename (name), name) | 945 IBYTE_STRING_TO_ALLOCA (mswindows_canonicalize_filename (name), name) |
946 | 946 |
947 /* ------------------- Functions needed dynamic binding ------------------- */ | 947 /* ------------------- Functions needed dynamic binding ------------------- */ |
948 | 948 |
949 typedef BOOL (WINAPI *pfSwitchToThread_t) (VOID); | 949 typedef BOOL (WINAPI *pfSwitchToThread_t) (VOID); |
950 | 950 |
959 | 959 |
960 /* --------- Useful routines for manipulating memory-mapped files -------- */ | 960 /* --------- Useful routines for manipulating memory-mapped files -------- */ |
961 | 961 |
962 typedef struct file_data | 962 typedef struct file_data |
963 { | 963 { |
964 const Intbyte *name; | 964 const Ibyte *name; |
965 unsigned long size; | 965 unsigned long size; |
966 HANDLE file; | 966 HANDLE file; |
967 HANDLE file_mapping; | 967 HANDLE file_mapping; |
968 void *file_base; | 968 void *file_base; |
969 } file_data; | 969 } file_data; |
978 | 978 |
979 #define RVA_TO_PTR(var,section,filedata) \ | 979 #define RVA_TO_PTR(var,section,filedata) \ |
980 ((void *)(RVA_TO_OFFSET(var,section) + \ | 980 ((void *)(RVA_TO_OFFSET(var,section) + \ |
981 (char *)(filedata).file_base)) | 981 (char *)(filedata).file_base)) |
982 | 982 |
983 int open_input_file (file_data *p_file, const Intbyte *name); | 983 int open_input_file (file_data *p_file, const Ibyte *name); |
984 int open_output_file (file_data *p_file, const Intbyte *name, | 984 int open_output_file (file_data *p_file, const Ibyte *name, |
985 unsigned long size); | 985 unsigned long size); |
986 void close_file_data (file_data *p_file); | 986 void close_file_data (file_data *p_file); |
987 | 987 |
988 /* ------------------------- Heap related stuff ------------------------- */ | 988 /* ------------------------- Heap related stuff ------------------------- */ |
989 | 989 |
1035 /* ------------------------- Misc prototypes ------------------------- */ | 1035 /* ------------------------- Misc prototypes ------------------------- */ |
1036 | 1036 |
1037 #ifdef WIN32_NATIVE | 1037 #ifdef WIN32_NATIVE |
1038 DECLARE_INLINE_HEADER (int strcasecmp (const char *a, const char *b)) | 1038 DECLARE_INLINE_HEADER (int strcasecmp (const char *a, const char *b)) |
1039 { | 1039 { |
1040 return qxestrcasecmp ((const Intbyte *) a, (const Intbyte *) b); | 1040 return qxestrcasecmp ((const Ibyte *) a, (const Ibyte *) b); |
1041 } | 1041 } |
1042 #endif /* WIN32_NATIVE */ | 1042 #endif /* WIN32_NATIVE */ |
1043 | 1043 |
1044 /* in nt.c */ | 1044 /* in nt.c */ |
1045 int mswindows_access (const Intbyte *path, int mode); | 1045 int mswindows_access (const Ibyte *path, int mode); |
1046 int mswindows_link (const Intbyte *old, const Intbyte *new); | 1046 int mswindows_link (const Ibyte *old, const Ibyte *new); |
1047 int mswindows_rename (const Intbyte *oldname, const Intbyte *newname); | 1047 int mswindows_rename (const Ibyte *oldname, const Ibyte *newname); |
1048 int mswindows_unlink (const Intbyte *path); | 1048 int mswindows_unlink (const Ibyte *path); |
1049 int mswindows_stat (const Intbyte *path, struct stat *buf); | 1049 int mswindows_stat (const Ibyte *path, struct stat *buf); |
1050 int mswindows_fstat (int desc, struct stat *buf); | 1050 int mswindows_fstat (int desc, struct stat *buf); |
1051 time_t mswindows_convert_time (FILETIME ft); | 1051 time_t mswindows_convert_time (FILETIME ft); |
1052 void mswindows_executable_type (const Intbyte * filename, int * is_dos_app, | 1052 void mswindows_executable_type (const Ibyte * filename, int * is_dos_app, |
1053 int * is_cygnus_app); | 1053 int * is_cygnus_app); |
1054 Intbyte *mswindows_getdcwd (int drivelet); | 1054 Ibyte *mswindows_getdcwd (int drivelet); |
1055 | 1055 |
1056 /* In process-nt.c */ | 1056 /* In process-nt.c */ |
1057 extern int mswindows_compare_env (const void *strp1, const void *strp2); | 1057 extern int mswindows_compare_env (const void *strp1, const void *strp2); |
1058 | 1058 |
1059 /* in win32.c */ | 1059 /* in win32.c */ |