Left: | ||
Right: |
OLD | NEW |
---|---|
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 typedef int bool; | 5 typedef int bool; |
6 | 6 |
7 // The Time unit is unspecified; we just need to | 7 // The Time unit is unspecified; we just need to |
8 // be able to compare whether t1 is older than t2 with t1 < t2. | 8 // be able to compare whether t1 is older than t2 with t1 < t2. |
9 typedef long long Time; | 9 typedef long long Time; |
10 | 10 |
11 #ifdef PLAN9 | |
rsc
2012/02/04 06:52:56
Sorry, but a.h must not include any other headers.
ality
2012/02/04 07:23:13
Done.
| |
12 #include <u.h> | |
13 #include <libc.h> | |
14 #else | |
11 #define nil ((void*)0) | 15 #define nil ((void*)0) |
12 #define nelem(x) (sizeof(x)/sizeof((x)[0])) | 16 #define nelem(x) (sizeof(x)/sizeof((x)[0])) |
13 #define USED(x) ((void)(x)) | 17 #define USED(x) ((void)(x)) |
18 #endif | |
14 | 19 |
15 // A Buf is a byte buffer, like Go's []byte. | 20 // A Buf is a byte buffer, like Go's []byte. |
16 typedef struct Buf Buf; | 21 typedef struct Buf Buf; |
17 struct Buf | 22 struct Buf |
18 { | 23 { |
19 char *p; | 24 char *p; |
20 int len; | 25 int len; |
21 int cap; | 26 int cap; |
22 }; | 27 }; |
23 | 28 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 void xrealwd(Buf *b, char *path); | 143 void xrealwd(Buf *b, char *path); |
139 void xremove(char *p); | 144 void xremove(char *p); |
140 void xremoveall(char *p); | 145 void xremoveall(char *p); |
141 void xsetenv(char*, char*); | 146 void xsetenv(char*, char*); |
142 int xstrcmp(char*, char*); | 147 int xstrcmp(char*, char*); |
143 char* xstrdup(char *p); | 148 char* xstrdup(char *p); |
144 int xstrlen(char*); | 149 int xstrlen(char*); |
145 char* xstrrchr(char*, int); | 150 char* xstrrchr(char*, int); |
146 char* xstrstr(char*, char*); | 151 char* xstrstr(char*, char*); |
147 char* xworkdir(void); | 152 char* xworkdir(void); |
OLD | NEW |