-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring_.h
61 lines (58 loc) · 3.55 KB
/
string_.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
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#define MAX_N_WORDS_IN_STRING 20
typedef struct WordDescriptor
{
char *begin; // ïîçèöèÿ íà÷àëà ñëîâà
char *end; // ïîçèöèÿ ïåðâîãî ñèìâîëà, ïîñëå ïîñëåäíåãî ñèìâîëà
} WordDescriptor;
typedef struct BagOfWords
{
WordDescriptor words[MAX_N_WORDS_IN_STRING];
size_t size;
} BagOfWords;
size_t strlen1 (char *s);
char *find (char *begin, char *end, int ch);
bool isSpace (char sym);
bool isNonSpace (int sym);
char *findNonSpace (char *begin);
char *findSpace (char *begin);
char *findNonSpaceReverse (char *rbegin, const char *rend);
char *findSpaceReverse (char *rbegin, const char *rend);
int strcmp (const char *lhs, const char *rhs);
char *copy (char *beginSource, const char *endSource, char *beginDestination);
char *copyStr (char *dest, char *src);
char *copyIf (char *beginSource, const char *endSource, char *beginDestination, bool (*f)(int));
char *copyIfReverse (char *rbeginSource, const char *rendSource, char *beginDestination, bool (*f)(int));
void removeNonLetters (char *s);
void removeExtraSpaces (char *s);
int getWord (char *beginSearch, WordDescriptor *word);
int getWordReverse (char *rbegin, char *rend, WordDescriptor *word);
bool isNum (char *sym);
void addNumOfSpaces (char *s);
void replace (char *source, char *w1, char *w2);
int WordsCmp (WordDescriptor w1, WordDescriptor w2);
bool isAlphabeticalOrder (char *str);
void getBagOfWords (BagOfWords *bag, char *s);
void printWord (WordDescriptor w);
void PrintWordsBackwards (char *str);
bool isWordPalindrome (WordDescriptor word);
int wordsPalindrome (char *str);
char *alternatingStringWords (char *s1, char *s2);
void reverseWordOrder (char *str);
bool findSymInWord (char s, WordDescriptor word);
void printWordBeforeFirstWordWithA (char *s);
bool wordCmp (WordDescriptor word1, WordDescriptor word2);
void findWordInOtherString (char *s1, char *s2);
bool FindSameWords (char *s1, char *s2);
void getAllUniqueSortedLetters (WordDescriptor *w);
void sortSymInWord (WordDescriptor a);
bool FindSameLettersInWords (char *s);
void getStringFromBag (BagOfWords *w, char *s);
void deleteLastWord (char *s);
WordDescriptor findWordBeforeFirstFoundWord (char *s1, char *s2);
void deleteWord (char *s, WordDescriptor w);
void deletePalindromeWords (char *s);
char *addWordDiffToShorterStr (char *s1, char *s2);
bool isLettersInWordPresentInStr (char *s, WordDescriptor word);