-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViArray.h
More file actions
47 lines (33 loc) · 1.6 KB
/
ViArray.h
File metadata and controls
47 lines (33 loc) · 1.6 KB
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
#include "arithmetica.h"
/*
* The module for working with arrays in viper-language context & string
*/
#ifndef VIPER_V4_VIARRAY_H
#define VIPER_V4_VIARRAY_H
/* Exception messages */
#define VIARRAY_INDEX_EXCEPTION "unacceptable index value"
#define VIARRAY_RANGE_EXCEPTION "index out of range"
#define VIARRAY_NEW_ELEMENT_ERR "create new element available only for arrays"
#define VIARRAY_UNDEFINED_KEY "undefined key-value"
#define VIARRAY_INVALID_KEY_TYPE "invalid key type"
/* The function will be allocate the system array into heap */
Node * new_viarray(Array ** array);
/* Display viarray */
void display_viarray(Node * root);
/* The function will be return element or sub-array by index */
Constant * get_by_index(Constant * object, Array ** params);
/* The function will be return single element by index */
Constant * get_single(Constant * object, Constant * index);
/* The function will be return the sub-viarray by parameters */
Constant * get_subviarray(Constant * object, Constant * start, Constant * end);
/* The function will be return the sub-viarray by parameters and step */
Constant * get_subviarray_step(Constant * object, Constant * start, Constant * end, Constant * step);
/* The function will be create new node of viarray and return the origin */
Constant * get_new(Constant * object);
/* The function will be return the length of viarray */
int get_length(Node * viarray);
/* The function will copy ViArray */
Node * copy_viarray(Node * viarray);
/* The function will be validate the type of index parameter */
void validate_index_parameter(Array ** params);
#endif //VIPER_V4_VIARRAY_H