aboutsummaryrefslogtreecommitdiffstats
path: root/src/textprop.c
diff options
context:
space:
mode:
authorDan Nicolaescu2010-07-04 00:50:25 -0700
committerDan Nicolaescu2010-07-04 00:50:25 -0700
commit971de7fb158335fbda39525feb2d7776a26bc030 (patch)
tree605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/textprop.c
parentb8463cbfbe2c5183cf40772df2746e58b787ddeb (diff)
downloademacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz
emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C. * src/atimer.c: * src/bidi.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/ccl.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/doprnt.c: * src/ecrt0.c: * src/editfns.c: * src/fileio.c: * src/filelock.c: * src/filemode.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/ftfont.c: * src/ftxfont.c: * src/gtkutil.c: * src/indent.c: * src/insdel.c: * src/intervals.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/md5.c: * src/menu.c: * src/minibuf.c: * src/prefix-args.c: * src/print.c: * src/ralloc.c: * src/regex.c: * src/region-cache.c: * src/scroll.c: * src/search.c: * src/sound.c: * src/strftime.c: * src/syntax.c: * src/sysdep.c: * src/termcap.c: * src/terminal.c: * src/terminfo.c: * src/textprop.c: * src/tparam.c: * src/undo.c: * src/unexelf.c: * src/window.c: * src/xfaces.c: * src/xfns.c: * src/xfont.c: * src/xftfont.c: * src/xgselect.c: * src/xmenu.c: * src/xrdb.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: * src/xterm.c: Likewise.
Diffstat (limited to 'src/textprop.c')
-rw-r--r--src/textprop.c85
1 files changed, 24 insertions, 61 deletions
diff --git a/src/textprop.c b/src/textprop.c
index 7e2f2b8f4db..a3294a0650a 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -85,8 +85,7 @@ static void text_read_only (Lisp_Object) NO_RETURN;
85 to capture that error in GDB by putting a breakpoint on it. */ 85 to capture that error in GDB by putting a breakpoint on it. */
86 86
87static void 87static void
88text_read_only (propval) 88text_read_only (Lisp_Object propval)
89 Lisp_Object propval;
90{ 89{
91 if (STRINGP (propval)) 90 if (STRINGP (propval))
92 xsignal1 (Qtext_read_only, propval); 91 xsignal1 (Qtext_read_only, propval);
@@ -123,9 +122,7 @@ text_read_only (propval)
123#define hard 1 122#define hard 1
124 123
125INTERVAL 124INTERVAL
126validate_interval_range (object, begin, end, force) 125validate_interval_range (Lisp_Object object, Lisp_Object *begin, Lisp_Object *end, int force)
127 Lisp_Object object, *begin, *end;
128 int force;
129{ 126{
130 register INTERVAL i; 127 register INTERVAL i;
131 int searchpos; 128 int searchpos;
@@ -191,8 +188,7 @@ validate_interval_range (object, begin, end, force)
191 is even numbered and thus suitable as a plist. */ 188 is even numbered and thus suitable as a plist. */
192 189
193static Lisp_Object 190static Lisp_Object
194validate_plist (list) 191validate_plist (Lisp_Object list)
195 Lisp_Object list;
196{ 192{
197 if (NILP (list)) 193 if (NILP (list))
198 return Qnil; 194 return Qnil;
@@ -218,9 +214,7 @@ validate_plist (list)
218 with the same values, of list PLIST. */ 214 with the same values, of list PLIST. */
219 215
220static int 216static int
221interval_has_all_properties (plist, i) 217interval_has_all_properties (Lisp_Object plist, INTERVAL i)
222 Lisp_Object plist;
223 INTERVAL i;
224{ 218{
225 register Lisp_Object tail1, tail2, sym1; 219 register Lisp_Object tail1, tail2, sym1;
226 register int found; 220 register int found;
@@ -256,9 +250,7 @@ interval_has_all_properties (plist, i)
256 properties of PLIST, regardless of their values. */ 250 properties of PLIST, regardless of their values. */
257 251
258static INLINE int 252static INLINE int
259interval_has_some_properties (plist, i) 253interval_has_some_properties (Lisp_Object plist, INTERVAL i)
260 Lisp_Object plist;
261 INTERVAL i;
262{ 254{
263 register Lisp_Object tail1, tail2, sym; 255 register Lisp_Object tail1, tail2, sym;
264 256
@@ -280,9 +272,7 @@ interval_has_some_properties (plist, i)
280 property names in LIST, regardless of their values. */ 272 property names in LIST, regardless of their values. */
281 273
282static INLINE int 274static INLINE int
283interval_has_some_properties_list (list, i) 275interval_has_some_properties_list (Lisp_Object list, INTERVAL i)
284 Lisp_Object list;
285 INTERVAL i;
286{ 276{
287 register Lisp_Object tail1, tail2, sym; 277 register Lisp_Object tail1, tail2, sym;
288 278
@@ -305,8 +295,7 @@ interval_has_some_properties_list (list, i)
305/* Return the value of PROP in property-list PLIST, or Qunbound if it 295/* Return the value of PROP in property-list PLIST, or Qunbound if it
306 has none. */ 296 has none. */
307static Lisp_Object 297static Lisp_Object
308property_value (plist, prop) 298property_value (Lisp_Object plist, Lisp_Object prop)
309 Lisp_Object plist, prop;
310{ 299{
311 Lisp_Object value; 300 Lisp_Object value;
312 301
@@ -324,9 +313,7 @@ property_value (plist, prop)
324 OBJECT is the string or buffer that INTERVAL belongs to. */ 313 OBJECT is the string or buffer that INTERVAL belongs to. */
325 314
326static void 315static void
327set_properties (properties, interval, object) 316set_properties (Lisp_Object properties, INTERVAL interval, Lisp_Object object)
328 Lisp_Object properties, object;
329 INTERVAL interval;
330{ 317{
331 Lisp_Object sym, value; 318 Lisp_Object sym, value;
332 319
@@ -372,10 +359,7 @@ set_properties (properties, interval, object)
372 are actually added to I's plist) */ 359 are actually added to I's plist) */
373 360
374static int 361static int
375add_properties (plist, i, object) 362add_properties (Lisp_Object plist, INTERVAL i, Lisp_Object object)
376 Lisp_Object plist;
377 INTERVAL i;
378 Lisp_Object object;
379{ 363{
380 Lisp_Object tail1, tail2, sym1, val1; 364 Lisp_Object tail1, tail2, sym1, val1;
381 register int changed = 0; 365 register int changed = 0;
@@ -451,10 +435,7 @@ add_properties (plist, i, object)
451 OBJECT is the string or buffer containing I. */ 435 OBJECT is the string or buffer containing I. */
452 436
453static int 437static int
454remove_properties (plist, list, i, object) 438remove_properties (Lisp_Object plist, Lisp_Object list, INTERVAL i, Lisp_Object object)
455 Lisp_Object plist, list;
456 INTERVAL i;
457 Lisp_Object object;
458{ 439{
459 register Lisp_Object tail1, tail2, sym, current_plist; 440 register Lisp_Object tail1, tail2, sym, current_plist;
460 register int changed = 0; 441 register int changed = 0;
@@ -535,9 +516,7 @@ erase_properties (i)
535 POSITION is BEG-based. */ 516 POSITION is BEG-based. */
536 517
537INTERVAL 518INTERVAL
538interval_of (position, object) 519interval_of (int position, Lisp_Object object)
539 int position;
540 Lisp_Object object;
541{ 520{
542 register INTERVAL i; 521 register INTERVAL i;
543 int beg, end; 522 int beg, end;
@@ -623,10 +602,7 @@ If POSITION is at the end of OBJECT, the value is nil. */)
623 window-specific overlays are considered only if they are associated 602 window-specific overlays are considered only if they are associated
624 with OBJECT. */ 603 with OBJECT. */
625Lisp_Object 604Lisp_Object
626get_char_property_and_overlay (position, prop, object, overlay) 605get_char_property_and_overlay (Lisp_Object position, register Lisp_Object prop, Lisp_Object object, Lisp_Object *overlay)
627 Lisp_Object position, object;
628 register Lisp_Object prop;
629 Lisp_Object *overlay;
630{ 606{
631 struct window *w = 0; 607 struct window *w = 0;
632 608
@@ -1020,8 +996,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */)
1020/* Return 1 if there's a change in some property between BEG and END. */ 996/* Return 1 if there's a change in some property between BEG and END. */
1021 997
1022int 998int
1023property_change_between_p (beg, end) 999property_change_between_p (int beg, int end)
1024 int beg, end;
1025{ 1000{
1026 register INTERVAL i, next; 1001 register INTERVAL i, next;
1027 Lisp_Object object, pos; 1002 Lisp_Object object, pos;
@@ -1353,8 +1328,7 @@ the designated part of OBJECT. */)
1353 otherwise. */ 1328 otherwise. */
1354 1329
1355Lisp_Object 1330Lisp_Object
1356set_text_properties (start, end, properties, object, coherent_change_p) 1331set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object, Lisp_Object coherent_change_p)
1357 Lisp_Object start, end, properties, object, coherent_change_p;
1358{ 1332{
1359 register INTERVAL i; 1333 register INTERVAL i;
1360 Lisp_Object ostart, oend; 1334 Lisp_Object ostart, oend;
@@ -1418,9 +1392,7 @@ set_text_properties (start, end, properties, object, coherent_change_p)
1418 START and END can be in any order. */ 1392 START and END can be in any order. */
1419 1393
1420void 1394void
1421set_text_properties_1 (start, end, properties, buffer, i) 1395set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object buffer, INTERVAL i)
1422 Lisp_Object start, end, properties, buffer;
1423 INTERVAL i;
1424{ 1396{
1425 register INTERVAL prev_changed = NULL_INTERVAL; 1397 register INTERVAL prev_changed = NULL_INTERVAL;
1426 register int s, len; 1398 register int s, len;
@@ -1777,8 +1749,7 @@ markers). If OBJECT is a string, START and END are 0-based indices into it. */
1777 BUFFER can be either a buffer or nil (meaning current buffer). */ 1749 BUFFER can be either a buffer or nil (meaning current buffer). */
1778 1750
1779int 1751int
1780text_property_stickiness (prop, pos, buffer) 1752text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
1781 Lisp_Object prop, pos, buffer;
1782{ 1753{
1783 Lisp_Object prev_pos, front_sticky; 1754 Lisp_Object prev_pos, front_sticky;
1784 int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */ 1755 int is_rear_sticky = 1, is_front_sticky = 0; /* defaults */
@@ -1851,8 +1822,7 @@ text_property_stickiness (prop, pos, buffer)
1851/* Note this can GC when DEST is a buffer. */ 1822/* Note this can GC when DEST is a buffer. */
1852 1823
1853Lisp_Object 1824Lisp_Object
1854copy_text_properties (start, end, src, pos, dest, prop) 1825copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_Object pos, Lisp_Object dest, Lisp_Object prop)
1855 Lisp_Object start, end, src, pos, dest, prop;
1856{ 1826{
1857 INTERVAL i; 1827 INTERVAL i;
1858 Lisp_Object res; 1828 Lisp_Object res;
@@ -1944,8 +1914,7 @@ copy_text_properties (start, end, src, pos, dest, prop)
1944 doesn't contain text properties between START and END. */ 1914 doesn't contain text properties between START and END. */
1945 1915
1946Lisp_Object 1916Lisp_Object
1947text_property_list (object, start, end, prop) 1917text_property_list (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object prop)
1948 Lisp_Object object, start, end, prop;
1949{ 1918{
1950 struct interval *i; 1919 struct interval *i;
1951 Lisp_Object result; 1920 Lisp_Object result;
@@ -2002,8 +1971,7 @@ text_property_list (object, start, end, prop)
2002 non-zero if OBJECT was modified. */ 1971 non-zero if OBJECT was modified. */
2003 1972
2004int 1973int
2005add_text_properties_from_list (object, list, delta) 1974add_text_properties_from_list (Lisp_Object object, Lisp_Object list, Lisp_Object delta)
2006 Lisp_Object object, list, delta;
2007{ 1975{
2008 struct gcpro gcpro1, gcpro2; 1976 struct gcpro gcpro1, gcpro2;
2009 int modified_p = 0; 1977 int modified_p = 0;
@@ -2036,8 +2004,7 @@ add_text_properties_from_list (object, list, delta)
2036 end-points to NEW_END. */ 2004 end-points to NEW_END. */
2037 2005
2038Lisp_Object 2006Lisp_Object
2039extend_property_ranges (list, new_end) 2007extend_property_ranges (Lisp_Object list, Lisp_Object new_end)
2040 Lisp_Object list, new_end;
2041{ 2008{
2042 Lisp_Object prev = Qnil, head = list; 2009 Lisp_Object prev = Qnil, head = list;
2043 int max = XINT (new_end); 2010 int max = XINT (new_end);
@@ -2072,8 +2039,7 @@ extend_property_ranges (list, new_end)
2072/* Call the modification hook functions in LIST, each with START and END. */ 2039/* Call the modification hook functions in LIST, each with START and END. */
2073 2040
2074static void 2041static void
2075call_mod_hooks (list, start, end) 2042call_mod_hooks (Lisp_Object list, Lisp_Object start, Lisp_Object end)
2076 Lisp_Object list, start, end;
2077{ 2043{
2078 struct gcpro gcpro1; 2044 struct gcpro gcpro1;
2079 GCPRO1 (list); 2045 GCPRO1 (list);
@@ -2094,9 +2060,7 @@ call_mod_hooks (list, start, end)
2094 those hooks in order, with START and END - 1 as arguments. */ 2060 those hooks in order, with START and END - 1 as arguments. */
2095 2061
2096void 2062void
2097verify_interval_modification (buf, start, end) 2063verify_interval_modification (struct buffer *buf, int start, int end)
2098 struct buffer *buf;
2099 int start, end;
2100{ 2064{
2101 register INTERVAL intervals = BUF_INTERVALS (buf); 2065 register INTERVAL intervals = BUF_INTERVALS (buf);
2102 register INTERVAL i; 2066 register INTERVAL i;
@@ -2274,8 +2238,7 @@ verify_interval_modification (buf, start, end)
2274 so it can indicate the range of inserted text. */ 2238 so it can indicate the range of inserted text. */
2275 2239
2276void 2240void
2277report_interval_modification (start, end) 2241report_interval_modification (Lisp_Object start, Lisp_Object end)
2278 Lisp_Object start, end;
2279{ 2242{
2280 if (! NILP (interval_insert_behind_hooks)) 2243 if (! NILP (interval_insert_behind_hooks))
2281 call_mod_hooks (interval_insert_behind_hooks, start, end); 2244 call_mod_hooks (interval_insert_behind_hooks, start, end);
@@ -2286,7 +2249,7 @@ report_interval_modification (start, end)
2286} 2249}
2287 2250
2288void 2251void
2289syms_of_textprop () 2252syms_of_textprop (void)
2290{ 2253{
2291 DEFVAR_LISP ("default-text-properties", &Vdefault_text_properties, 2254 DEFVAR_LISP ("default-text-properties", &Vdefault_text_properties,
2292 doc: /* Property-list used as default values. 2255 doc: /* Property-list used as default values.