⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢠⣴⣿⣿⣿⣷⣼⣿⠀⣴⠾⠷⠶⠦⡄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢠⡤⢶⣦⣾⣿⣿⣿⣿⣿⣿⣿⠀⣿⣶⣶⣦⣄⠳⣤⣤⠄⠀⠀⠀
⠀⠀⠀⢀⣼⣳⡿⢻⣿⣿⣿⣿⣿⣿⣿⣿⣶⣿⣿⣗⠈⠙⠻⣶⣄⡀⠀⠀⠀
⠀⠀⠀⣰⠿⠁⢀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠈⠳⣤⠀⠀
⠀⠀⢀⡟⠀⢰⣿⠟⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠁⠈⠻⣶⣄⠀⠀⠈⠛⢦   
⠀⣀⡼⠃⠀⣼⡟⠀⠀⢸⣿⡿⠉⣿⡿⠿⠛⣿⡄⠀⠀⠀⠙⠿⣆⠀⠀⠀⠈
⠈⠁⠀⠀⢸⡟⠀⠀⠀⢸⣿⠀⠀⣿⠁⠀⠀⠈⠃⠀⠀⠀⠀⠀⠘⢷⡄⠀⠀
⠀⠀⠀⠀⣼⠃⠀⠀⠀⢸⡟⠀⠀⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡆⠀
⠀⠀⠀⣠⡏⠀⠀⠀⠀⣼⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠻⠃⠀⠀⠀⠀⣻⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ 
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Current Dir: /usr/include/bind9/isc/

[FILE] aes.h [ edit | delete | rename | download ]
[FILE] app.h [ edit | delete | rename | download ]
[FILE] assertions.h [ edit | delete | rename | download ]
[FILE] atomic.h [ edit | delete | rename | download ]
[FILE] backtrace.h [ edit | delete | rename | download ]
[FILE] base32.h [ edit | delete | rename | download ]
[FILE] base64.h [ edit | delete | rename | download ]
[FILE] bind9.h [ edit | delete | rename | download ]
[FILE] boolean.h [ edit | delete | rename | download ]
[FILE] buffer.h [ edit | delete | rename | download ]
[FILE] bufferlist.h [ edit | delete | rename | download ]
[FILE] commandline.h [ edit | delete | rename | download ]
[FILE] condition.h [ edit | delete | rename | download ]
[FILE] counter.h [ edit | delete | rename | download ]
[FILE] crc64.h [ edit | delete | rename | download ]
[FILE] deprecated.h [ edit | delete | rename | download ]
[FILE] dir.h [ edit | delete | rename | download ]
[FILE] entropy.h [ edit | delete | rename | download ]
[FILE] errno.h [ edit | delete | rename | download ]
[FILE] errno2result.h [ edit | delete | rename | download ]
[FILE] error.h [ edit | delete | rename | download ]
[FILE] event.h [ edit | delete | rename | download ]
[FILE] eventclass.h [ edit | delete | rename | download ]
[FILE] file.h [ edit | delete | rename | download ]
[FILE] formatcheck.h [ edit | delete | rename | download ]
[FILE] fsaccess.h [ edit | delete | rename | download ]
[FILE] hash.h [ edit | delete | rename | download ]
[FILE] heap.h [ edit | delete | rename | download ]
[FILE] hex.h [ edit | delete | rename | download ]
[FILE] hmacmd5.h [ edit | delete | rename | download ]
[FILE] hmacsha.h [ edit | delete | rename | download ]
[FILE] ht.h [ edit | delete | rename | download ]
[FILE] httpd.h [ edit | delete | rename | download ]
[FILE] int.h [ edit | delete | rename | download ]
[FILE] interfaceiter.h [ edit | delete | rename | download ]
[FILE] iterated_hash.h [ edit | delete | rename | download ]
[FILE] json.h [ edit | delete | rename | download ]
[FILE] keyboard.h [ edit | delete | rename | download ]
[FILE] lang.h [ edit | delete | rename | download ]
[FILE] lex.h [ edit | delete | rename | download ]
[FILE] lfsr.h [ edit | delete | rename | download ]
[FILE] lib.h [ edit | delete | rename | download ]
[FILE] likely.h [ edit | delete | rename | download ]
[FILE] list.h [ edit | delete | rename | download ]
[FILE] log.h [ edit | delete | rename | download ]
[FILE] magic.h [ edit | delete | rename | download ]
[FILE] md5.h [ edit | delete | rename | download ]
[FILE] mem.h [ edit | delete | rename | download ]
[FILE] meminfo.h [ edit | delete | rename | download ]
[FILE] msgcat.h [ edit | delete | rename | download ]
[FILE] msgs.h [ edit | delete | rename | download ]
[FILE] mutex.h [ edit | delete | rename | download ]
[FILE] mutexblock.h [ edit | delete | rename | download ]
[FILE] net.h [ edit | delete | rename | download ]
[FILE] netaddr.h [ edit | delete | rename | download ]
[FILE] netdb.h [ edit | delete | rename | download ]
[FILE] netscope.h [ edit | delete | rename | download ]
[FILE] offset.h [ edit | delete | rename | download ]
[FILE] once.h [ edit | delete | rename | download ]
[FILE] ondestroy.h [ edit | delete | rename | download ]
[FILE] os.h [ edit | delete | rename | download ]
[FILE] parseint.h [ edit | delete | rename | download ]
[FILE] platform.h [ edit | delete | rename | download ]
[FILE] pool.h [ edit | delete | rename | download ]
[FILE] portset.h [ edit | delete | rename | download ]
[FILE] print.h [ edit | delete | rename | download ]
[FILE] queue.h [ edit | delete | rename | download ]
[FILE] quota.h [ edit | delete | rename | download ]
[FILE] radix.h [ edit | delete | rename | download ]
[FILE] random.h [ edit | delete | rename | download ]
[FILE] ratelimiter.h [ edit | delete | rename | download ]
[FILE] refcount.h [ edit | delete | rename | download ]
[FILE] regex.h [ edit | delete | rename | download ]
[FILE] region.h [ edit | delete | rename | download ]
[FILE] resource.h [ edit | delete | rename | download ]
[FILE] result.h [ edit | delete | rename | download ]
[FILE] resultclass.h [ edit | delete | rename | download ]
[FILE] rwlock.h [ edit | delete | rename | download ]
[FILE] safe.h [ edit | delete | rename | download ]
[FILE] serial.h [ edit | delete | rename | download ]
[FILE] sha1.h [ edit | delete | rename | download ]
[FILE] sha2.h [ edit | delete | rename | download ]
[FILE] sockaddr.h [ edit | delete | rename | download ]
[FILE] socket.h [ edit | delete | rename | download ]
[FILE] stat.h [ edit | delete | rename | download ]
[FILE] stats.h [ edit | delete | rename | download ]
[FILE] stdio.h [ edit | delete | rename | download ]
[FILE] stdlib.h [ edit | delete | rename | download ]
[FILE] stdtime.h [ edit | delete | rename | download ]
[FILE] strerror.h [ edit | delete | rename | download ]
[FILE] string.h [ edit | delete | rename | download ]
[FILE] symtab.h [ edit | delete | rename | download ]
[FILE] syslog.h [ edit | delete | rename | download ]
[FILE] task.h [ edit | delete | rename | download ]
[FILE] taskpool.h [ edit | delete | rename | download ]
[FILE] thread.h [ edit | delete | rename | download ]
[FILE] time.h [ edit | delete | rename | download ]
[FILE] timer.h [ edit | delete | rename | download ]
[FILE] tm.h [ edit | delete | rename | download ]
[FILE] types.h [ edit | delete | rename | download ]
[FILE] util.h [ edit | delete | rename | download ]
[FILE] version.h [ edit | delete | rename | download ]
[FILE] xml.h [ edit | delete | rename | download ]

Viewing: /usr/include/bind9/isc/string.h

/*
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
 */

/* $Id: string.h,v 1.23 2007/09/13 04:48:16 each Exp $ */

#ifndef ISC_STRING_H
#define ISC_STRING_H 1

/*! \file isc/string.h */

#include <isc/formatcheck.h>
#include <isc/int.h>
#include <isc/lang.h>
#include <isc/platform.h>
#include <isc/types.h>

#include <string.h>

#ifdef ISC_PLATFORM_HAVESTRINGSH
#include <strings.h>
#endif

#define ISC_STRING_MAGIC 0x5e

ISC_LANG_BEGINDECLS

isc_uint64_t
isc_string_touint64(char *source, char **endp, int base);
/*%<
 * Convert the string pointed to by 'source' to isc_uint64_t.
 *
 * On successful conversion 'endp' points to the first character
 * after conversion is complete.
 *
 * 'base': 0 or 2..36
 *
 * If base is 0 the base is computed from the string type.
 *
 * On error 'endp' points to 'source'.
 */

isc_result_t
isc_string_copy(char *target, size_t size, const char *source);
/*
 * Copy the string pointed to by 'source' to 'target' which is a
 * pointer to a string of at least 'size' bytes.
 *
 * Requires:
 *	'target' is a pointer to a char[] of at least 'size' bytes.
 *	'size' an integer > 0.
 *	'source' == NULL or points to a NUL terminated string.
 *
 * Ensures:
 *	If result == ISC_R_SUCCESS
 *		'target' will be a NUL terminated string of no more
 *		than 'size' bytes (including NUL).
 *
 *	If result == ISC_R_NOSPACE
 *		'target' is undefined.
 *
 * Returns:
 *	ISC_R_SUCCESS  -- 'source' was successfully copied to 'target'.
 *	ISC_R_NOSPACE  -- 'source' could not be copied since 'target'
 *	                  is too small.
 */

void
isc_string_copy_truncate(char *target, size_t size, const char *source);
/*
 * Copy the string pointed to by 'source' to 'target' which is a
 * pointer to a string of at least 'size' bytes.
 *
 * Requires:
 *	'target' is a pointer to a char[] of at least 'size' bytes.
 *	'size' an integer > 0.
 *	'source' == NULL or points to a NUL terminated string.
 *
 * Ensures:
 *	'target' will be a NUL terminated string of no more
 *	than 'size' bytes (including NUL).
 */

isc_result_t
isc_string_append(char *target, size_t size, const char *source);
/*
 * Append the string pointed to by 'source' to 'target' which is a
 * pointer to a NUL terminated string of at least 'size' bytes.
 *
 * Requires:
 *	'target' is a pointer to a NUL terminated char[] of at
 *	least 'size' bytes.
 *	'size' an integer > 0.
 *	'source' == NULL or points to a NUL terminated string.
 *
 * Ensures:
 *	If result == ISC_R_SUCCESS
 *		'target' will be a NUL terminated string of no more
 *		than 'size' bytes (including NUL).
 *
 *	If result == ISC_R_NOSPACE
 *		'target' is undefined.
 *
 * Returns:
 *	ISC_R_SUCCESS  -- 'source' was successfully appended to 'target'.
 *	ISC_R_NOSPACE  -- 'source' could not be appended since 'target'
 *	                  is too small.
 */

void
isc_string_append_truncate(char *target, size_t size, const char *source);
/*
 * Append the string pointed to by 'source' to 'target' which is a
 * pointer to a NUL terminated string of at least 'size' bytes.
 *
 * Requires:
 *	'target' is a pointer to a NUL terminated char[] of at
 *	least 'size' bytes.
 *	'size' an integer > 0.
 *	'source' == NULL or points to a NUL terminated string.
 *
 * Ensures:
 *	'target' will be a NUL terminated string of no more
 *	than 'size' bytes (including NUL).
 */

isc_result_t
isc_string_printf(char *target, size_t size, const char *format, ...)
	ISC_FORMAT_PRINTF(3, 4);
/*
 * Print 'format' to 'target' which is a pointer to a string of at least
 * 'size' bytes.
 *
 * Requires:
 *	'target' is a pointer to a char[] of at least 'size' bytes.
 *	'size' an integer > 0.
 *	'format' == NULL or points to a NUL terminated string.
 *
 * Ensures:
 *	If result == ISC_R_SUCCESS
 *		'target' will be a NUL terminated string of no more
 *		than 'size' bytes (including NUL).
 *
 *	If result == ISC_R_NOSPACE
 *		'target' is undefined.
 *
 * Returns:
 *	ISC_R_SUCCESS  -- 'format' was successfully printed to 'target'.
 *	ISC_R_NOSPACE  -- 'format' could not be printed to 'target' since it
 *	                  is too small.
 */

void
isc_string_printf_truncate(char *target, size_t size, const char *format, ...)
	ISC_FORMAT_PRINTF(3, 4);
/*
 * Print 'format' to 'target' which is a pointer to a string of at least
 * 'size' bytes.
 *
 * Requires:
 *	'target' is a pointer to a char[] of at least 'size' bytes.
 *	'size' an integer > 0.
 *	'format' == NULL or points to a NUL terminated string.
 *
 * Ensures:
 *	'target' will be a NUL terminated string of no more
 *	than 'size' bytes (including NUL).
 */


char *
isc_string_regiondup(isc_mem_t *mctx, const isc_region_t *source);
/*
 * Copy the region pointed to by r to a NUL terminated string
 * allocated from the memory context pointed to by mctx.
 *
 * The result should be deallocated using isc_mem_free()
 *
 * Requires:
 *	'mctx' is a point to a valid memory context.
 *	'source' is a pointer to a valid region.
 *
 * Returns:
 *	a pointer to a NUL terminated string or
 *	NULL if memory for the copy could not be allocated
 *
 */

char *
isc_string_separate(char **stringp, const char *delim);

#ifdef ISC_PLATFORM_NEEDSTRSEP
#define strsep isc_string_separate
#endif

#ifdef ISC_PLATFORM_NEEDMEMMOVE
#define memmove(a,b,c) bcopy(b,a,c)
#endif

size_t
isc_string_strlcpy(char *dst, const char *src, size_t size);


#ifdef ISC_PLATFORM_NEEDSTRLCPY
#define strlcpy isc_string_strlcpy
#endif


size_t
isc_string_strlcat(char *dst, const char *src, size_t size);

#ifdef ISC_PLATFORM_NEEDSTRLCAT
#define strlcat isc_string_strlcat
#endif

char *
isc_string_strcasestr(const char *big, const char *little);

#ifdef ISC_PLATFORM_NEEDSTRCASESTR
#define strcasestr isc_string_strcasestr
#endif

ISC_LANG_ENDDECLS

#endif /* ISC_STRING_H */

Upload File: