-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatch_handler.h
More file actions
58 lines (43 loc) · 1.49 KB
/
batch_handler.h
File metadata and controls
58 lines (43 loc) · 1.49 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
48
49
50
51
52
53
54
55
56
57
58
#ifndef _BATCH_HANDLER_H_
#define _BATCH_HANDLER_H_
typedef struct instruction instruction;
typedef struct arrayOfInstructions arrayOfInstructions;
struct instruction{
char type; //Q, A or D
char* ngram;
int num;
int numForQ;
};
typedef struct instructionStatic{
char type;
char* ngram;
int num;
}instructionStatic;
typedef struct arrayOfInstrStatic{
int length;
instructionStatic* array;
int position;
}arrayOfInstrStatic;
struct arrayOfInstructions{
int length; //in the beggining is 10
instruction* array;
int position; //position of first null element
};
//dynamic
arrayOfInstructions* initializeInstructionArray();
void doubleInstructionArray(arrayOfInstructions* arrayOfInstr);
void insertInstructionArray(arrayOfInstructions* arrayOfInstr, instruction* node);
void destroyInstructionArray(arrayOfInstructions* arrayOfInstr);
void initializeInstruction(instruction* instr);
void printInstruction(instruction* instr);
void printInstructionArray(arrayOfInstructions* arrayOfInstr);
void rearrangeArray(arrayOfInstructions* arrayOfInstr);
void moveUp(instruction* array, int position, int lastElement);
//static
arrayOfInstrStatic* initializeInstrStaticArr();
void initializeInstrStatic(instructionStatic* instr);
void doubleInstrStaticArray(arrayOfInstrStatic* arrayOfInstr);
void insertInstrStaticArray(arrayOfInstrStatic* arrayOfInstr, instructionStatic* node);
void destroyInstructionStatic(instructionStatic* instr);
void destroyInstrStaticArray(arrayOfInstrStatic* arrayOfInstr);
#endif