[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs charset.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs charset.c |
Date: |
Mon, 11 Dec 2006 23:17:03 +0000 |
CVSROOT: /cvsroot/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 06/12/11 23:17:03
Modified files:
. : charset.c
Log message:
moved charset_complete() to charset.c
made charset names case insensitive (also ignore spaces, dashes,
underscores)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/charset.c?cvsroot=qemacs&r1=1.5&r2=1.6
Patches:
Index: charset.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/charset.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- charset.c 8 Jul 2005 09:30:44 -0000 1.5
+++ charset.c 11 Dec 2006 23:17:03 -0000 1.6
@@ -286,17 +286,36 @@
/********************************************************/
/* generic charset functions */
+void charset_completion(StringArray *cs, const char *charset_str)
+{
+ QECharset *p;
+ const char **pp;
+
+ for (p = first_charset; p != NULL; p = p->next) {
+ if (stristart(p->name, charset_str, NULL))
+ add_string(cs, p->name);
+ pp = p->aliases;
+ if (pp) {
+ for (; *pp != NULL; pp++) {
+ if (stristart(*pp, charset_str, NULL))
+ add_string(cs, *pp);
+ }
+ }
+ }
+}
+
QECharset *find_charset(const char *str)
{
QECharset *p;
const char **pp;
+
for (p = first_charset; p != NULL; p = p->next) {
- if (!strcasecmp(str, p->name))
+ if (!stricmp(str, p->name))
return p;
pp = p->aliases;
if (pp) {
for (; *pp != NULL; pp++) {
- if (!strcasecmp(str, *pp))
+ if (!stricmp(str, *pp))
return p;
}
}
@@ -333,7 +352,7 @@
}
/* detect the charset. Actually only UTF8 is detected */
-QECharset *detect_charset (const unsigned char *buf, int size)
+QECharset *detect_charset(const unsigned char *buf, int size)
{
int i, l, c, has_utf8;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemacs-commit] qemacs charset.c,
Charlie Gordon <=