--- /dev/null
+# Copyright 2010 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# The library is built by the Makefile in the parent directory.
+# This Makefile only builds mkrunetype.
+
+include ../../Make.inc
+O:=$(HOST_O)
+
+TARG=mkrunetype
+
+OFILES=\
+ mkrunetype.$O\
+
+include ../../Make.ccmd
* isdigitrune is true iff c is a numeric-digit category.
*/
+#include <u.h>
+#include <libc.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <libgen.h>
#include "utf.h"
#include "utfdef.h"
last = -1;
while(getunicodeline(in, fields, buf)){
code = getcode(fields[FIELD_CODE]);
- if (code >= NRUNES)
- fatal("code-point value too big: %x", code);
+ if (code >= NRUNES)
+ fatal("code-point value too big: %x", code);
if(code <= last)
fatal("bad code sequence: %x then %x", last, code);
last = code;
static void
mktables(char *src, int usepairs)
{
- printf("/* generated automatically by mkrunetype.c from %s */\n\n",
- basename(src));
+ printf("/* generated automatically by mkrunetype.c from %s */\n\n", src);
/*
* we special case the space and digit tables, since they are assumed
int i, code;
code = 0;
- i = 0;
- /* Parse a hex number */
+ i = 0;
+ /* Parse a hex number */
while(s[i]) {
code <<= 4;
if(s[i] >= '0' && s[i] <= '9')
code += s[i] - 'A' + 10;
else
fatal("bad code char '%c'", s[i]);
- i++;
+ i++;
}
return code;
}