diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-12-02 09:01:21 +0000 |
---|---|---|
committer | <> | 2014-12-04 16:11:25 +0000 |
commit | bdab5265fcbf3f472545073a23f8999749a9f2b9 (patch) | |
tree | c6018dd03dea906f8f1fb5f105f05b71a7dc250a /include/ntp_string.h | |
download | ntp-d4b7cd9723cce9561fa15f74b90b85a3a61b5ef8.tar.gz |
Imported from /home/lorry/working-area/delta_ntp/ntp-dev-4.2.7p482.tar.gz.ntp-dev-4.2.7p482
Diffstat (limited to 'include/ntp_string.h')
-rw-r--r-- | include/ntp_string.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/ntp_string.h b/include/ntp_string.h new file mode 100644 index 0000000..9b62ec2 --- /dev/null +++ b/include/ntp_string.h @@ -0,0 +1,37 @@ +/* + * Define string ops: strchr strrchr memcmp memmove memset + */ + +#ifndef NTP_STRING_H +#define NTP_STRING_H + +#ifdef HAVE_MEMORY_H +# include <memory.h> +#endif + +#ifdef HAVE_STRING_H +# include <string.h> +#endif + +#ifdef HAVE_BSTRING_H +# include <bstring.h> +#endif + +#ifdef NTP_NEED_BOPS + +#ifdef HAVE_STRINGS_H +# include <strings.h> /* bcmp, bcopy, bzero */ +#endif + +void ntp_memset (char *, int, int); + +#define memcmp(a, b, c) bcmp(a, b, (int)(c)) +#define memmove(t, f, c) bcopy(f, t, (int)(c)) +#define memcpy(t, f, c) bcopy(f, t, (int)(c)) +#define memset(a, x, c) if (0 == (x)) \ + bzero(a, (int)(c)); \ + else \ + ntp_memset((char *)(a), x, c) +#endif /* NTP_NEED_BOPS */ + +#endif /* NTP_STRING_H */ |