1
0
mirror of https://gitlab.com/80486DX2-66/gists synced 2025-01-10 08:27:48 +05:30
gists/c-programming/strings/str_replace.h

32 lines
528 B
C
Raw Normal View History

2024-02-20 19:41:24 +03:00
/*
* str_replace.h
*
* Author: Intel A80486DX2-66
2024-04-25 23:16:39 +03:00
* License: Unlicense
2024-02-20 19:41:24 +03:00
*/
#ifndef _STR_REPLACE_H
#define _STR_REPLACE_H
#include <stdbool.h>
2024-02-20 19:41:24 +03:00
#include <stdlib.h>
#include <string.h>
2024-06-28 13:58:56 +03:00
// macros
// : parameters
// : : count of replacements
#define STR_REPLACE_ALL 0
2024-06-28 14:03:49 +03:00
// : : directions
#define STR_REPLACE_DIR_FORWARD false
#define STR_REPLACE_DIR_BACKWARD true
2024-06-28 13:58:56 +03:00
// function definitions
2024-02-20 19:41:24 +03:00
char* str_replace(
const char* str,
const char* substr,
const char* replacement,
ssize_t max_count
);
#endif /* _STR_REPLACE_H */