This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _Bool contains_byte(char* bytes, size_t len, char contains){ | |
| for(size_t i=0;i<len;i++) | |
| if(bytes[i]==contains)return 1; | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define BIT_0 1 | |
| #define BIT_1 2 | |
| #define BIT_2 4 | |
| #define BIT_3 8 | |
| #define BIT_4 16 | |
| #define BIT_5 32 | |
| #define BIT_6 64 | |
| #define BIT_7 128 | |
| void bitchar(char* s, char c){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _Bool contains_chars(char* str, char* contains){ | |
| while(*str){ | |
| for(size_t i=0;contains[i];i++) | |
| if(*str==contains[i])return 1; | |
| str++; | |
| } | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _Bool contains_char(char* str, char contains){ | |
| while(*str){ | |
| if(*str==contains) | |
| return 1; | |
| str++; | |
| } | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| char arr_first(arr_t bytes, arr_t first){ | |
| for(size_t i=0;i<bytes.len;i++){ | |
| for(size_t fi=0;fi<first.len;fi++){ | |
| if(bytes.arr[i]==first.arr[fi]){ | |
| return first.arr[fi]; | |
| } | |
| } | |
| } | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| char str_first(char* str, char* first){ | |
| while(*str){ | |
| for(size_t i=0;first[i];i++) | |
| if(*str==first[i]) return *str; | |
| str++; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| size_t until_char(char* src, char until){ | |
| char* new_src=src; | |
| while(*new_src!=until)new_src++; | |
| return new_src-src; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void str_replace_map(char* str, char* replace, char* with){ | |
| for(size_t i=0;str[i];i++) | |
| for(size_t ii=0;replace[ii];ii++) | |
| if(str[i]==replace[ii]) | |
| str[i]=with[ii]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void str_replace(char* str, char replace, char with){ | |
| for(size_t i=0;str[i];i++) | |
| if(str[i]==replace) str[i]=with; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| unsigned char starts_with(char* _in, char* startsw){ | |
| for(long unsigned int i=0;_in[i]&&startsw[i];i++) | |
| if(_in[i]!=startsw[i]) | |
| return 1; | |
| return 0; | |
| } |