Mercurial > hg > xemacs-beta
diff src/editfns.c @ 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 | 2b6fa2618f76 |
children | 79c6ff3eef26 |
line wrap: on
line diff
--- a/src/editfns.c Tue Jun 04 17:40:00 2002 +0000 +++ b/src/editfns.c Wed Jun 05 09:58:45 2002 +0000 @@ -82,7 +82,7 @@ init_editfns (void) { /* Only used in removed code below. */ - Intbyte *p; + Ibyte *p; environbuf = 0; @@ -108,7 +108,7 @@ (character)) { Bytecount len; - Intbyte str[MAX_EMCHAR_LEN]; + Ibyte str[MAX_ICHAR_LEN]; if (EVENTP (character)) { @@ -121,7 +121,7 @@ CHECK_CHAR_COERCE_INT (character); - len = set_charptr_emchar (str, XCHAR (character)); + len = set_itext_ichar (str, XCHAR (character)); return make_string (str, len); } @@ -134,7 +134,7 @@ CHECK_STRING (string); if (XSTRING_LENGTH (string) != 0) - return make_char (string_emchar (string, 0)); + return make_char (string_ichar (string, 0)); else /* This used to return Qzero. That is broken, broken, broken. */ /* It might be kinder to signal an error directly. -slb */ @@ -592,22 +592,22 @@ */ ()) { - Intbyte *tmpdir; + Ibyte *tmpdir; #if defined(WIN32_NATIVE) tmpdir = egetenv ("TEMP"); if (!tmpdir) tmpdir = egetenv ("TMP"); if (!tmpdir) - tmpdir = (Intbyte *) "c:\\"; + tmpdir = (Ibyte *) "c:\\"; #else /* WIN32_NATIVE */ tmpdir = egetenv ("TMPDIR"); if (!tmpdir) { struct stat st; int myuid = getuid (); - Intbyte *login_name = user_login_name (NULL); + Ibyte *login_name = user_login_name (NULL); DECLARE_EISTRING (eipath); - Intbyte *path; + Ibyte *path; eicpy_c (eipath, "/tmp/"); eicat_rawz (eipath, login_name); @@ -642,7 +642,7 @@ if (qxe_stat (path, &st) == 0 && S_ISDIR (st.st_mode)) tmpdir = path; else - tmpdir = (Intbyte *) "/tmp"; + tmpdir = (Ibyte *) "/tmp"; } } #endif @@ -660,7 +660,7 @@ */ (uid)) { - Intbyte *returned_name; + Ibyte *returned_name; uid_t local_uid; if (!NILP (uid)) @@ -689,21 +689,21 @@ WARNING: The string returned comes from the data of a Lisp string and therefore will become garbage after the next GC. */ -Intbyte * +Ibyte * user_login_name (uid_t *uid) { /* uid == NULL to return name of this user */ if (uid != NULL) { struct passwd *pw = qxe_getpwuid (*uid); - return pw ? (Intbyte *) pw->pw_name : NULL; + return pw ? (Ibyte *) pw->pw_name : NULL; } else { /* #### - when euid != uid, then LOGNAME and USER are leftovers from the old environment (I site observed behavior on sunos and linux), so the environment variables should be disregarded in that case. --Stig */ - Intbyte *user_name = egetenv ("LOGNAME"); + Ibyte *user_name = egetenv ("LOGNAME"); if (!user_name) user_name = egetenv ( #ifdef WIN32_NATIVE @@ -723,7 +723,7 @@ cannot be determined. */ /* !!#### fix up in my mule ws */ - return (Intbyte *) (pw ? pw->pw_name : "unknown"); + return (Ibyte *) (pw ? pw->pw_name : "unknown"); #else /* For all but Cygwin return NULL (nil) */ return pw ? pw->pw_name : NULL; @@ -774,7 +774,7 @@ Lisp_Object user_name; struct passwd *pw = NULL; Lisp_Object tem; - const Intbyte *p, *q; + const Ibyte *p, *q; if (NILP (user) && STRINGP (Vuser_full_name)) return Vuser_full_name; @@ -792,10 +792,10 @@ /* #### - Stig sez: this should return nil instead of "unknown" when pw==0 */ /* Ben sez: bad idea because it's likely to break something */ #ifndef AMPERSAND_FULL_NAME - p = (Intbyte *) (pw ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = (Ibyte *) (pw ? USER_FULL_NAME : "unknown"); /* don't gettext */ q = qxestrchr (p, ','); #else - p = (Intbyte *) (pw ? USER_FULL_NAME : "unknown"); /* don't gettext */ + p = (Ibyte *) (pw ? USER_FULL_NAME : "unknown"); /* don't gettext */ q = qxestrchr (p, ','); #endif tem = ((!NILP (user) && !pw) @@ -823,7 +823,7 @@ return tem; } -static Intbyte *cached_home_directory; +static Ibyte *cached_home_directory; void uncache_home_directory (void) @@ -834,7 +834,7 @@ } /* Returns the home directory */ -Intbyte * +Ibyte * get_home_directory (void) { int output_home_warning = 0; @@ -847,13 +847,13 @@ else { #if defined (WIN32_NATIVE) - Intbyte *homedrive, *homepath; + Ibyte *homedrive, *homepath; if ((homedrive = egetenv ("HOMEDRIVE")) != NULL && (homepath = egetenv ("HOMEPATH")) != NULL) { cached_home_directory = - (Intbyte *) xmalloc (qxestrlen (homedrive) + + (Ibyte *) xmalloc (qxestrlen (homedrive) + qxestrlen (homepath) + 1); qxesprintf (cached_home_directory, "%s%s", homedrive, @@ -861,7 +861,7 @@ } else { - cached_home_directory = qxestrdup ((Intbyte *) "C:\\"); + cached_home_directory = qxestrdup ((Ibyte *) "C:\\"); output_home_warning = 1; } #else /* !WIN32_NATIVE */ @@ -871,7 +871,7 @@ * We probably should try to extract pw_dir from /etc/passwd, * before falling back to this. */ - cached_home_directory = qxestrdup ((Intbyte *) "/"); + cached_home_directory = qxestrdup ((Ibyte *) "/"); output_home_warning = 1; #endif /* !WIN32_NATIVE */ } @@ -894,7 +894,7 @@ */ ()) { - Intbyte *path = get_home_directory (); + Ibyte *path = get_home_directory (); return !path ? Qnil : Fexpand_file_name (Fsubstitute_in_file_name (build_intstring (path)), @@ -1229,7 +1229,7 @@ (specified_time)) { time_t value; - Intbyte *the_ctime; + Ibyte *the_ctime; EMACS_INT len; /* this is what make_ext_string() accepts; #### should it be an Bytecount? */ @@ -1316,7 +1316,7 @@ tem = build_ext_string (s, Qnative); else { - Intbyte buf[6]; + Ibyte buf[6]; /* No local time zone name is available; use "+-NNNN" instead. */ int am = (offset < 0 ? -offset : offset) / 60; @@ -1558,12 +1558,12 @@ (character, count, ignored, buffer)) { /* This function can GC */ - REGISTER Intbyte *string; + REGISTER Ibyte *string; REGISTER Bytecount slen; REGISTER Bytecount i, j; REGISTER Bytecount n; REGISTER Bytecount charlen; - Intbyte str[MAX_EMCHAR_LEN]; + Ibyte str[MAX_ICHAR_LEN]; struct buffer *b = decode_buffer (buffer, 1); int cou; @@ -1576,12 +1576,12 @@ cou = XINT (count); } - charlen = set_charptr_emchar (str, XCHAR (character)); + charlen = set_itext_ichar (str, XCHAR (character)); n = cou * charlen; if (n <= 0) return Qnil; slen = min (n, (Bytecount) 768); - string = alloca_array (Intbyte, slen); + string = alloca_array (Ibyte, slen); /* Write as many copies of the character into the temp string as will fit. */ for (i = 0; i + charlen <= slen; i += charlen) for (j = 0; j < charlen; j++) @@ -1703,8 +1703,8 @@ for (i = 0; i < length; i++) { - Emchar c1 = BUF_FETCH_CHAR (bp1, begp1 + i); - Emchar c2 = BUF_FETCH_CHAR (bp2, begp2 + i); + Ichar c1 = BUF_FETCH_CHAR (bp1, begp1 + i); + Ichar c2 = BUF_FETCH_CHAR (bp2, begp2 + i); if (!NILP (trt)) { c1 = TRT_TABLE_OF (trt, c1); @@ -1751,7 +1751,7 @@ { /* This function can GC */ Charbpos pos, stop; - Emchar fromc, toc; + Ichar fromc, toc; int mc_count; struct buffer *buf = current_buffer; int count = specpdl_depth (); @@ -1832,7 +1832,7 @@ int cnt = 0; /* Number of changes made. */ int mc_count; struct buffer *buf = current_buffer; - Emchar oc; + Ichar oc; get_buffer_range_char (buf, start, end, &pos, &stop, 0); mc_count = begin_multiple_change (buf, pos, stop); @@ -1840,18 +1840,18 @@ { Charcount size = string_char_length (table); #ifdef MULE - /* Under Mule, string_emchar(n) is O(n), so for large tables or - large regions it makes sense to create an array of Emchars. */ + /* Under Mule, string_ichar(n) is O(n), so for large tables or + large regions it makes sense to create an array of Ichars. */ if (size * (stop - pos) > 65536) { - Emchar *etable = alloca_array (Emchar, size); - convert_intbyte_string_into_emchar_string + Ichar *etable = alloca_array (Ichar, size); + convert_ibyte_string_into_ichar_string (XSTRING_DATA (table), XSTRING_LENGTH (table), etable); for (; pos < stop && (oc = BUF_FETCH_CHAR (buf, pos), 1); pos++) { if (oc < size) { - Emchar nc = etable[oc]; + Ichar nc = etable[oc]; if (nc != oc) { buffer_replace_char (buf, pos, nc, 0, 0); @@ -1867,7 +1867,7 @@ { if (oc < size) { - Emchar nc = string_emchar (table, oc); + Ichar nc = string_ichar (table, oc); if (nc != oc) { buffer_replace_char (buf, pos, nc, 0, 0); @@ -1890,7 +1890,7 @@ retry: if (CHAR_OR_CHAR_INTP (replacement)) { - Emchar nc = XCHAR_OR_CHAR_INT (replacement); + Ichar nc = XCHAR_OR_CHAR_INT (replacement); if (nc != oc) { buffer_replace_char (buf, pos, nc, 0, 0); @@ -1924,7 +1924,7 @@ retry2: if (CHAR_OR_CHAR_INTP (replacement)) { - Emchar nc = XCHAR_OR_CHAR_INT (replacement); + Ichar nc = XCHAR_OR_CHAR_INT (replacement); if (nc != oc) { buffer_replace_char (buf, pos, nc, 0, 0); @@ -2230,7 +2230,7 @@ */ (character1, character2, buffer)) { - Emchar x1, x2; + Ichar x1, x2; struct buffer *b = decode_buffer (buffer, 1); CHECK_CHAR_COERCE_INT (character1);