• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/src/

Lines Matching +defs:table +defs:string

141        doc: /* Return the length of vector, list or string SEQUENCE.
143 If the string contains multibyte characters, this is not necessarily
144 the number of bytes in the string; it is the number of characters.
145 To get the number of bytes, use `string-bytes'. */)
220 DEFUN ("string-bytes", Fstring_bytes, Sstring_bytes, 1, 1, 0,
222 If STRING is a multibyte string, this is greater than the length of STRING. */)
223 (string)
224 Lisp_Object string;
226 CHECK_STRING (string);
227 return make_number (SBYTES (string));
230 DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0,
254 In string STR1, skip the first START1 characters and stop at END1.
255 In string STR2, skip the first START2 characters and stop at END2.
262 If string STR1 is less, the value is a negative number N;
264 If string STR1 is greater, the value is a positive number N;
354 DEFUN ("string-lessp", Fstring_lessp, Sstring_lessp, 2, 2, 0,
355 doc: /* Return t if first arg string is less than second in lexicographic order.
436 Each argument may be a list, vector or string.
447 doc: /* Concatenate all the arguments and make the result a string.
448 The result is a string whose elements are the elements of all the arguments.
449 Each argument may be a string or a list or vector of characters (integers).
461 Each argument may be a list, vector or string.
470 /* Return a copy of a sub char table ARG. The elements except for a
471 nested sub char table are not copied. */
494 doc: /* Return a copy of a list, vector, string or char-table.
544 a string and has text properties to be copied. */
548 int from; /* refer to ARGS[argnum] (argument string) */
549 int to; /* refer to VAL (the target string) */
570 /* When we make a multibyte string, we can't copy text properties
571 while concatinating each string because the length of resulting
572 string can't be decided until we finish the whole concatination.
601 If desired output is a string, also compute length in bytes
603 whether the result should be a multibyte string. */
614 /* We must count the number of bytes needed in the string
714 /* Copy a single-byte string to a multibyte string. */
802 we already decided to make a multibyte string. */
858 string_char_to_byte (string, char_index)
859 Lisp_Object string;
867 best_above = SCHARS (string);
868 best_above_byte = SBYTES (string);
872 if (EQ (string, string_char_byte_cache_string))
891 FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string,
901 unsigned char *pend = SDATA (string) + best_above_byte;
922 string_char_byte_cache_string = string;
931 string_byte_to_char (string, byte_index)
932 Lisp_Object string;
940 best_above = SCHARS (string);
941 best_above_byte = SBYTES (string);
945 if (EQ (string, string_char_byte_cache_string))
964 FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c, string,
974 unsigned char *pend = SDATA (string) + best_above_byte;
995 string_char_byte_cache_string = string;
1001 /* Convert STRING to a multibyte string.
1006 string_make_multibyte (string)
1007 Lisp_Object string;
1014 if (STRING_MULTIBYTE (string))
1015 return string;
1017 nbytes = count_size_as_multibyte (SDATA (string),
1018 SCHARS (string));
1021 if (nbytes == SBYTES (string))
1022 return string;
1025 copy_text (SDATA (string), buf, SBYTES (string),
1028 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
1035 /* Convert STRING to a multibyte string without changing each
1041 string_to_multibyte (string)
1042 Lisp_Object string;
1049 if (STRING_MULTIBYTE (string))
1050 return string;
1052 nbytes = parse_str_to_multibyte (SDATA (string), SBYTES (string));
1055 if (nbytes == SBYTES (string))
1056 return make_multibyte_string (SDATA (string), nbytes, nbytes);
1059 bcopy (SDATA (string), buf, SBYTES (string));
1060 str_to_multibyte (buf, nbytes, SBYTES (string));
1062 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
1069 /* Convert STRING to a single-byte string. */
1072 string_make_unibyte (string)
1073 Lisp_Object string;
1080 if (! STRING_MULTIBYTE (string))
1081 return string;
1083 nchars = SCHARS (string);
1086 copy_text (SDATA (string), buf, SBYTES (string),
1095 DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte,
1100 to a multibyte character. In this case, the returned string is a
1101 newly created string with no text properties. If STRING is multibyte
1103 STRING is unibyte and entirely ASCII, the returned string is unibyte.
1105 string the same way whether it is unibyte or multibyte.) */)
1106 (string)
1107 Lisp_Object string;
1109 CHECK_STRING (string);
1111 return string_make_multibyte (string);
1114 DEFUN ("string-make-unibyte", Fstring_make_unibyte, Sstring_make_unibyte,
1118 `nonascii-translation-table' or, if that is nil, `nonascii-insert-offset'.
1119 If the lookup in the translation table fails, this function takes just
1121 (string)
1122 Lisp_Object string;
1124 CHECK_STRING (string);
1126 return string_make_unibyte (string);
1129 DEFUN ("string-as-unibyte", Fstring_as_unibyte, Sstring_as_unibyte,
1131 doc: /* Return a unibyte string with the same individual bytes as STRING.
1133 Otherwise it is a newly created string, with no text properties.
1137 (string)
1138 Lisp_Object string;
1140 CHECK_STRING (string);
1142 if (STRING_MULTIBYTE (string))
1144 int bytes = SBYTES (string);
1147 bcopy (SDATA (string), str, bytes);
1149 string = make_unibyte_string (str, bytes);
1152 return string;
1155 DEFUN ("string-as-multibyte", Fstring_as_multibyte, Sstring_as_multibyte,
1157 doc: /* Return a multibyte string with the same individual bytes as STRING.
1159 Otherwise it is a newly created string, with no text properties.
1164 It is similar to (decode-coding-string STRING 'emacs-mule-unix).
1165 If you're not sure, whether to use `string-as-multibyte' or
1166 `string-to-multibyte', use `string-to-multibyte'. Beware:
1167 (aref (string-as-multibyte "\\201") 0) -> 129 (aka ?\\201)
1168 (aref (string-as-multibyte "\\300") 0) -> 192 (aka ?\\300)
1169 (aref (string-as-multibyte "\\300\\201") 0) -> 192 (aka ?\\300)
1170 (aref (string-as-multibyte "\\300\\201") 1) -> 129 (aka ?\\201)
1172 (aref (string-as-multibyte "\\201\\300") 0) -> 2240
1173 (aref (string-as-multibyte "\\201\\300") 1) -> <error> */)
1174 (string)
1175 Lisp_Object string;
1177 CHECK_STRING (string);
1179 if (! STRING_MULTIBYTE (string))
1184 parse_str_as_multibyte (SDATA (string),
1185 SBYTES (string),
1188 bcopy (SDATA (string), SDATA (new_string),
1189 SBYTES (string));
1190 if (nbytes != SBYTES (string))
1192 SBYTES (string), NULL);
1193 string = new_string;
1194 STRING_SET_INTERVALS (string, NULL_INTERVAL);
1196 return string;
1199 DEFUN ("string-to-multibyte", Fstring_to_multibyte, Sstring_to_multibyte,
1201 doc: /* Return a multibyte string with the same individual chars as STRING.
1203 Otherwise it is a newly created string, with no text properties.
1208 This is similar to (decode-coding-string STRING 'binary) */)
1209 (string)
1210 Lisp_Object string;
1212 CHECK_STRING (string);
1214 return string_to_multibyte (string);
1252 (string, from, to)
1253 Lisp_Object string;
1262 CHECK_VECTOR_OR_STRING (string);
1265 if (STRINGP (string))
1267 size = SCHARS (string);
1268 size_byte = SBYTES (string);
1271 size = ASIZE (string);
1286 if (STRINGP (string))
1287 to_byte = string_char_to_byte (string, to_char);
1293 if (STRINGP (string))
1294 from_byte = string_char_to_byte (string, from_char);
1297 args_out_of_range_3 (string, make_number (from_char),
1300 if (STRINGP (string))
1302 res = make_specified_string (SDATA (string) + from_byte,
1304 STRING_MULTIBYTE (string));
1306 string, make_number (0), res, Qnil);
1309 res = Fvector (to_char - from_char, &AREF (string, from_char));
1323 (string, from, to)
1324 Lisp_Object string;
1331 CHECK_STRING (string);
1333 size = SCHARS (string);
1334 size_byte = SBYTES (string);
1345 from_byte = string_char_to_byte (string, from_char);
1361 to_byte = string_char_to_byte (string, to_char);
1365 args_out_of_range_3 (string, make_number (from_char),
1368 return make_specified_string (SDATA (string) + from_byte,
1370 STRING_MULTIBYTE (string));
1377 substring_both (string, from, from_byte, to, to_byte)
1378 Lisp_Object string;
1385 CHECK_VECTOR_OR_STRING (string);
1387 if (STRINGP (string))
1389 size = SCHARS (string);
1390 size_byte = SBYTES (string);
1393 size = ASIZE (string);
1396 args_out_of_range_3 (string, make_number (from), make_number (to));
1398 if (STRINGP (string))
1400 res = make_specified_string (SDATA (string) + from_byte,
1402 STRING_MULTIBYTE (string));
1404 string, make_number (0), res, Qnil);
1407 res = Fvector (to - from, &AREF (string, from));
1717 SEQ must be a list, a vector, or a string.
2197 PROPS, if non-nil, means compare string text properties too. */
2328 ARRAY is a vector, string, char-table, or bool-vector. */)
2367 error ("Attempt to change byte length of a string");
2400 DEFUN ("clear-string", Fclear_string, Sclear_string,
2404 (string)
2405 Lisp_Object string;
2408 CHECK_STRING (string);
2409 len = SBYTES (string);
2410 bzero (SDATA (string), len);
2411 STRING_SET_CHARS (string, len);
2412 STRING_SET_UNIBYTE (string);
2417 DEFUN ("char-table-subtype", Fchar_table_subtype, Schar_table_subtype,
2419 doc: /* Return the subtype of char-table CHAR-TABLE. The value is a symbol. */)
2428 DEFUN ("char-table-parent", Fchar_table_parent, Schar_table_parent,
2430 doc: /* Return the parent char-table of CHAR-TABLE.
2431 The value is either nil or another char-table.
2433 then the actual applicable value is inherited from the parent char-table
2443 DEFUN ("set-char-table-parent", Fset_char_table_parent, Sset_char_table_parent,
2445 doc: /* Set the parent char-table of CHAR-TABLE to PARENT.
2446 Return PARENT. PARENT must be either nil or another char-table. */)
2468 DEFUN ("char-table-extra-slot", Fchar_table_extra_slot, Schar_table_extra_slot,
2483 DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot,
2501 char_table_range (table, from, to, defalt)
2502 Lisp_Object table;
2508 if (! NILP (XCHAR_TABLE (table)->defalt))
2509 defalt = XCHAR_TABLE (table)->defalt;
2510 val = XCHAR_TABLE (table)->contents[from];
2519 this_val = XCHAR_TABLE (table)->contents[from];
2531 DEFUN ("char-table-range", Fchar_table_range, Schar_table_range,
2593 error ("Invalid RANGE argument to `char-table-range'");
2639 DEFUN ("set-char-table-range", Fset_char_table_range, Sset_char_table_range,
2700 error ("Invalid RANGE argument to `set-char-table-range'");
2705 DEFUN ("set-char-table-default", Fset_char_table_default,
2772 char_table_translate (table, ch)
2773 Lisp_Object table;
2777 value = Faref (table, make_number (ch));
2784 optimize_sub_char_table (table, chars)
2785 Lisp_Object *table;
2796 if (!SUB_CHAR_TABLE_P (*table)
2797 || ! NILP (XCHAR_TABLE (*table)->defalt))
2799 elt = XCHAR_TABLE (*table)->contents[from++];
2801 if (NILP (Fequal (elt, XCHAR_TABLE (*table)->contents[from])))
2803 *table = elt;
2806 DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
2807 1, 1, 0, doc: /* Optimize char table TABLE. */)
2808 (table)
2809 Lisp_Object table;
2815 CHECK_CHAR_TABLE (table);
2819 elt = XCHAR_TABLE (table)->contents[i];
2827 optimize_sub_char_table (XCHAR_TABLE (table)->contents + i, chars);
2843 map_char_table (c_function, function, table, subtable, arg, depth, indices)
2845 Lisp_Object function, table, subtable, arg, *indices;
2851 GCPRO4 (arg, table, subtable, function);
2868 #if 0 /* If the char table has entries for higher characters,
2905 error ("Too deep char table");
2906 map_char_table (c_function, function, table, elt, arg, depth + 1, indices);
2919 elt = Faref (table, make_number (c));
2938 DEFUN ("map-char-table", Fmap_char_table, Smap_char_table,
2946 /* The depth of char table is at most 3. */
2959 /* Return a value for character C in char-table TABLE. Store the
2964 char_table_ref_and_index (table, c, idx)
2965 Lisp_Object table;
2974 return XCHAR_TABLE (table)->contents[c];
2977 elt = XCHAR_TABLE (table)->contents[charset + 128];
3140 SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3179 SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3205 SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3222 Takes one argument, which is the string to display to ask the question.
3374 Takes one argument, which is the string to display to ask the question.
3728 `codeset', returning the character set as a string (locale item CODESET);
3949 DEFUN ("base64-encode-string", Fbase64_encode_string, Sbase64_encode_string,
3954 (string, no_line_break)
3955 Lisp_Object string, no_line_break;
3962 CHECK_STRING (string);
3967 length = SBYTES (string);
3974 encoded_length = base64_encode_1 (SDATA (string),
3976 STRING_MULTIBYTE (string));
4150 DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
4153 (string)
4154 Lisp_Object string;
4161 CHECK_STRING (string);
4163 length = SBYTES (string);
4168 decoded_length = base64_decode_1 (SDATA (string), decoded, length,
4281 /* Implemented by gerd@gnu.org. This hash table implementation was
4289 For uses of hash tables where the O(1) behavior of table
4292 key_and_value vector of the hash table. This could be done
4293 if a `:linear-search t' argument is given to make-hash-table. */
4335 /* If OBJ is a Lisp hash table, return a pointer to its struct
4427 HASH2 in hash table H using `eql'. Value is non-zero if KEY1 and
4443 HASH2 in hash table H using `equal'. Value is non-zero if KEY1 and
4457 HASH2 in hash table H using H->user_cmp_function. Value is non-zero
4480 /* Value is a hash code for KEY for use in hash table H which uses
4495 /* Value is a hash code for KEY for use in hash table H which uses
4514 /* Value is a hash code for KEY for use in hash table H which uses
4529 /* Value is a hash code for KEY for use in hash table H which uses as
4549 /* Create and initialize a new hash table.
4551 TEST specifies the test the hash table will use to compare keys.
4556 Give the table initial capacity SIZE, SIZE >= 0, an integer.
4558 If REHASH_SIZE is an integer, it must be > 0, and this hash table's
4561 table's new size is computed by multiplying its old size with
4564 REHASH_THRESHOLD must be a float <= 1.0, and > 0. The table will
4565 be resized when the ratio of (number of entries in the table) /
4566 (table size) is >= REHASH_THRESHOLD.
4568 WEAK specifies the weakness of the table. If non-nil, it must be
4578 Lisp_Object table;
4593 /* Allocate a table and initialize it. */
4596 /* Initialize hash table slots. */
4639 XSET_HASH_TABLE (table, h);
4640 xassert (HASH_TABLE_P (table));
4641 xassert (XHASH_TABLE (table) == h);
4643 /* Maybe add this hash table to the list of all weak hash tables. */
4649 Vweak_hash_tables = table;
4652 return table;
4656 /* Return a copy of hash table H1. Keys and values are not copied,
4657 only the table itself is. */
4663 Lisp_Object table;
4675 XSET_HASH_TABLE (table, h2);
4677 /* Maybe add this hash table to the list of all weak hash tables. */
4681 Vweak_hash_tables = table;
4684 return table;
4688 /* Resize hash table H if it's too full. If H cannot be resized
4713 error ("Hash table too large to resize");
4753 /* Lookup KEY in hash table H. If HASH is non-null, return in *HASH
4790 /* Put an entry into hash table H that associates KEY with VALUE.
4825 /* Remove the entry matching KEY from hash table H, if there is one. */
4875 /* Clear hash table H. */
4908 /* Sweep weak hash table H. REMOVE_ENTRIES_P non-zero means remove
4909 entries from the table that don't survive the current GC.
5006 Lisp_Object table, used, next;
5012 value-weak table A containing an entry X -> Y, where Y is used in a
5013 key-weak table B, Z -> Y. If B comes after A in the list of weak
5019 for (table = Vweak_hash_tables; !GC_NILP (table); table = h->next_weak)
5021 h = XHASH_TABLE (table);
5029 for (table = Vweak_hash_tables, used = Qnil; !GC_NILP (table); table = next)
5031 h = XHASH_TABLE (table);
5040 /* Add table to the list of used weak hash tables. */
5042 used = table;
5072 /* Return a hash for string PTR which has length LEN. The hash
5251 DEFUN ("make-hash-table", Fmake_hash_table, Smake_hash_table, 0, MANY, 0,
5252 doc: /* Create and return a new hash table.
5260 `define-hash-table-test'.
5262 :size SIZE -- A hint as to how many elements will be put in the table.
5265 :rehash-size REHASH-SIZE - Indicates how to expand the table when it
5271 Resize the hash table when ratio of the number of entries in the
5272 table. Default is 0.8.
5275 `key-or-value', or `key-and-value'. If WEAK is not nil, the table
5276 returned is a weak table. Key/value pairs are removed from a weak
5277 hash table when there are no non-weak references pointing to their
5282 usage: (make-hash-table &rest KEYWORD-ARGS) */)
5307 signal_error ("Invalid hash table test", test);
5320 signal_error ("Invalid hash table size", size);
5328 signal_error ("Invalid hash table rehash size", rehash_size);
5336 signal_error ("Invalid hash table rehash threshold", rehash_threshold);
5348 signal_error ("Invalid hash table weakness", weak);
5360 DEFUN ("copy-hash-table", Fcopy_hash_table, Scopy_hash_table, 1, 1, 0,
5361 doc: /* Return a copy of hash table TABLE. */)
5362 (table)
5363 Lisp_Object table;
5365 return copy_hash_table (check_hash_table (table));
5369 DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0,
5371 (table)
5372 Lisp_Object table;
5374 return check_hash_table (table)->count;
5378 DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size,
5381 (table)
5382 Lisp_Object table;
5384 return check_hash_table (table)->rehash_size;
5388 DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold,
5391 (table)
5392 Lisp_Object table;
5394 return check_hash_table (table)->rehash_threshold;
5398 DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0,
5400 The size can be used as an argument to `make-hash-table' to create
5401 a hash table than can hold as many elements of TABLE holds
5403 (table)
5404 Lisp_Object table;
5406 struct Lisp_Hash_Table *h = check_hash_table (table);
5411 DEFUN ("hash-table-test", Fhash_table_test, Shash_table_test, 1, 1, 0,
5413 (table)
5414 Lisp_Object table;
5416 return check_hash_table (table)->test;
5420 DEFUN ("hash-table-weakness", Fhash_table_weakness, Shash_table_weakness,
5423 (table)
5424 Lisp_Object table;
5426 return check_hash_table (table)->weak;
5430 DEFUN ("hash-table-p", Fhash_table_p, Shash_table_p, 1, 1, 0,
5431 doc: /* Return t if OBJ is a Lisp hash table object. */)
5440 doc: /* Clear hash table TABLE. */)
5441 (table)
5442 Lisp_Object table;
5444 hash_clear (check_hash_table (table));
5452 (key, table, dflt)
5453 Lisp_Object key, table, dflt;
5455 struct Lisp_Hash_Table *h = check_hash_table (table);
5462 doc: /* Associate KEY with VALUE in hash table TABLE.
5463 If KEY is already present in table, replace its current value with
5465 (key, value, table)
5466 Lisp_Object key, value, table;
5468 struct Lisp_Hash_Table *h = check_hash_table (table);
5484 (key, table)
5485 Lisp_Object key, table;
5487 struct Lisp_Hash_Table *h = check_hash_table (table);
5494 doc: /* Call FUNCTION for all entries in hash table TABLE.
5496 (function, table)
5497 Lisp_Object function, table;
5499 struct Lisp_Hash_Table *h = check_hash_table (table);
5516 DEFUN ("define-hash-table-test", Fdefine_hash_table_test,
5518 doc: /* Define a new hash table test with name NAME, a symbol.
5545 doc: /* Return MD5 message digest of OBJECT, a buffer or string.
5566 If OBJECT is a string, the most preferred coding system (see the
5770 /* Hash table stuff. */
5771 Qhash_table_p = intern ("hash-table-p");
5793 Qhash_table_test = intern ("hash-table-test");
5817 Qstring_lessp = intern ("string-lessp");