Commit fbfb1d9e authored by Rob Pike's avatar Rob Pike

mkrunetype: install a Makefile and tweak it slightly so it can be built.

R=rsc
CC=golang-dev
https://golang.org/cl/2813041
parent 41ac2f8a
# 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
...@@ -32,11 +32,9 @@ ...@@ -32,11 +32,9 @@
* isdigitrune is true iff c is a numeric-digit category. * isdigitrune is true iff c is a numeric-digit category.
*/ */
#include <u.h>
#include <libc.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <libgen.h>
#include "utf.h" #include "utf.h"
#include "utfdef.h" #include "utfdef.h"
...@@ -149,8 +147,8 @@ main(int argc, char *argv[]){ ...@@ -149,8 +147,8 @@ main(int argc, char *argv[]){
last = -1; last = -1;
while(getunicodeline(in, fields, buf)){ while(getunicodeline(in, fields, buf)){
code = getcode(fields[FIELD_CODE]); code = getcode(fields[FIELD_CODE]);
if (code >= NRUNES) if (code >= NRUNES)
fatal("code-point value too big: %x", code); fatal("code-point value too big: %x", code);
if(code <= last) if(code <= last)
fatal("bad code sequence: %x then %x", last, code); fatal("bad code sequence: %x then %x", last, code);
last = code; last = code;
...@@ -588,8 +586,7 @@ mkisronly(const char* label, char* prop) { ...@@ -588,8 +586,7 @@ mkisronly(const char* label, char* prop) {
static void static void
mktables(char *src, int usepairs) mktables(char *src, int usepairs)
{ {
printf("/* generated automatically by mkrunetype.c from %s */\n\n", printf("/* generated automatically by mkrunetype.c from %s */\n\n", src);
basename(src));
/* /*
* we special case the space and digit tables, since they are assumed * we special case the space and digit tables, since they are assumed
...@@ -703,8 +700,8 @@ getcode(char *s) ...@@ -703,8 +700,8 @@ getcode(char *s)
int i, code; int i, code;
code = 0; code = 0;
i = 0; i = 0;
/* Parse a hex number */ /* Parse a hex number */
while(s[i]) { while(s[i]) {
code <<= 4; code <<= 4;
if(s[i] >= '0' && s[i] <= '9') if(s[i] >= '0' && s[i] <= '9')
...@@ -713,7 +710,7 @@ getcode(char *s) ...@@ -713,7 +710,7 @@ getcode(char *s)
code += s[i] - 'A' + 10; code += s[i] - 'A' + 10;
else else
fatal("bad code char '%c'", s[i]); fatal("bad code char '%c'", s[i]);
i++; i++;
} }
return code; return code;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment