-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstr.h
50 lines (41 loc) · 1.04 KB
/
str.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
/***************************
* PROJECT:
* IFJ20 - Compiler for imperative programming language IFJ20
*
* UNIVERSITY:
* Faculty of Information Technology, Brno University of Technology
*
* FILE:
* str.h
*
* DESCRIPTION:
* Lexical analysis
*
* AUTHORS:
* Kolaříková Mirka <[email protected]>
* Žovinec Martin <[email protected]>
*/
//#include "main.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#ifndef IFJ_STRING_H
#define IFJ_STRING_H
typedef struct
{
char* str; // misto pro dany retezec ukonceny znakem '\0'
int length; // skutecna delka retezce
int allocSize; // velikost alokovane pameti
} string;
int strInit(string *s);
void strFree(string *s);
void strClear(string *s);
int strAddChar(string *s1, char c);
int strAddChars(string *s1, char *c);
int strCopyString(string *s1, string *s2);
int strCmpString(string *s1, string *s2);
int strCmpConstStr(string *s1, char *s2);
char *strGetStr(string *s);
int strGetLength(string *s);
#endif //IFJ_STRING_H