diff --git a/cli.h b/cli.h index 0c39371b..1c139278 100644 --- a/cli.h +++ b/cli.h @@ -17,8 +17,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_CLI_H -#define __SERVALD_CLI_H +#ifndef __SERVAL_DNA__CLI_H +#define __SERVAL_DNA__CLI_H #include "xprintf.h" #include "log.h" @@ -102,4 +102,4 @@ void cli_put_long(struct cli_context *context, int64_t value, const char *delim) void cli_put_string(struct cli_context *context, const char *value, const char *delim); void cli_put_hexvalue(struct cli_context *context, const unsigned char *value, int length, const char *delim); -#endif // __SERVALD_CLI_H +#endif // __SERVAL_DNA__CLI_H diff --git a/conf.h b/conf.h index 116d44bc..15310a07 100644 --- a/conf.h +++ b/conf.h @@ -222,8 +222,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * @author Andrew Bettison */ -#ifndef __SERVALDNA_CONF_H -#define __SERVALDNA_CONF_H +#ifndef __SERVAL_DNA__CONF_H +#define __SERVAL_DNA__CONF_H #include #include @@ -701,4 +701,4 @@ int cf_reload(); int cf_reload_strict(); int cf_reload_permissive(); -#endif //__SERVALDNA_CONF_H +#endif //__SERVAL_DNA__CONF_H diff --git a/constants.h b/constants.h index cc8b4ffb..7af118b0 100644 --- a/constants.h +++ b/constants.h @@ -16,8 +16,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_CONSTANTS_H -#define __SERVALD_CONSTANTS_H +#ifndef __SERVAL_DNA__CONSTANTS_H +#define __SERVAL_DNA__CONSTANTS_H #define NELS(a) (sizeof (a) / sizeof *(a)) @@ -224,4 +224,4 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. typedef char bool_t; -#endif // __SERVALD_CONSTANTS_H +#endif // __SERVAL_DNA__CONSTANTS_H diff --git a/crypto.h b/crypto.h index 06d7c817..74190a7f 100644 --- a/crypto.h +++ b/crypto.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_CRYPTO_H -#define __SERVALD_CRYPTO_H +#ifndef __SERVAL_DNA__CRYPTO_H +#define __SERVAL_DNA__CRYPTO_H #include "nacl.h" #define SIGNATURE_BYTES crypto_sign_edwards25519sha512batch_BYTES diff --git a/dataformats.h b/dataformats.h index ee7b4d73..26c9fb7c 100644 --- a/dataformats.h +++ b/dataformats.h @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_DATA_FORMATS_H -#define __SERVALD_DATA_FORMATS_H +#ifndef __SERVAL_DNA___DATA_FORMATS_H +#define __SERVAL_DNA___DATA_FORMATS_H int str_is_subscriber_id(const char *sid); int strn_is_subscriber_id(const char *sid, size_t *lenp); @@ -42,4 +42,4 @@ uint64_t read_uint64(const unsigned char *o); uint32_t read_uint32(const unsigned char *o); uint16_t read_uint16(const unsigned char *o); -#endif +#endif //__SERVAL_DNA___DATA_FORMATS_H diff --git a/fdqueue.h b/fdqueue.h index 6c0ed1a9..080b6cbc 100644 --- a/fdqueue.h +++ b/fdqueue.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALDNA__FDQUEUE_H -#define __SERVALDNA__FDQUEUE_H +#ifndef __SERVAL_DNA__FDQUEUE_H +#define __SERVAL_DNA__FDQUEUE_H #ifdef HAVE_POLL_H #include @@ -91,4 +91,4 @@ unsigned fd_depth(); #define RETURNNULL(X) do { X; OUT(); return (NULL); } while (0) #define RETURNVOID do { OUT(); return; } while (0) -#endif // __SERVALDNA__FDQUEUE_H +#endif // __SERVAL_DNA__FDQUEUE_H diff --git a/golay.h b/golay.h index d0219940..4d3641a9 100644 --- a/golay.h +++ b/golay.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_GOLAY_H -#define __SERVALD_GOLAY_H +#ifndef __SERVAL_DNA__GOLAY_H +#define __SERVAL_DNA__GOLAY_H int golay_encode(uint8_t *data); int golay_decode(int *errs, uint8_t *data); diff --git a/http_server.h b/http_server.h index cb012e54..86c88c32 100644 --- a/http_server.h +++ b/http_server.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALDNA__HTTP_SERVER_H -#define __SERVALDNA__HTTP_SERVER_H +#ifndef __SERVAL_DNA__HTTP_SERVER_H +#define __SERVAL_DNA__HTTP_SERVER_H #include #include "constants.h" @@ -207,4 +207,4 @@ struct http_request { char buffer[8 * 1024]; }; -#endif // __SERVALDNA__HTTP_SERVER_H +#endif // __SERVAL_DNA__HTTP_SERVER_H diff --git a/keyring.h b/keyring.h index 78e2d8de..f1368d91 100644 --- a/keyring.h +++ b/keyring.h @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_KEYRING_H -#define __SERVALD_KEYRING_H +#ifndef __SERVAL_DNA__KEYRING_H +#define __SERVAL_DNA__KEYRING_H typedef struct keypair { int type; @@ -126,4 +126,4 @@ int keyring_find_public_tag_value(const keyring_file *k, int *cn, int *in, int * int keyring_unpack_tag(const unsigned char *packed, size_t packed_len, const char **name, const unsigned char **value, size_t *length); int keyring_pack_tag(unsigned char *packed, size_t *packed_len, const char *name, const unsigned char *value, size_t length); -#endif // __SERVALD_KEYRING_H +#endif // __SERVAL_DNA__KEYRING_H diff --git a/log.h b/log.h index 1d1b743f..bb27d124 100644 --- a/log.h +++ b/log.h @@ -16,8 +16,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_LOG_H -#define __SERVALD_LOG_H +#ifndef __SERVAL_DNA__LOG_H +#define __SERVAL_DNA__LOG_H #include #include @@ -161,4 +161,4 @@ struct strbuf; #define BACKTRACE log_backtrace(LOG_LEVEL_FATAL, __WHENCE__) -#endif // __SERVALD_LOG_H +#endif // __SERVAL_DNA__LOG_H diff --git a/mdp_client.h b/mdp_client.h index bf45c41a..a93e0a3c 100644 --- a/mdp_client.h +++ b/mdp_client.h @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_MDP_CLIENT_H -#define __SERVALD_MDP_CLIENT_H +#ifndef __SERVAL_DNA__MDP_CLIENT_H +#define __SERVAL_DNA__MDP_CLIENT_H #include "serval.h" diff --git a/mem.h b/mem.h index e6f3cda9..498df4c4 100644 --- a/mem.h +++ b/mem.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALDNA__MEM_H -#define __SERVALDNA__MEM_H +#ifndef __SERVAL_DNA__MEM_H +#define __SERVAL_DNA__MEM_H #include #include "log.h" @@ -69,4 +69,4 @@ char *_strn_edup(struct __sourceloc, const char *str, size_t len); #define str_edup(str) _str_edup(__HERE__, (str)) #define strn_edup(str, len) _strn_edup(__HERE__, (str), (len)) -#endif // __SERVALDNA__MEM_H +#endif // __SERVAL_DNA__MEM_H diff --git a/monitor-client.h b/monitor-client.h index 235ea5af..c40231c3 100644 --- a/monitor-client.h +++ b/monitor-client.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_MONITOR_CLIENT_H -#define __SERVALD_MONITOR_CLIENT_H +#ifndef __SERVAL_DNA__MONITOR_CLIENT_H +#define __SERVAL_DNA__MONITOR_CLIENT_H struct monitor_state; diff --git a/net.h b/net.h index 757c2828..baeadf31 100644 --- a/net.h +++ b/net.h @@ -16,8 +16,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_NET_H -#define __SERVALD_NET_H +#ifndef __SERVAL_DNA__NET_H +#define __SERVAL_DNA__NET_H #include // for size_t, ssize_t #include // for struct sockaddr, socklen_t @@ -53,4 +53,4 @@ ssize_t _writev_all(int fd, const struct iovec *iov, int iovcnt, struct __source ssize_t _write_str(int fd, const char *str, struct __sourceloc __whence); ssize_t _write_str_nonblock(int fd, const char *str, struct __sourceloc __whence); -#endif // __SERVALD_NET_H +#endif // __SERVAL_DNA__NET_H diff --git a/os.c b/os.c index 84e49cb6..35d2e3de 100644 --- a/os.c +++ b/os.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#define __SERVALDNA_OS_INLINE +#define __SERVAL_DNA__OS_INLINE #include "os.h" #include "str.h" #include "log.h" diff --git a/os.h b/os.h index f098518e..9de08d6e 100644 --- a/os.h +++ b/os.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALDNA_OS_H -#define __SERVALDNA_OS_H +#ifndef __SERVAL_DNA__OS_H +#define __SERVAL_DNA__OS_H #include #include @@ -26,11 +26,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include -#ifndef __SERVALDNA_OS_INLINE +#ifndef __SERVAL_DNA__OS_INLINE # if __GNUC__ && !__GNUC_STDC_INLINE__ -# define __SERVALDNA_OS_INLINE extern inline +# define __SERVAL_DNA__OS_INLINE extern inline # else -# define __SERVALDNA_OS_INLINE inline +# define __SERVAL_DNA__OS_INLINE inline # endif #endif @@ -60,19 +60,19 @@ time_ms_t gettime_ms(); time_ms_t sleep_ms(time_ms_t milliseconds); #ifndef HAVE_BZERO -__SERVALDNA_OS_INLINE void bzero(void *buf, size_t len) { +__SERVAL_DNA__OS_INLINE void bzero(void *buf, size_t len) { memset(buf, 0, len); } #endif #ifndef HAVE_BCOPY -__SERVALDNA_OS_INLINE void bcopy(const void *src, void *dst, size_t len) { +__SERVAL_DNA__OS_INLINE void bcopy(const void *src, void *dst, size_t len) { memcpy(dst, src, len); } #endif #ifndef HAVE_BCMP -__SERVALDNA_OS_INLINE int bcmp(const void *s1, const void *s2, size_t n) { +__SERVAL_DNA__OS_INLINE int bcmp(const void *s1, const void *s2, size_t n) { // bcmp() is only an equality test, not an order test, so its return value // is not specified as negative or positive, only non-zero. Hoewver // memcmp() is an order test. We deliberately discard negative return @@ -123,4 +123,4 @@ int urandombytes(unsigned char *buf, size_t len); */ ssize_t read_symlink(const char *path, char *buf, size_t len); -#endif //__SERVALDNA_OS_H +#endif //__SERVAL_DNA__OS_H diff --git a/overlay_address.h b/overlay_address.h index 0cff35b6..82a9b3fa 100644 --- a/overlay_address.h +++ b/overlay_address.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _SERVALD_OVERLAY_ADDRESS_H -#define _SERVALD_OVERLAY_ADDRESS_H +#ifndef __SERVAL_DNA__OVERLAY_ADDRESS_H +#define __SERVAL_DNA__OVERLAY_ADDRESS_H #include "constants.h" @@ -130,4 +130,4 @@ int send_please_explain(struct decode_context *context, struct subscriber *sourc void free_subscribers(); -#endif +#endif //__SERVAL_DNA__OVERLAY_ADDRESS_H diff --git a/overlay_buffer.h b/overlay_buffer.h index cf69a4b9..7aa3c5e4 100644 --- a/overlay_buffer.h +++ b/overlay_buffer.h @@ -17,8 +17,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD__OVERLAY_BUFFER_H -#define __SERVALD__OVERLAY_BUFFER_H +#ifndef __SERVAL_DNA___OVERLAY_BUFFER_H +#define __SERVAL_DNA___OVERLAY_BUFFER_H struct overlay_buffer { unsigned char *bytes; @@ -118,4 +118,4 @@ unsigned char* ob_ptr(struct overlay_buffer *b); #define ob_overrun(b) _ob_overrun(__WHENCE__, b) -#endif //__SERVALD__OVERLAY_BUFFER_H +#endif //__SERVAL_DNA___OVERLAY_BUFFER_H diff --git a/overlay_packet.h b/overlay_packet.h index 5ac91fb9..3c70a724 100644 --- a/overlay_packet.h +++ b/overlay_packet.h @@ -17,8 +17,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _SERVALD_OVERLAY_PACKET_H -#define _SERVALD_OVERLAY_PACKET_H +#ifndef __SERVAL_DNA__OVERLAY_PACKET_H +#define __SERVAL_DNA__OVERLAY_PACKET_H #include "overlay_address.h" #include "serval.h" @@ -102,4 +102,4 @@ struct overlay_frame { int op_free(struct overlay_frame *p); struct overlay_frame *op_dup(struct overlay_frame *f); -#endif +#endif //__SERVAL_DNA__OVERLAY_PACKET_H diff --git a/radio_link.h b/radio_link.h index 34de8290..f1da9bf9 100644 --- a/radio_link.h +++ b/radio_link.h @@ -16,8 +16,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_RADIO_LINK_H -#define __SERVALD_RADIO_LINK_H +#ifndef __SERVAL_DNA___RADIO_LINK_H +#define __SERVAL_DNA___RADIO_LINK_H #define HEARTBEAT_SIZE (8+9) #define LINK_MTU 255 @@ -30,4 +30,4 @@ void radio_link_state_html(struct strbuf *b, struct overlay_interface *interface int radio_link_is_busy(struct overlay_interface *interface); int radio_link_queue_packet(struct overlay_interface *interface, struct overlay_buffer *buffer); -#endif \ No newline at end of file +#endif //__SERVAL_DNA___RADIO_LINK_H diff --git a/rhizome.h b/rhizome.h index 12ffc1a6..9726b20d 100644 --- a/rhizome.h +++ b/rhizome.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALDNA__RHIZOME_H -#define __SERVALDNA__RHIZOME_H +#ifndef __SERVAL_DNA__RHIZOME_H +#define __SERVAL_DNA__RHIZOME_H #include #include @@ -954,4 +954,4 @@ int overlay_mdp_service_rhizome_sync(struct overlay_frame *frame, overlay_mdp_fr int rhizome_sync_announce(); int rhizome_sync_bundle_inserted(const unsigned char *bar); -#endif //__SERVALDNA__RHIZOME_H +#endif //__SERVAL_DNA__RHIZOME_H diff --git a/serval.h b/serval.h index f929b245..62a9b2bd 100644 --- a/serval.h +++ b/serval.h @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_SERVALD_H -#define __SERVALD_SERVALD_H +#ifndef __SERVAL_DNA__SERVAL_H +#define __SERVAL_DNA__SERVAL_H #include #include @@ -700,4 +700,4 @@ int link_stop_routing(struct subscriber *subscriber); int generate_nonce(unsigned char *nonce,int bytes); -#endif // __SERVALD_SERVALD_H +#endif // __SERVAL_DNA__SERVAL_H diff --git a/socket.h b/socket.h index 558e28c1..ce8743be 100644 --- a/socket.h +++ b/socket.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_SOCKET_H -#define __SERVALD_SOCKET_H +#ifndef __SERVAL_DNA___SOCKET_H +#define __SERVAL_DNA___SOCKET_H #ifdef WIN32 # include "win32/win32.h" @@ -85,4 +85,4 @@ ssize_t _recv_message(struct __sourceloc, int fd, struct socket_address *address ssize_t recvwithttl(int sock, unsigned char *buffer, size_t bufferlen, int *ttl, struct socket_address *recvaddr); -#endif +#endif // __SERVAL_DNA___SOCKET_H diff --git a/str.c b/str.c index 4849f8a0..b1ac6a79 100644 --- a/str.c +++ b/str.c @@ -17,7 +17,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#define __SERVAL_DNA_STR_INLINE +#define __SERVAL_DNA__STR_INLINE #include "str.h" #include "strbuf_helpers.h" #include "constants.h" diff --git a/str.h b/str.h index 86f81644..5b6fb2d2 100644 --- a/str.h +++ b/str.h @@ -17,8 +17,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVAL_DNA_STR_H__ -#define __SERVAL_DNA_STR_H__ +#ifndef __SERVAL_DNA__STR_H__ +#define __SERVAL_DNA__STR_H__ #include #include @@ -26,11 +26,11 @@ #include #include -#ifndef __SERVAL_DNA_STR_INLINE +#ifndef __SERVAL_DNA__STR_INLINE # if __GNUC__ && !__GNUC_STDC_INLINE__ -# define __SERVAL_DNA_STR_INLINE extern inline +# define __SERVAL_DNA__STR_INLINE extern inline # else -# define __SERVAL_DNA_STR_INLINE inline +# define __SERVAL_DNA__STR_INLINE inline # endif #endif @@ -53,7 +53,7 @@ extern const char hexdigit_lower[16]; * * @author Andrew Bettison */ -__SERVAL_DNA_STR_INLINE int is_xsubstring(const char *text, int len) +__SERVAL_DNA__STR_INLINE int is_xsubstring(const char *text, int len) { while (len--) if (!isxdigit(*text++)) @@ -66,7 +66,7 @@ __SERVAL_DNA_STR_INLINE int is_xsubstring(const char *text, int len) * * @author Andrew Bettison */ -__SERVAL_DNA_STR_INLINE int is_xstring(const char *text, int len) +__SERVAL_DNA__STR_INLINE int is_xstring(const char *text, int len) { while (len--) if (!isxdigit(*text++)) @@ -209,43 +209,43 @@ extern uint8_t _serval_ctype_0[UINT8_MAX]; extern uint8_t _serval_ctype_1[UINT8_MAX]; extern uint8_t _serval_ctype_2[UINT8_MAX]; -__SERVAL_DNA_STR_INLINE int is_http_char(char c) { +__SERVAL_DNA__STR_INLINE int is_http_char(char c) { return isascii(c); } -__SERVAL_DNA_STR_INLINE int is_http_ctl(char c) { +__SERVAL_DNA__STR_INLINE int is_http_ctl(char c) { return iscntrl(c); } -__SERVAL_DNA_STR_INLINE int is_base64_digit(char c) { +__SERVAL_DNA__STR_INLINE int is_base64_digit(char c) { return (_serval_ctype_0[(unsigned char) c] & _SERVAL_CTYPE_0_BASE64) != 0; } -__SERVAL_DNA_STR_INLINE int is_base64url_digit(char c) { +__SERVAL_DNA__STR_INLINE int is_base64url_digit(char c) { return (_serval_ctype_0[(unsigned char) c] & _SERVAL_CTYPE_0_BASE64URL) != 0; } -__SERVAL_DNA_STR_INLINE int is_base64_pad(char c) { +__SERVAL_DNA__STR_INLINE int is_base64_pad(char c) { return c == '='; } -__SERVAL_DNA_STR_INLINE int is_base64url_pad(char c) { +__SERVAL_DNA__STR_INLINE int is_base64url_pad(char c) { return c == '='; } -__SERVAL_DNA_STR_INLINE uint8_t base64_digit(char c) { +__SERVAL_DNA__STR_INLINE uint8_t base64_digit(char c) { return _serval_ctype_0[(unsigned char) c] & _SERVAL_CTYPE_0_BASE64_MASK; } -__SERVAL_DNA_STR_INLINE uint8_t base64url_digit(char c) { +__SERVAL_DNA__STR_INLINE uint8_t base64url_digit(char c) { return _serval_ctype_0[(unsigned char) c] & _SERVAL_CTYPE_0_BASE64_MASK; } -__SERVAL_DNA_STR_INLINE int is_multipart_boundary(char c) { +__SERVAL_DNA__STR_INLINE int is_multipart_boundary(char c) { return (_serval_ctype_2[(unsigned char) c] & _SERVAL_CTYPE_2_MULTIPART_BOUNDARY) != 0; } -__SERVAL_DNA_STR_INLINE int is_valid_multipart_boundary_string(const char *s) +__SERVAL_DNA__STR_INLINE int is_valid_multipart_boundary_string(const char *s) { if (s[0] == '\0') return 0; @@ -255,11 +255,11 @@ __SERVAL_DNA_STR_INLINE int is_valid_multipart_boundary_string(const char *s) return s[-1] != ' '; } -__SERVAL_DNA_STR_INLINE int is_http_separator(char c) { +__SERVAL_DNA__STR_INLINE int is_http_separator(char c) { return (_serval_ctype_1[(unsigned char) c] & _SERVAL_CTYPE_1_HTTP_SEPARATOR) != 0; } -__SERVAL_DNA_STR_INLINE int is_http_token(char c) { +__SERVAL_DNA__STR_INLINE int is_http_token(char c) { return is_http_char(c) && !is_http_ctl(c) && !is_http_separator(c); } @@ -268,7 +268,7 @@ __SERVAL_DNA_STR_INLINE int is_http_token(char c) { * * @author Andrew Bettison */ -__SERVAL_DNA_STR_INLINE int hexvalue(char c) { +__SERVAL_DNA__STR_INLINE int hexvalue(char c) { return isxdigit(c) ? _serval_ctype_1[(unsigned char) c] & _SERVAL_CTYPE_1_HEX_MASK : -1; } @@ -302,24 +302,24 @@ const char *strnchr(const char *s, size_t n, char c); * @author Andrew Bettison */ -__SERVAL_DNA_STR_INLINE ssize_t str_index_dfl(const char *s, char c, ssize_t dfl) +__SERVAL_DNA__STR_INLINE ssize_t str_index_dfl(const char *s, char c, ssize_t dfl) { const char *r = strchr(s, c); return r ? r - s : dfl; } -__SERVAL_DNA_STR_INLINE ssize_t str_rindex_dfl(const char *s, char c, ssize_t dfl) +__SERVAL_DNA__STR_INLINE ssize_t str_rindex_dfl(const char *s, char c, ssize_t dfl) { const char *r = strrchr(s, c); return r ? r - s : dfl; } -__SERVAL_DNA_STR_INLINE ssize_t str_index(const char *s, char c) +__SERVAL_DNA__STR_INLINE ssize_t str_index(const char *s, char c) { return str_index_dfl(s, c, -1); } -__SERVAL_DNA_STR_INLINE ssize_t str_rindex(const char *s, char c) +__SERVAL_DNA__STR_INLINE ssize_t str_rindex(const char *s, char c) { return str_rindex_dfl(s, c, -1); } @@ -447,15 +447,15 @@ int str_to_uint64_interval_ms(const char *str, int64_t *result, const char **aft */ int str_is_uri(const char *uri); -__SERVAL_DNA_STR_INLINE int is_uri_char_scheme(char c) { +__SERVAL_DNA__STR_INLINE int is_uri_char_scheme(char c) { return (_serval_ctype_1[(unsigned char) c] & _SERVAL_CTYPE_1_URI_SCHEME) != 0; } -__SERVAL_DNA_STR_INLINE int is_uri_char_unreserved(char c) { +__SERVAL_DNA__STR_INLINE int is_uri_char_unreserved(char c) { return (_serval_ctype_1[(unsigned char) c] & _SERVAL_CTYPE_1_URI_UNRESERVED) != 0; } -__SERVAL_DNA_STR_INLINE int is_uri_char_reserved(char c) { +__SERVAL_DNA__STR_INLINE int is_uri_char_reserved(char c) { return (_serval_ctype_1[(unsigned char) c] & _SERVAL_CTYPE_1_URI_RESERVED) != 0; } @@ -464,7 +464,7 @@ __SERVAL_DNA_STR_INLINE int is_uri_char_reserved(char c) { * * @author Andrew Bettison */ -__SERVAL_DNA_STR_INLINE int str_is_uri_scheme(const char *scheme) +__SERVAL_DNA__STR_INLINE int str_is_uri_scheme(const char *scheme) { if (!isalpha(*scheme++)) return 0; @@ -530,4 +530,4 @@ int str_uri_authority_port(const char *auth, uint16_t *portp); int parse_argv(char *cmdline, char delim, char **argv, int max_argv); -#endif // __SERVAL_DNA_STR_H__ +#endif // __SERVAL_DNA__STR_H__ diff --git a/uuid.c b/uuid.c index d77f369b..a0209a7e 100644 --- a/uuid.c +++ b/uuid.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#define __SERVALDNA_UUID_H_INLINE +#define __SERVAL_DNA__UUID_H_INLINE #include "uuid.h" #include "os.h" #include "str.h" diff --git a/uuid.h b/uuid.h index fea11631..1675b663 100644 --- a/uuid.h +++ b/uuid.h @@ -17,19 +17,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALDNA_UUID_H -#define __SERVALDNA_UUID_H +#ifndef __SERVAL_DNA__UUID_H +#define __SERVAL_DNA__UUID_H #include #include #include #include "strbuf.h" -#ifndef __SERVALDNA_UUID_H_INLINE +#ifndef __SERVAL_DNA__UUID_H_INLINE # if __GNUC__ && !__GNUC_STDC_INLINE__ -# define __SERVALDNA_UUID_H_INLINE extern inline +# define __SERVAL_DNA__UUID_H_INLINE extern inline # else -# define __SERVALDNA_UUID_H_INLINE inline +# define __SERVAL_DNA__UUID_H_INLINE inline # endif #endif @@ -74,11 +74,11 @@ enum uuid_version { UUID_VERSION_NAME_SHA1 = 5 }; -__SERVALDNA_UUID_H_INLINE int cmp_uuid_t(const uuid_t *a, const uuid_t *b) { +__SERVAL_DNA__UUID_H_INLINE int cmp_uuid_t(const uuid_t *a, const uuid_t *b) { return memcmp(a->u.binary, b->u.binary, sizeof a->u.binary); } -__SERVALDNA_UUID_H_INLINE int uuid_is_valid(const uuid_t *any_uuid) { +__SERVAL_DNA__UUID_H_INLINE int uuid_is_valid(const uuid_t *any_uuid) { return (any_uuid->u.record.clock_seq_hi_and_reserved & 0xc0) == 0x80; } @@ -125,4 +125,4 @@ strbuf strbuf_uuid(strbuf, const uuid_t *valid_uuid); */ int str_to_uuid(const char *str, uuid_t *result, const char **afterp); -#endif //__SERVALDNA_OS_H +#endif //__SERVAL_DNA__OS_H diff --git a/xprintf.h b/xprintf.h index 91d81b9a..25757ceb 100644 --- a/xprintf.h +++ b/xprintf.h @@ -17,8 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __SERVALD_XPRINTF_H -#define __SERVALD_XPRINTF_H +#ifndef __SERVAL_DNA__XPRINTF_H +#define __SERVAL_DNA__XPRINTF_H /* Generalised (extensible) printf framework. * @@ -107,4 +107,4 @@ CONTEXT_VPRINTF _cx_vprintf_mallocbuf; #define XPRINTF_STRBUF(SB) _XPRINTF(_cx_vprintf_strbuf,(SB)) CONTEXT_VPRINTF _cx_vprintf_strbuf; -#endif // __SERVALD_XPRINTF_H +#endif // __SERVAL_DNA__XPRINTF_H