00001 /* 00002 * Copyright (C) 2011-2014 Red Hat, Inc. 00003 * This library is free software; you can redistribute it and/or 00004 * modify it under the terms of the GNU Lesser General Public 00005 * License as published by the Free Software Foundation; either 00006 * version 2.1 of the License, or any later version. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Lesser General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Lesser General Public 00014 * License along with this library; If not, see <http://www.gnu.org/licenses/>. 00015 * 00016 * Author: tasleson 00017 */ 00018 00019 #ifndef LSM_COMMON_H 00020 #define LSM_COMMON_H 00021 00022 #include "libstoragemgmt_types.h" 00023 00024 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00029 #if defined _WIN32 || defined __CYGWIN__ 00030 #define LSM_DLL_IMPORT __declspec(dllimport) 00031 #define LSM_DLL_EXPORT __declspec(dllexport) 00032 #define LSM_DLL_LOCAL 00033 #else 00034 #if __GNUC__ >= 4 00035 #define LSM_DLL_IMPORT __attribute__ ((visibility ("default"))) 00036 #define LSM_DLL_EXPORT __attribute__ ((visibility ("default"))) 00037 #define LSM_DLL_LOCAL __attribute__ ((visibility ("hidden"))) 00038 #else 00039 #define LSM_DLL_IMPORT 00040 #define LSM_DLL_EXPORT 00041 #define LSM_DLL_LOCAL 00042 #endif 00043 #endif 00044 00050 lsm_string_list LSM_DLL_EXPORT *lsm_string_list_alloc(uint32_t size); 00051 00057 int LSM_DLL_EXPORT lsm_string_list_free(lsm_string_list *sl); 00058 00064 lsm_string_list LSM_DLL_EXPORT *lsm_string_list_copy(lsm_string_list *src); 00065 00073 int LSM_DLL_EXPORT lsm_string_list_elem_set(lsm_string_list *sl, 00074 uint32_t index, 00075 const char *value); 00076 00083 const char LSM_DLL_EXPORT *lsm_string_list_elem_get(lsm_string_list *sl, 00084 uint32_t index); 00085 00093 uint32_t LSM_DLL_EXPORT lsm_string_list_size(lsm_string_list *sl); 00094 00101 int LSM_DLL_EXPORT lsm_string_list_append(lsm_string_list *sl, 00102 const char *add); 00103 00113 int LSM_DLL_EXPORT lsm_string_list_delete(lsm_string_list *sl, 00114 uint32_t index); 00115 00123 int LSM_DLL_EXPORT 00124 lsm_initiator_id_verify(const char *init_id, 00125 lsm_access_group_init_type *init_type); 00126 00127 00133 int LSM_DLL_EXPORT lsm_volume_vpd83_verify(const char *vpd83); 00134 00135 #ifdef __cplusplus 00136 } 00137 #endif 00138 #endif /* LSM_COMMON_H */