2024-02-20 22:11:24 +05:30
|
|
|
/*
|
|
|
|
* str_replace.h
|
|
|
|
*
|
|
|
|
* Author: Intel A80486DX2-66
|
2024-04-26 01:46:39 +05:30
|
|
|
* License: Unlicense
|
2024-02-20 22:11:24 +05:30
|
|
|
*/
|
|
|
|
|
2024-06-28 16:26:12 +05:30
|
|
|
#ifndef _STR_REPLACE_H
|
|
|
|
#define _STR_REPLACE_H
|
|
|
|
|
2024-06-28 16:31:30 +05:30
|
|
|
#include <stdbool.h>
|
2024-02-20 22:11:24 +05:30
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2024-06-28 16:28:56 +05:30
|
|
|
// macros
|
|
|
|
// : parameters
|
|
|
|
// : : count of replacements
|
2024-03-16 17:54:22 +05:30
|
|
|
#define STR_REPLACE_ALL 0
|
2024-06-28 16:33:49 +05:30
|
|
|
// : : directions
|
|
|
|
#define STR_REPLACE_DIR_FORWARD false
|
|
|
|
#define STR_REPLACE_DIR_BACKWARD true
|
2024-03-16 17:54:22 +05:30
|
|
|
|
2024-06-28 16:28:56 +05:30
|
|
|
// function definitions
|
2024-02-20 22:11:24 +05:30
|
|
|
char* str_replace(
|
|
|
|
const char* str,
|
|
|
|
const char* substr,
|
|
|
|
const char* replacement,
|
|
|
|
ssize_t max_count
|
|
|
|
);
|
2024-06-28 16:26:12 +05:30
|
|
|
|
|
|
|
#endif /* _STR_REPLACE_H */
|