comparison src/regex.c @ 15635:89f7ba4ccd22

[_LIBC] (re_comp, re_exec): Use `weak_function' keyword in defn instead of weak_symbol macro after.
author Roland McGrath <roland@gnu.org>
date Tue, 09 Jul 1996 09:10:39 +0000
parents f8e362279cbb
children 2054791aefc6
comparison
equal deleted inserted replaced
15634:08bcd5d2c8ab 15635:89f7ba4ccd22
5186 5186
5187 /* BSD has one and only one pattern buffer. */ 5187 /* BSD has one and only one pattern buffer. */
5188 static struct re_pattern_buffer re_comp_buf; 5188 static struct re_pattern_buffer re_comp_buf;
5189 5189
5190 char * 5190 char *
5191 #ifdef _LIBC
5192 /* Make these definitions weak in libc, so POSIX programs can redefine
5193 these names if they don't use our functions, and still use
5194 regcomp/regexec below without link errors. */
5195 weak_function
5196 #endif
5191 re_comp (s) 5197 re_comp (s)
5192 const char *s; 5198 const char *s;
5193 { 5199 {
5194 reg_errcode_t ret; 5200 reg_errcode_t ret;
5195 5201
5227 return (char *) gettext (re_error_msgid[(int) ret]); 5233 return (char *) gettext (re_error_msgid[(int) ret]);
5228 } 5234 }
5229 5235
5230 5236
5231 int 5237 int
5238 #ifdef _LIBC
5239 weak_function
5240 #endif
5232 re_exec (s) 5241 re_exec (s)
5233 const char *s; 5242 const char *s;
5234 { 5243 {
5235 const int len = strlen (s); 5244 const int len = strlen (s);
5236 return 5245 return
5237 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0); 5246 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
5238 } 5247 }
5239
5240 #ifdef _LIBC
5241 /* Make these definitions weak in libc, so POSIX programs can redefine
5242 these names if they don't use our functions, and still use
5243 regcomp/regexec below without link errors. */
5244 weak_symbol (re_comp)
5245 weak_symbol (re_exec)
5246 #endif
5247
5248 #endif /* _REGEX_RE_COMP */ 5248 #endif /* _REGEX_RE_COMP */
5249 5249
5250 /* POSIX.2 functions. Don't define these for Emacs. */ 5250 /* POSIX.2 functions. Don't define these for Emacs. */
5251 5251
5252 #ifndef emacs 5252 #ifndef emacs