Mercurial > emacs
comparison src/fns.c @ 88737:b908df09ec8a
(count_combining): Comment out (unused).
(Flocale_codeset): New.
(syms_of_fns): Defsubr it.
author | Dave Love <fx@gnu.org> |
---|---|
date | Tue, 11 Jun 2002 18:32:28 +0000 |
parents | 38cab5bfa62b |
children | d9795fd5a98f |
comparison
equal
deleted
inserted
replaced
88736:baa14ec2c76b | 88737:b908df09ec8a |
---|---|
472 if (!CONSP (arg) && !VECTORP (arg) && !STRINGP (arg)) | 472 if (!CONSP (arg) && !VECTORP (arg) && !STRINGP (arg)) |
473 arg = wrong_type_argument (Qsequencep, arg); | 473 arg = wrong_type_argument (Qsequencep, arg); |
474 return concat (1, &arg, CONSP (arg) ? Lisp_Cons : XTYPE (arg), 0); | 474 return concat (1, &arg, CONSP (arg) ? Lisp_Cons : XTYPE (arg), 0); |
475 } | 475 } |
476 | 476 |
477 #if 0 /* unused */ | |
477 /* In string STR of length LEN, see if bytes before STR[I] combine | 478 /* In string STR of length LEN, see if bytes before STR[I] combine |
478 with bytes after STR[I] to form a single character. If so, return | 479 with bytes after STR[I] to form a single character. If so, return |
479 the number of bytes after STR[I] which combine in this way. | 480 the number of bytes after STR[I] which combine in this way. |
480 Otherwize, return 0. */ | 481 Otherwize, return 0. */ |
481 | 482 |
492 if (j < 0 || ! BASE_LEADING_CODE_P (str[j])) | 493 if (j < 0 || ! BASE_LEADING_CODE_P (str[j])) |
493 return 0; | 494 return 0; |
494 PARSE_MULTIBYTE_SEQ (str + j, len - j, bytes); | 495 PARSE_MULTIBYTE_SEQ (str + j, len - j, bytes); |
495 return (bytes <= i - j ? 0 : bytes - (i - j)); | 496 return (bytes <= i - j ? 0 : bytes - (i - j)); |
496 } | 497 } |
498 #endif | |
497 | 499 |
498 /* This structure holds information of an argument of `concat' that is | 500 /* This structure holds information of an argument of `concat' that is |
499 a string and has text properties to be copied. */ | 501 a string and has text properties to be copied. */ |
500 struct textprop_rec | 502 struct textprop_rec |
501 { | 503 { |
2727 newargs[2] = Flist (nargs - 2, args + 2); | 2729 newargs[2] = Flist (nargs - 2, args + 2); |
2728 GCPRO2 (newargs[0], newargs[2]); | 2730 GCPRO2 (newargs[0], newargs[2]); |
2729 result = Fapply (3, newargs); | 2731 result = Fapply (3, newargs); |
2730 UNGCPRO; | 2732 UNGCPRO; |
2731 return result; | 2733 return result; |
2734 } | |
2735 | |
2736 #ifdef HAVE_LANGINFO_CODESET | |
2737 #include <langinfo.h> | |
2738 #endif | |
2739 | |
2740 /* Fixme: is it useful to get more general info from the locale? */ | |
2741 DEFUN ("locale-codeset", Flocale_codeset, Slocale_codeset, 0, 0, 0, | |
2742 doc: /* Return a string indicating the code set in the current locale. | |
2743 If the system can't provide such information through a call to | |
2744 nl_langinfo(3), return nil. */) | |
2745 () | |
2746 { | |
2747 #ifdef HAVE_LANGINFO_CODESET | |
2748 char *str = nl_langinfo (CODESET); | |
2749 return make_string (str, strlen (str)); | |
2750 #else | |
2751 return Qnil; | |
2752 #endif | |
2732 } | 2753 } |
2733 | 2754 |
2734 /* base64 encode/decode functions (RFC 2045). | 2755 /* base64 encode/decode functions (RFC 2045). |
2735 Based on code from GNU recode. */ | 2756 Based on code from GNU recode. */ |
2736 | 2757 |
4864 defsubr (&Sbase64_encode_region); | 4885 defsubr (&Sbase64_encode_region); |
4865 defsubr (&Sbase64_decode_region); | 4886 defsubr (&Sbase64_decode_region); |
4866 defsubr (&Sbase64_encode_string); | 4887 defsubr (&Sbase64_encode_string); |
4867 defsubr (&Sbase64_decode_string); | 4888 defsubr (&Sbase64_decode_string); |
4868 defsubr (&Smd5); | 4889 defsubr (&Smd5); |
4890 defsubr (&Slocale_codeset); | |
4869 } | 4891 } |
4870 | 4892 |
4871 | 4893 |
4872 void | 4894 void |
4873 init_fns () | 4895 init_fns () |