make compile
This commit is contained in:
parent
eacea5a064
commit
05f5d46b63
3 changed files with 17 additions and 2 deletions
|
|
@ -12,7 +12,8 @@ HFILES=misc.h\
|
|||
LD=g++
|
||||
|
||||
<$PLAN9/src/mkone
|
||||
CFLAGS=
|
||||
CC=g++
|
||||
CFLAGS=-c
|
||||
|
||||
slug.$O: slug.h
|
||||
range.$O: range.h slug.h
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class range {
|
|||
public:
|
||||
range() { first = 0; accumV = 0; }
|
||||
range(slug *p) { first = p; accumV = 0; }
|
||||
virtual ~range() { }
|
||||
char *headstr() {
|
||||
return first ? first->headstr() : (char*)""; }
|
||||
char *typename() { return first->typename(); }
|
||||
|
|
@ -307,6 +308,7 @@ class generator {
|
|||
|
||||
extern stream ptlist, btlist; // page titles
|
||||
|
||||
#undef INFINITY
|
||||
#define INFINITY 1000001
|
||||
|
||||
// A queue is a distinguished kind of stream.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "misc.h"
|
||||
#include "slug.h"
|
||||
#include <math.h>
|
||||
#include <utf.h>
|
||||
|
||||
static char *bufptr(int);
|
||||
|
||||
|
|
@ -149,6 +148,19 @@ static void adds(char *s)
|
|||
addc(*p);
|
||||
}
|
||||
|
||||
static int fullrune(char *c, int n)
|
||||
{
|
||||
if(n <= 0)
|
||||
return 0;
|
||||
if(n>=1 && (unsigned char)c[0] < 0x80)
|
||||
return 1;
|
||||
if(n>=2 && (unsigned char)c[0] < 0xE0)
|
||||
return 1;
|
||||
if(n>=3)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *getutf(FILE *fp) // get 1 utf-encoded char (might be multiple bytes)
|
||||
{
|
||||
static char buf[100];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue