diff options
author | behdad <behdad> | 2002-08-07 12:02:51 +0000 |
---|---|---|
committer | behdad <behdad> | 2002-08-07 12:02:51 +0000 |
commit | e4c09cb85c22e5a43a42bec401e97fce555698e7 (patch) | |
tree | c8c107a62d91475651af603502db8228570314e1 | |
parent | b35dd9b55d00565d4e5f813347c1054115a9cf09 (diff) |
Small fix.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | fribidi.c | 3 | ||||
-rw-r--r-- | fribidi.h | 1 | ||||
-rw-r--r-- | fribidi_char_sets.c | 22 | ||||
-rw-r--r-- | fribidi_config.h.in | 10 | ||||
-rw-r--r-- | fribidi_mem.c | 16 | ||||
-rw-r--r-- | fribidi_mem.h | 39 | ||||
-rw-r--r-- | fribidi_types.h | 28 | ||||
-rw-r--r-- | fribidi_unicode.h | 1 | ||||
-rw-r--r-- | fribidi_utils.c | 1 |
10 files changed, 65 insertions, 57 deletions
@@ -1,6 +1,7 @@ 2002-08-07 Behdad Esfahbod <fribidi@behdad.org> * AUTHORS: Added Tomas Frydrych <tomas@frydrych.uklinux.net>. * READMY: Moved AbiWord to applications that use fribidi. + * fribidi.h: Removed #include "fribidi_mem.h". 2002-08-01 Behdad Esfahbod <fribidi@behdad.org> * *.c, *.h, fribidi_config.h.in, configure.in, acconfig.h: Applied @@ -21,12 +21,11 @@ * <fwpg@sharif.edu>. */ -#include <stdlib.h> - #ifdef HAVE_CONFIG_H #include <config.h> #endif #include "fribidi.h" +#include "fribidi_mem.h" #ifdef DEBUG #include <stdio.h> #endif @@ -30,7 +30,6 @@ #include "fribidi_config.h" #include "fribidi_unicode.h" -#include "fribidi_mem.h" #include "fribidi_types.h" #include "fribidi_env.h" diff --git a/fribidi_char_sets.c b/fribidi_char_sets.c index b202f25..fd70a75 100644 --- a/fribidi_char_sets.c +++ b/fribidi_char_sets.c @@ -25,7 +25,6 @@ #ifndef FRIBIDI_NO_CHARSETS #include "fribidi_char_sets.h" -#include <string.h> typedef struct { @@ -78,6 +77,24 @@ FriBidiCharSetHandler fribidi_char_sets[FRIBIDI_CHAR_SETS_NUM + 1] = { #undef _FRIBIDI_ADD_CHAR_SET +static char +toupper (char c) +{ + return c < 'a' || c > 'z' ? c : c + 'A' - 'a'; +} + +int +fribidi_strcasecmp (const char *s1, + const char *s2) +{ + while (*s1 && toupper (*s1) == toupper (*s2)) + { + s1++; + s2++; + } + return *s1 - *s2; +} + /* Return the charset which name is "s". */ FRIBIDI_API FriBidiCharSet fribidi_parse_charset (char *s) @@ -175,6 +192,9 @@ fribidi_char_set_leave (FriBidiCharSet char_set) /* Interface version 1, deprecated, just for compatibility. */ + +#include <string.h> + FRIBIDI_API int fribidi_charset_to_unicode_1 (FriBidiCharSet char_set, char *s, diff --git a/fribidi_config.h.in b/fribidi_config.h.in index 2e4e3d9..9dcc46a 100644 --- a/fribidi_config.h.in +++ b/fribidi_config.h.in @@ -36,3 +36,13 @@ #define __BEGIN_DECLS /* empty */ #define __END_DECLS /* empty */ #endif + +#define FRIBIDI_TRUE 1 +#define FRIBIDI_FALSE 0 + +#ifndef TRUE +#define TRUE FRIBIDI_TRUE +#endif +#ifndef FALSE +#define FALSE FRIBIDI_FALSE +#endif diff --git a/fribidi_mem.c b/fribidi_mem.c index fd27cfc..09a78a5 100644 --- a/fribidi_mem.c +++ b/fribidi_mem.c @@ -19,11 +19,11 @@ * For licensing issues, contact <fwpg@sharif.edu>. */ -#include <string.h> -#include <ctype.h> #include "fribidi_env.h" #include "fribidi_mem.h" +#include <stdlib.h> + struct _FriBidiMemChunk { char *name; @@ -118,15 +118,3 @@ fribidi_mem_chunk_free (FriBidiEnv *fribidienv, fribidi_free (fribidienv, mem); return; } - -int -fribidi_strcasecmp (const char *s1, - const char *s2) -{ - while (*s1 && toupper (*s1) == toupper (*s2)) - { - s1++; - s2++; - } - return *s1 - *s2; -} diff --git a/fribidi_mem.h b/fribidi_mem.h index e7bb19e..041a72f 100644 --- a/fribidi_mem.h +++ b/fribidi_mem.h @@ -23,47 +23,13 @@ #define FRIBIDI_MEM_H #include "fribidi_config.h" -/* #include "fribidi_env.h" */ +#include "fribidi_types.h" #ifdef __cplusplus extern "C" { #endif -#define FRIBIDI_INT8 char -#define FRIBIDI_INT16 short -#define FRIBIDI_INT32 long -#define FRIBIDI_INT int - - typedef int fribidi_boolean; - - typedef signed FRIBIDI_INT8 fribidi_int8; - typedef unsigned FRIBIDI_INT8 fribidi_uint8; - typedef signed FRIBIDI_INT16 fribidi_int16; - typedef unsigned FRIBIDI_INT16 fribidi_uint16; - typedef signed FRIBIDI_INT32 fribidi_int32; - typedef unsigned FRIBIDI_INT32 fribidi_uint32; - typedef signed FRIBIDI_INT fribidi_int; - typedef unsigned FRIBIDI_INT fribidi_uint; - -#define FRIBIDI_TRUE 1 -#define FRIBIDI_FALSE 0 - -#ifndef TRUE -#define TRUE FRIBIDI_TRUE -#endif -#ifndef FALSE -#define FALSE FRIBIDI_FALSE -#endif - - typedef struct _FriBidiList FriBidiList; - struct _FriBidiList - { - void *data; - FriBidiList *next; - FriBidiList *prev; - }; - typedef struct _FriBidiEnv FriBidiEnv; FriBidiList *fribidi_list_append (FriBidiEnv *fribidienv, @@ -101,9 +67,6 @@ extern "C" (type *) fribidi_mem_chunk_alloc (fbenv, chunk) \ ) - int fribidi_strcasecmp (const char *s1, - const char *s2); - #ifdef __cplusplus } #endif diff --git a/fribidi_types.h b/fribidi_types.h index a8340fb..28aea43 100644 --- a/fribidi_types.h +++ b/fribidi_types.h @@ -23,13 +23,30 @@ #ifndef FRIBIDI_TYPES_H #define FRIBIDI_TYPES_H -#include "fribidi_mem.h" +#include "fribidi_config.h" #ifdef __cplusplus extern "C" { #endif +#define FRIBIDI_INT8 char +#define FRIBIDI_INT16 short +#define FRIBIDI_INT32 long +#define FRIBIDI_INT int + + typedef int fribidi_boolean; + + typedef signed FRIBIDI_INT8 fribidi_int8; + typedef unsigned FRIBIDI_INT8 fribidi_uint8; + typedef signed FRIBIDI_INT16 fribidi_int16; + typedef unsigned FRIBIDI_INT16 fribidi_uint16; + typedef signed FRIBIDI_INT32 fribidi_int32; + typedef unsigned FRIBIDI_INT32 fribidi_uint32; + typedef signed FRIBIDI_INT fribidi_int; + typedef unsigned FRIBIDI_INT fribidi_uint; + + typedef fribidi_int8 FriBidiLevel; typedef fribidi_uint32 FriBidiChar; typedef fribidi_int FriBidiStrIndex; @@ -46,6 +63,15 @@ extern "C" } FriBidiRunType; +/* The following type is used by fribidi_utils */ + typedef struct _FriBidiList FriBidiList; + struct _FriBidiList + { + void *data; + FriBidiList *next; + FriBidiList *prev; + }; + #ifndef FRIBIDI_MAX_STRING_LENGTH #define FRIBIDI_MAX_STRING_LENGTH (sizeof (FriBidiStrIndex) == 2 ? \ 0x7FFE : (sizeof (FriBidiStrIndex) == 1 ? \ diff --git a/fribidi_unicode.h b/fribidi_unicode.h index 522a674..0dd26c2 100644 --- a/fribidi_unicode.h +++ b/fribidi_unicode.h @@ -22,6 +22,7 @@ #ifndef FRIBIDI_UNICODE_H #define FRIBIDI_UNICODE_H +#include "fribidi_config.h" #include "fribidi_types.h" #ifdef __cplusplus diff --git a/fribidi_utils.c b/fribidi_utils.c index d9ff131..858acb8 100644 --- a/fribidi_utils.c +++ b/fribidi_utils.c @@ -27,6 +27,7 @@ *----------------------------------------------------------------------*/ #include "fribidi.h" +#include "fribidi_mem.h" /*====================================================================== * The find_visual_ranges() function is used to convert between a |