comparison src/regex.c @ 15285:c2b4f8533c55

Tue May 21 19:18:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * regex.c [_LIBC] (re_comp, re_exec): Define these, but weakly.
author Roland McGrath <roland@gnu.org>
date Fri, 24 May 1996 18:33:30 +0000
parents 17bc0cbb7d9b
children b8fe384dbeee
comparison
equal deleted inserted replaced
15284:546fea3a3d3d 15285:c2b4f8533c55
1 /* Extended regular expression matching and search library, 1 /* Extended regular expression matching and search library,
2 version 0.12. 2 version 0.12.
3 (Implements POSIX draft P10003.2/D11.2, except for 3 (Implements POSIX draft P10003.2/D11.2, except for
4 internationalization features.) 4 internationalization features.)
5 5
6 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. 6 Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option) 10 the Free Software Foundation; either version 2, or (at your option)
11 any later version. 11 any later version.
5178 } 5178 }
5179 5179
5180 /* Entry points compatible with 4.2 BSD regex library. We don't define 5180 /* Entry points compatible with 4.2 BSD regex library. We don't define
5181 them unless specifically requested. */ 5181 them unless specifically requested. */
5182 5182
5183 #ifdef _REGEX_RE_COMP 5183 #if defined (_REGEX_RE_COMP) || defined (_LIBC)
5184 5184
5185 /* BSD has one and only one pattern buffer. */ 5185 /* BSD has one and only one pattern buffer. */
5186 static struct re_pattern_buffer re_comp_buf; 5186 static struct re_pattern_buffer re_comp_buf;
5187 5187
5188 char * 5188 char *
5232 { 5232 {
5233 const int len = strlen (s); 5233 const int len = strlen (s);
5234 return 5234 return
5235 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); 5235 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
5236 } 5236 }
5237
5238 #ifdef _LIBC
5239 /* Make these definitions weak in libc, so POSIX programs can redefine
5240 these names if they don't use our functions, and still use
5241 regcomp/regexec below without link errors. */
5242 weak_symbol (re_comp)
5243 weak_symbol (re_exec)
5244 #endif
5245
5237 #endif /* _REGEX_RE_COMP */ 5246 #endif /* _REGEX_RE_COMP */
5238 5247
5239 /* POSIX.2 functions. Don't define these for Emacs. */ 5248 /* POSIX.2 functions. Don't define these for Emacs. */
5240 5249
5241 #ifndef emacs 5250 #ifndef emacs