summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.md6
-rw-r--r--Makefile22
-rw-r--r--README.md26
-rw-r--r--utf8proc.c4
-rw-r--r--utf8proc.h16
5 files changed, 38 insertions, 36 deletions
diff --git a/LICENSE.md b/LICENSE.md
index 81e4f3a..811e011 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,10 +1,10 @@
-## libutf8proc license ##
+## libmojibake license ##
-**libutf8proc** is a lightly updated version of the **utf8proc**
+**libmojibake** is a lightly updated version of the **utf8proc**
library by Jan Behrens and the rest of the Public Software Group, who
deserve nearly all of the credit for this library. Like utf8proc,
whose copyright and license statements are reproduced below, all new
-work on the libutf8proc library is licensed under the [MIT "expat"
+work on the libmojibake library is licensed under the [MIT "expat"
license](http://opensource.org/licenses/MIT):
*Copyright © 2014 by Steven G. Johnson.*
diff --git a/Makefile b/Makefile
index 523bb16..a9d1aaa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# libutf8proc Makefile
+# libmojibake Makefile
CURL=curl
RUBY=ruby
@@ -7,16 +7,16 @@ RUBY=ruby
cflags = -O2 -std=c99 -pedantic -Wall -fpic $(CFLAGS)
cc = $(CC) $(cflags)
-
+AR = ar
# meta targets
all: c-library
-c-library: libutf8proc.a libutf8proc.so
+c-library: libmojibake.a libmojibake.so
clean:
- rm -f utf8proc.o libutf8proc.a libutf8proc.so
+ rm -f utf8proc.o libmojibake.a libmojibake.so
update: utf8proc_data.c.new
@@ -41,13 +41,13 @@ CaseFolding.txt:
utf8proc.o: utf8proc.h utf8proc.c utf8proc_data.c
$(cc) -c -o utf8proc.o utf8proc.c
-libutf8proc.a: utf8proc.o
- rm -f libutf8proc.a
- ar rs libutf8proc.a utf8proc.o
+libmojibake.a: utf8proc.o
+ rm -f libmojibake.a
+ $(AR) rs libmojibake.a utf8proc.o
-libutf8proc.so: utf8proc.o
- $(cc) -shared -o libutf8proc.so utf8proc.o
- chmod a-x libutf8proc.so
+libmojibake.so: utf8proc.o
+ $(cc) -shared -o libmojibake.so utf8proc.o
+ chmod a-x libmojibake.so
-libutf8proc.dylib: utf8proc.o
+libmojibake.dylib: utf8proc.o
$(cc) -dynamiclib -o $@ $^ -install_name $(libdir)/$@
diff --git a/README.md b/README.md
index babc9b8..921ac70 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# libutf8proc #
+# libmojibake
-The [libutf8proc package](https://github.com/JuliaLang/libutf8proc) is
+[libmojibake](https://github.com/JuliaLang/libmojibake) is
a lightly updated fork of the [utf8proc
library](http://www.public-software-group.org/utf8proc) from Jan
Behrens and the rest of the [Public Software
@@ -9,19 +9,19 @@ of the credit* for this package: a small, clean C library that
provides Unicode normalization, case-folding, and other operations for
data in the [UTF-8 encoding](http://en.wikipedia.org/wiki/UTF-8).
-The reason for this fork is that utf8proc is used for basic Unicode
+The reason for this fork is that `utf8proc` is used for basic Unicode
support in the [Julia language](http://julialang.org/) and the Julia
developers wanted Unicode 7 support and other features, but the
Public Software Group currently does not seem to have the resources
-necessary to update utf8proc. We hope that the fork can be merged
-back into the mainline utf8proc package before too long.
+necessary to update `utf8proc`. We hope that the fork can be merged
+back into the mainline `utf8proc` package before too long.
-(The original utf8proc package also includes Ruby and PostgreSQL plug-ins.
-We removed those from libutf8proc in order to focus exclusively on the C
+(The original `utf8proc` package also includes Ruby and PostgreSQL plug-ins.
+We removed those from `libmojibake` in order to focus exclusively on the C
library for the time being. We will strive to keep API changes to a minimum,
-so libutf8proc should still be usable with the old plug-in code.)
+so `libmojibake` should still be usable with the old plug-in code.)
-Like utf8proc, the libutf8proc package is licensed under the
+Like `utf8proc`, the `libmojibake` package is licensed under the
free/open-source [MIT "expat"
license](http://opensource.org/licenses/MIT) (plus certain Unicode
data governed by the similarly permissive [Unicode data
@@ -35,8 +35,8 @@ For compilation of the C library run `make`.
## General Information ##
The C library is found in this directory after successful compilation
-and is named `libutf8proc.a` (for the static library) and
-`libutf8proc.so` (for the dynamic library).
+and is named `libmojibake.a` (for the static library) and
+`libmojibake.so` (for the dynamic library).
The Unicode version being supported is 5.0.0.
*Note:* Version 4.1.0 of Unicode Standard Annex #29 was used, as
@@ -44,7 +44,7 @@ version 5.0.0 had not been available at the time of implementation.
For Unicode normalizations, the following options are used:
-* Normalization Form C: `STABLE`, COMPOSE`
+* Normalization Form C: `STABLE`, `COMPOSE`
* Normalization Form D: `STABLE`, `DECOMPOSE`
* Normalization Form KC: `STABLE`, `COMPOSE`, `COMPAT`
* Normalization Form KD: `STABLE`, `DECOMPOSE`, `COMPAT`
@@ -64,5 +64,5 @@ strings, unless you want to allocate memory yourself.
## Contact ##
Bug reports, feature requests, and other queries can be filed at
-the [libutf8proc page on Github](https://github.com/JuliaLang/libutf8proc).
+the [libmojibake page on Github](https://github.com/JuliaLang/libmojibake/issues).
diff --git a/utf8proc.c b/utf8proc.c
index ef2d433..e6c51f7 100644
--- a/utf8proc.c
+++ b/utf8proc.c
@@ -536,7 +536,7 @@ ssize_t utf8proc_map(
*dstptr = NULL;
result = utf8proc_decompose(str, strlen, NULL, 0, options);
if (result < 0) return result;
- buffer = malloc(result * sizeof(int32_t) + 1);
+ buffer = (int32_t *) malloc(result * sizeof(int32_t) + 1);
if (!buffer) return UTF8PROC_ERROR_NOMEM;
result = utf8proc_decompose(str, strlen, buffer, result, options);
if (result < 0) {
@@ -550,7 +550,7 @@ ssize_t utf8proc_map(
}
{
int32_t *newptr;
- newptr = realloc(buffer, (size_t)result+1);
+ newptr = (int32_t *) realloc(buffer, (size_t)result+1);
if (newptr) buffer = newptr;
}
*dstptr = (uint8_t *)buffer;
diff --git a/utf8proc.h b/utf8proc.h
index 24a891b..3dac24d 100644
--- a/utf8proc.h
+++ b/utf8proc.h
@@ -60,16 +60,18 @@ typedef unsigned char uint8_t;
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
-#ifdef _WIN64
-#define ssize_t __int64
-#else
-#define ssize_t int
-#endif
+# ifdef _WIN64
+# define ssize_t __int64
+# else
+# define ssize_t int
+# endif
+# ifndef __cplusplus
typedef unsigned char bool;
enum {false, true};
+# endif
#else
-#include <stdbool.h>
-#include <inttypes.h>
+# include <stdbool.h>
+# include <inttypes.h>
#endif
#include <limits.h>