OpenDNSSEC-enforcer  1.3.4
/build/buildd/opendnssec-1.3.4/enforcer/ksm/include/ksm/string_util2.h
Go to the documentation of this file.
00001 /*
00002  * $Id: string_util2.h 4141 2010-10-25 15:26:40Z sion $
00003  *
00004  * Copyright (c) 2008-2009 Nominet UK. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  * 1. Redistributions of source code must retain the above copyright
00010  *    notice, this list of conditions and the following disclaimer.
00011  * 2. Redistributions in binary form must reproduce the above copyright
00012  *    notice, this list of conditions and the following disclaimer in the
00013  *    documentation and/or other materials provided with the distribution.
00014  *
00015  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00016  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00017  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00018  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
00019  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00020  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00021  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00023  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00024  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
00025  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026  *
00027  */
00028 
00029 #ifndef KSM_STRING_UTIL2_H
00030 #define KSM_STRING_UTIL2_H
00031 
00032 /*+
00033  * Filename: string_util2.h
00034  *
00035  * Description:
00036  *      Additional string function definitions.
00037 -*/
00038 
00039 #include <ksm/system_includes.h>
00040 #include <ksm/memory.h>
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 /* Structure definition for StrKeywordSearch function */
00047 
00048 typedef struct {
00049     const char* string;
00050     int         value;
00051 } STR_KEYWORD_ELEMENT;
00052 
00053 /* Function definitions */
00054 
00055 void StrAppend(char** str1, const char* str2);
00056 void StrArglistAdd(char*** argv, const char* string);
00057 void StrArglistFree(char*** argv);
00058 char** StrArglistCreate(const char* string);
00059 int StrKeywordSearch(const char* search, STR_KEYWORD_ELEMENT* keywords, int* value);
00060 int StrStrtol(const char* string, long* value);
00061 int StrStrtoul(const char* string, unsigned long* value);
00062 int StrStrtoi(const char* string, int* value);
00063 int StrStrtoui(const char* string, unsigned int* value);
00064 int StrIsDigits(const char* string);
00065 
00066 #ifdef __cplusplus
00067 }
00068 #endif
00069 
00070 #endif /* KSM_STRING_UTIL2_H */