-
Notifications
You must be signed in to change notification settings - Fork 11
/
string_util.h
62 lines (47 loc) · 1.35 KB
/
string_util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* =====================================================================================
*
* Filename: string_util.h
*
* Description: iString util
*
* Version: 1.0
* Created: Thursday 03 August 2017 05:37:07 IST
* Revision: 1.0
* Compiler: gcc
*
* Author: Er. Abhishek Sagar, Networking Developer (AS), sachinites@gmail.com
* Company: Brocade Communications(Jul 2012- Mar 2016), Current : Juniper Networks(Apr 2017 - Present)
*
* =====================================================================================
*/
#ifndef __STRING_UTIL__
#define __STRING_UTIL__
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
char** tokenizer(char* a_str,
const char a_delim,
size_t *token_cnt);
void
string_space_trim(char *string);
void
print_tokens(unsigned int index);
void
init_token_array();
void
re_init_tokens(int token_cnt);
void
tokenize(char *token, unsigned int size, unsigned int index);
void
untokenize(unsigned int index);
char *
get_token(unsigned int index);
void replaceSubstring(char string[], char sub[], char new_str[]);
bool
pattern_match(char string[], int string_size, char pattern[]);
int
grep (char string[], int string_size, char pattern[]);
uint64_t
string_fetch_integer(char *string, int string_size, int index);
#endif