pam_pkcs11
0.6.8
|
00001 /* 00002 * PAM-PKCS11 string tools 00003 * Copyright (C) 2005 Juan Antonio Martinez <jonsito@teleline.es> 00004 * pam-pkcs11 is copyright (C) 2003-2004 of Mario Strasser <mast@gmx.net> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 * $Id: strings.h 363 2009-06-12 08:05:29Z ludovic.rousseau $ 00021 */ 00022 00023 #ifndef __STRINGS_H_ 00024 #define __STRINGS_H_ 00025 00026 #ifdef HAVE_CONFIG_H 00027 #include <config.h> 00028 #endif 00029 00030 #include <stdlib.h> 00031 #include <string.h> 00032 00036 #ifndef _STRINGS_C_ 00037 #define M_EXTERN extern 00038 #else 00039 #define M_EXTERN 00040 #endif 00041 00047 M_EXTERN int is_empty_str(const char *str); 00048 00054 M_EXTERN char *clone_str(const char *str); 00055 00061 M_EXTERN char *toupper_str(const char *str); 00062 00068 M_EXTERN char *tolower_str(const char *str); 00069 00076 M_EXTERN char *bin2hex(const unsigned char *binstr,const int len); 00077 00083 M_EXTERN unsigned char *hex2bin(const char *hexstr); 00084 00093 M_EXTERN unsigned char *hex2bin_static(const char *hexstr,unsigned char **res,int *size); 00094 00104 M_EXTERN char **split(const char *str,char sep, int nelems); 00105 00117 M_EXTERN char **split_static(const char *str,char sep, int nelems,char *dst); 00118 00126 M_EXTERN char *trim(const char *str); 00127 00128 #undef M_EXTERN 00129 00130 #endif