LEFT | RIGHT |
(no file at all) | |
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 // These #ifdefs are being used as a substitute for | 5 // These #ifdefs are being used as a substitute for |
6 // build configuration, so that on any system, this | 6 // build configuration, so that on any system, this |
7 // tool can be built with the local equivalent of | 7 // tool can be built with the local equivalent of |
8 // cc *.c | 8 // cc *.c |
9 // | 9 // |
10 #ifdef PLAN9 | 10 #ifdef PLAN9 |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 bool | 571 bool |
572 hassuffix(char *p, char *suffix) | 572 hassuffix(char *p, char *suffix) |
573 { | 573 { |
574 int np, ns; | 574 int np, ns; |
575 ········ | 575 ········ |
576 np = strlen(p); | 576 np = strlen(p); |
577 ns = strlen(suffix); | 577 ns = strlen(suffix); |
578 return np >= ns && strcmp(p+np-ns, suffix) == 0; | 578 return np >= ns && strcmp(p+np-ns, suffix) == 0; |
579 } | 579 } |
580 | 580 |
581 // hasprefix reports whether p begins wtih prefix. | 581 // hasprefix reports whether p begins with prefix. |
582 bool | 582 bool |
583 hasprefix(char *p, char *prefix) | 583 hasprefix(char *p, char *prefix) |
584 { | 584 { |
585 return strncmp(p, prefix, strlen(prefix)) == 0; | 585 return strncmp(p, prefix, strlen(prefix)) == 0; |
586 } | 586 } |
587 | 587 |
588 // contains reports whether sep appears in p. | 588 // contains reports whether sep appears in p. |
589 bool | 589 bool |
590 contains(char *p, char *sep) | 590 contains(char *p, char *sep) |
591 { | 591 { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 755 |
756 bool | 756 bool |
757 cansse2(void) | 757 cansse2(void) |
758 { | 758 { |
759 // if we had access to cpuid, could answer this question | 759 // if we had access to cpuid, could answer this question |
760 // less conservatively. | 760 // less conservatively. |
761 return 0; | 761 return 0; |
762 } | 762 } |
763 | 763 |
764 #endif // PLAN9 | 764 #endif // PLAN9 |
LEFT | RIGHT |