https://github.com/seff34/string-parser-in-c
String Parser in C Standart Libs.
https://github.com/seff34/string-parser-in-c
c cparser parse parser string strings
Last synced: 25 days ago
JSON representation
String Parser in C Standart Libs.
- Host: GitHub
- URL: https://github.com/seff34/string-parser-in-c
- Owner: seff34
- Created: 2022-08-22T17:33:50.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-25T17:37:34.000Z (almost 4 years ago)
- Last Synced: 2025-01-19T18:52:04.144Z (over 1 year ago)
- Topics: c, cparser, parse, parser, string, strings
- Language: C
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# String Parser in C
String Parser in C Standart Libs.
## API Functions
#### Timer Initalize
```c
int8_t parser(char* input,const char* header,const char* start,const char* end,char* output );
```
| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| `input` | `char*` | Input Array |
| `header ` | `char*` | Header of Array|
| `start ` | `char*` | Parsing Starter |
| `end ` | `char*` | Parsing Finisher |
| `output ` | `char*` | Output Array |
#### Example Code
```c
#include
#include
#include
#include
int main(int argc,char **argv)
{
(void)argc;
(void)argv;
char demand[] = "[ DEMAND ]";
char name[] = "NAME=Demand_00$";
char message[]= "MSG=%00000000000000000000#\\x06$";
//Local Variable
//char result[50] = { 0 };
//Dynamic Variable
char* result = (char*)calloc(50,sizeof(char));
parser(demand,"[ DEMAND ]"," "," ",result);
printf("Result : %s\n",result);
parser(name,"NAME=","=","$",result);
printf("Result : %s\n",result);
parser(message,"MSG=","=","$",result);
printf("Result : %s\n",result);
free(result);
return EXIT_SUCCESS;
}
```
## Download Code
Clone Project
```bash
git clone https://github.com/seff34/String-Parser
```