Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 64 lines (53 sloc) 1.143 kB
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
1 /* need.c */
2 /* Copyright 1995 by Steve Kirkendall */
3
4
5 #include "elvis.h"
9f1c6f0 @mbert Import Elvis 2.2_0 (written by Steve Kirkendall)
authored
6 #ifdef FEATURE_RCSID
7 char id_need[] = "$Id: need.c,v 2.5 2001/10/23 01:37:09 steve Exp $";
8 #endif
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
9
10
11 #ifdef NEED_STRDUP
12 # if USE_PROTOTYPES
13 char *strdup(const char *str)
14 {
15 # else /* don't USE_PROTOTYPES */
16 char *strdup(str)
17 char *str;
18 {
19 # endif /* don't USE_PROTOTYPES */
20
21 char *ret;
22
23 ret = (char *)safealloc(strlen(str) + 1, sizeof(char));
24 strcpy(ret, str);
25 return ret;
26 }
27 #endif /* NEED_STRDUP */
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
28
29 #ifdef NEED_MEMMOVE
30 # if USE_PROTOTYPES
31 void *memmove(void *dest, const void *src, size_t size)
32 # else /* don't USE_PROTOTYPES */
33 void *memmove(dest, src, size)
34 void *dest;
35 void *src;
36 size_t size;
37 # endif /* don't USE_PROTOTYPES */
38 {
39 register char *d, *s;
40
41 d = (char *)dest;
42 s = (char *)src;
43 if (d <= s)
44 {
45 for (; size > 0; size--)
46 *d++ = *s++;
47 }
48 else
49 {
50 for (d += size, s += size; size > 0; size--)
51 *--d = *--s;
52 }
53 return dest;
54 }
55 #endif
56
57 #ifdef NEED_XRMCOMBINEFILEDATABASE
58 /* The XrmCombineFileDatabase() function is defined in guix11/xmisc.c */
59 #endif
60
61 #ifdef NEED_INET_ATON
62 /* The inet_aton() function is defined in osunix/osnet.c */
63 #endif
Something went wrong with that request. Please try again.