forked from thewhoo/ifj15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
builtin.h
65 lines (58 loc) · 1.39 KB
/
builtin.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
62
63
64
65
/*
* Course IFJ @ FIT VUT Brno, 2015
* IFJ15 Interpreter Project
*
* Authors:
* Lukas Osadsky - xosads00
* Pavol Plaskon - xplask00
* Pavel Pospisil - xpospi88
* Matej Postolka - xposto02
*
* Unless otherwise stated, all code is licensed under a
* GNU General Public License v2.0
*
*/
/**
* @file builtin.h
* @brief Implementation of built-in functions used by interpret
*
*
*/
#include "adt.h"
/**
* @brief Returns string length
*
* @param str ptr to string variable
* @return int length of string
*/
int length(TVariable *str);
/**
* @brief Concatenation of two strings
*
* @param *str1 ptr to string variable
* @param *str2 ptr to string variable
* @return ptr to new string
*/
char* concat(TVariable* str1, TVariable* str2);
/**
* @brief C++ std::cout simulation, prints only one variable
*
* @param output ptr to variable with int/double/string value
*/
void cout(TVariable* output);
/**
* @brief C++ std::cin simulation, reads only one variable
*
* @param in ptr to variable with int/double/string value
*/
void cin(TVariable *in);
/**
* @brief Returns substring from index i, n chars long in string s
*
* C++ std::basic_string::substr simulation
* @param *s ptr to string
* @param i index of substring beggining
* @param n length of substring
* @return ptr to new string, substring of string s
*/
char* substr(char *s, int i, int n);