diff options
Diffstat (limited to 'src/lib9/utf')
-rw-r--r-- | src/lib9/utf/rune.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrcat.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrchr.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrcmp.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrcpy.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrdup.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrecpy.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrlen.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrncat.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrncmp.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrncpy.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrrchr.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runestrstr.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/runetype.c | 5 | ||||
-rw-r--r-- | src/lib9/utf/utfdef.h | 35 | ||||
-rw-r--r-- | src/lib9/utf/utfecpy.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/utflen.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/utfnlen.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/utfrrune.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/utfrune.c | 2 | ||||
-rw-r--r-- | src/lib9/utf/utfutf.c | 2 |
21 files changed, 48 insertions, 30 deletions
diff --git a/src/lib9/utf/rune.c b/src/lib9/utf/rune.c index e1aaa9be..1cf8c7e6 100644 --- a/src/lib9/utf/rune.c +++ b/src/lib9/utf/rune.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" enum { diff --git a/src/lib9/utf/runestrcat.c b/src/lib9/utf/runestrcat.c index e1e8c9d5..f345a1b6 100644 --- a/src/lib9/utf/runestrcat.c +++ b/src/lib9/utf/runestrcat.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrcat(Rune *s1, Rune *s2) diff --git a/src/lib9/utf/runestrchr.c b/src/lib9/utf/runestrchr.c index 45ee673a..90d05e5a 100644 --- a/src/lib9/utf/runestrchr.c +++ b/src/lib9/utf/runestrchr.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrchr(Rune *s, Rune c) diff --git a/src/lib9/utf/runestrcmp.c b/src/lib9/utf/runestrcmp.c index d14145f3..35906275 100644 --- a/src/lib9/utf/runestrcmp.c +++ b/src/lib9/utf/runestrcmp.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" int runestrcmp(Rune *s1, Rune *s2) diff --git a/src/lib9/utf/runestrcpy.c b/src/lib9/utf/runestrcpy.c index 9d7aa026..b8c2411f 100644 --- a/src/lib9/utf/runestrcpy.c +++ b/src/lib9/utf/runestrcpy.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrcpy(Rune *s1, Rune *s2) diff --git a/src/lib9/utf/runestrdup.c b/src/lib9/utf/runestrdup.c index 97a889c8..7accedaa 100644 --- a/src/lib9/utf/runestrdup.c +++ b/src/lib9/utf/runestrdup.c @@ -14,8 +14,8 @@ #include <stdarg.h> #include <string.h> #include <stdlib.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrdup(Rune *s) diff --git a/src/lib9/utf/runestrecpy.c b/src/lib9/utf/runestrecpy.c index f3e4a096..83450c9a 100644 --- a/src/lib9/utf/runestrecpy.c +++ b/src/lib9/utf/runestrecpy.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrecpy(Rune *s1, Rune *es1, Rune *s2) diff --git a/src/lib9/utf/runestrlen.c b/src/lib9/utf/runestrlen.c index bca3050c..0096d525 100644 --- a/src/lib9/utf/runestrlen.c +++ b/src/lib9/utf/runestrlen.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" long runestrlen(Rune *s) diff --git a/src/lib9/utf/runestrncat.c b/src/lib9/utf/runestrncat.c index 74400c30..7404fb9a 100644 --- a/src/lib9/utf/runestrncat.c +++ b/src/lib9/utf/runestrncat.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrncat(Rune *s1, Rune *s2, long n) diff --git a/src/lib9/utf/runestrncmp.c b/src/lib9/utf/runestrncmp.c index dbd9da45..4fbdb0a1 100644 --- a/src/lib9/utf/runestrncmp.c +++ b/src/lib9/utf/runestrncmp.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" int runestrncmp(Rune *s1, Rune *s2, long n) diff --git a/src/lib9/utf/runestrncpy.c b/src/lib9/utf/runestrncpy.c index acba7bc2..f2517347 100644 --- a/src/lib9/utf/runestrncpy.c +++ b/src/lib9/utf/runestrncpy.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrncpy(Rune *s1, Rune *s2, long n) diff --git a/src/lib9/utf/runestrrchr.c b/src/lib9/utf/runestrrchr.c index 1f40c5a6..1f368548 100644 --- a/src/lib9/utf/runestrrchr.c +++ b/src/lib9/utf/runestrrchr.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" Rune* runestrrchr(Rune *s, Rune c) diff --git a/src/lib9/utf/runestrstr.c b/src/lib9/utf/runestrstr.c index 48583a3d..8be7a032 100644 --- a/src/lib9/utf/runestrstr.c +++ b/src/lib9/utf/runestrstr.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" /* * Return pointer to first occurrence of s2 in s1, diff --git a/src/lib9/utf/runetype.c b/src/lib9/utf/runetype.c index ffae30e6..41a32729 100644 --- a/src/lib9/utf/runetype.c +++ b/src/lib9/utf/runetype.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" /* * alpha ranges - @@ -1030,8 +1030,7 @@ Rune __totitle1[] = 0x01f3, 499, /* dz Dz */ }; -static -Rune* +static Rune* bsearch(Rune c, Rune *t, int n, int ne) { Rune *p; diff --git a/src/lib9/utf/utfdef.h b/src/lib9/utf/utfdef.h index 4b58ae87..1ff41813 100644 --- a/src/lib9/utf/utfdef.h +++ b/src/lib9/utf/utfdef.h @@ -1,14 +1,33 @@ -#define uchar _utfuchar -#define ushort _utfushort -#define uint _utfuint -#define ulong _utfulong -#define vlong _utfvlong -#define uvlong _utfuvlong +/* + * compiler directive on Plan 9 + */ +#ifndef USED +#define USED(x) if(x);else +#endif +/* + * easiest way to make sure these are defined + */ +#define uchar _fmtuchar +#define ushort _fmtushort +#define uint _fmtuint +#define ulong _fmtulong +#define vlong _fmtvlong +#define uvlong _fmtuvlong typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; +typedef unsigned long long uvlong; +typedef long long vlong; + +/* + * nil cannot be ((void*)0) on ANSI C, + * because it is used for function pointers + */ +#undef nil +#define nil 0 + +#undef nelem +#define nelem ((void*)0) -#define nelem(x) (sizeof(x)/sizeof((x)[0])) -#define nil ((void*)0) diff --git a/src/lib9/utf/utfecpy.c b/src/lib9/utf/utfecpy.c index 57159350..fde9338c 100644 --- a/src/lib9/utf/utfecpy.c +++ b/src/lib9/utf/utfecpy.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" char* utfecpy(char *to, char *e, char *from) diff --git a/src/lib9/utf/utflen.c b/src/lib9/utf/utflen.c index a10a5318..2e8c666a 100644 --- a/src/lib9/utf/utflen.c +++ b/src/lib9/utf/utflen.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" int utflen(char *s) diff --git a/src/lib9/utf/utfnlen.c b/src/lib9/utf/utfnlen.c index 66d674fd..6418f619 100644 --- a/src/lib9/utf/utfnlen.c +++ b/src/lib9/utf/utfnlen.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" int utfnlen(char *s, long m) diff --git a/src/lib9/utf/utfrrune.c b/src/lib9/utf/utfrrune.c index 37d2a725..fc84d6b8 100644 --- a/src/lib9/utf/utfrrune.c +++ b/src/lib9/utf/utfrrune.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" char* utfrrune(char *s, long c) diff --git a/src/lib9/utf/utfrune.c b/src/lib9/utf/utfrune.c index 1a2e04c9..5aa476a9 100644 --- a/src/lib9/utf/utfrune.c +++ b/src/lib9/utf/utfrune.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" char* utfrune(char *s, long c) diff --git a/src/lib9/utf/utfutf.c b/src/lib9/utf/utfutf.c index ea360361..70873cc3 100644 --- a/src/lib9/utf/utfutf.c +++ b/src/lib9/utf/utfutf.c @@ -13,8 +13,8 @@ */ #include <stdarg.h> #include <string.h> +#include "plan9.h" #include "utf.h" -#include "utfdef.h" /* |