00001 /* 00002 Copyright 2016 Otavio Rodolfo Piske 00003 00004 Licensed under the Apache License, Version 2.0 (the "License"); 00005 you may not use this file except in compliance with the License. 00006 You may obtain a copy of the License at 00007 00008 http://www.apache.org/licenses/LICENSE-2.0 00009 00010 Unless required by applicable law or agreed to in writing, software 00011 distributed under the License is distributed on an "AS IS" BASIS, 00012 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 See the License for the specific language governing permissions and 00014 limitations under the License. 00015 */ 00016 00017 #ifndef GRU_UTIL_H 00018 #define GRU_UTIL_H 00019 00020 #include <assert.h> 00021 #include <ctype.h> 00022 #include <stdbool.h> 00023 #include <stdio.h> 00024 #include <stdlib.h> 00025 #include <string.h> 00026 00027 #include "collection/gru_list.h" 00028 #include "common/gru_portable.h" 00029 #include "string/gru_alt.h" 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00041 gru_export char *gru_rtrim(char *input, size_t size); 00042 00049 gru_export char *gru_ltrim(char *input, size_t size); 00050 00057 gru_export char *gru_trim(char *input, size_t size); 00058 00064 gru_export const char *gru_get_name_from_url(const char *url, size_t size); 00065 00074 gru_export gru_list_t *gru_split(const char *str, char sep, gru_status_t *status); 00075 00081 gru_export void gru_split_clean(gru_list_t *list); 00082 00090 gru_export char *gru_str_serialize(gru_list_t *list, char sep, gru_status_t *status); 00091 00092 #ifdef __cplusplus 00093 } 00094 #endif 00095 00096 #endif // GRU_UTIL_H