Changeset 24 for branches/FREEBSD/src/kmk/str.c
- Timestamp:
- Nov 26, 2002, 10:24:54 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/FREEBSD/src/kmk/str.c
r10 r24 35 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 36 * SUCH DAMAGE. 37 * 38 * @(#)str.c 5.8 (Berkeley) 6/1/90 39 */ 40 41 #include <sys/cdefs.h> 42 __FBSDID("$FreeBSD: src/usr.bin/make/str.c,v 1.25 2002/10/09 03:42:10 jmallett Exp $"); 37 */ 38 39 #ifndef lint 40 #if 0 41 static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; 42 #else 43 static const char rcsid[] = 44 "$FreeBSD: src/usr.bin/make/str.c,v 1.12.2.1 2002/06/17 04:30:48 jmallett Exp $"; 45 #endif 46 #endif /* not lint */ 43 47 44 48 #include "make.h" … … 53 57 */ 54 58 void 55 str_init( void)59 str_init() 56 60 { 57 61 char *p1; … … 67 71 */ 68 72 void 69 str_end( void)73 str_end() 70 74 { 71 75 if (argv) { 72 76 if (argv[0]) 73 77 free(argv[0]); 74 free( argv);78 free((Address) argv); 75 79 } 76 80 if (buffer) … … 87 91 */ 88 92 char * 89 str_concat(char *s1, char *s2, int flags) 90 { 91 int len1, len2; 92 char *result; 93 str_concat(s1, s2, flags) 94 char *s1, *s2; 95 int flags; 96 { 97 register int len1, len2; 98 register char *result; 93 99 94 100 /* get the length of both strings */ … … 116 122 /* free original strings */ 117 123 if (flags & STR_DOFREE) { 118 (void) efree(s1);119 (void) efree(s2);124 (void)free(s1); 125 (void)free(s2); 120 126 } 121 127 return(result); … … 133 139 */ 134 140 char ** 135 brk_string(char *str, int *store_argc, Boolean expand) 136 { 137 int argc, ch; 138 char inquote, *p, *start, *t; 141 brk_string(str, store_argc, expand) 142 register char *str; 143 int *store_argc; 144 Boolean expand; 145 { 146 register int argc, ch; 147 register char inquote, *p, *start, *t; 139 148 int len; 140 149 … … 237 246 ch = '\t'; 238 247 break; 239 default: 240 break; 241 } 242 break; 243 default: 248 } 244 249 break; 245 250 } … … 262 267 * 263 268 * Side effects: None. 264 *265 * XXX should be strstr(3).266 269 */ 267 270 char * 268 Str_FindSubstring(char *string, char *substring) 269 { 270 char *a, *b; 271 Str_FindSubstring(string, substring) 272 register char *string; /* String to search. */ 273 char *substring; /* Substring to find in string */ 274 { 275 register char *a, *b; 271 276 272 277 /* … … 303 308 */ 304 309 int 305 Str_Match(char *string, char *pattern) 310 Str_Match(string, pattern) 311 register char *string; /* String */ 312 register char *pattern; /* Pattern */ 306 313 { 307 314 char c2; … … 406 413 */ 407 414 char * 408 Str_SYSVMatch(char *word, char *pattern, int *len) 415 Str_SYSVMatch(word, pattern, len) 416 char *word; /* Word to examine */ 417 char *pattern; /* Pattern to examine against */ 418 int *len; /* Number of characters to substitute */ 409 419 { 410 420 char *p = pattern; … … 469 479 */ 470 480 void 471 Str_SYSVSubst(Buffer buf, char *pat, char *src, int len) 481 Str_SYSVSubst(buf, pat, src, len) 482 Buffer buf; 483 char *pat; 484 char *src; 485 int len; 472 486 { 473 487 char *m;
Note:
See TracChangeset
for help on using the changeset viewer.