2
2
* Created on Tue June 18 2020
3
3
*
4
4
* Copyright (c) 2020 - Daniel Hajnal
5
+
5
6
*/
6
7
7
8
@@ -142,8 +143,8 @@ void add_interpreter_instruction(const char **name, const char **desc, void (*fu
142
143
API_tree [0 ].left = NULL ; // because it is the first element of the tree,
143
144
API_tree [0 ].right = NULL ; // left and right branches has to be NULL
144
145
145
- API_tree [0 ].place = 0 ; // default place = 0
146
-
146
+ API_tree [0 ].place = 0 ; // default place = 0
147
+
147
148
}
148
149
149
150
// if it is ot the first command we have to find it's place in the tree
@@ -164,7 +165,7 @@ void add_interpreter_instruction(const char **name, const char **desc, void (*fu
164
165
}
165
166
166
167
// link the new item on the previous branch
167
- ( comp_res > 0 ) ? ( ( prev -> left ) = & API_tree [API_cntr ] ) : ( ( prev -> right ) = & API_tree [API_cntr ] );
168
+ ( comp_res > 0 ) ? ( ( prev -> left ) = & API_tree [API_cntr ] ) : ( ( prev -> right ) = & API_tree [API_cntr ] );
168
169
169
170
// Fill the new item parameters
170
171
@@ -175,7 +176,7 @@ void add_interpreter_instruction(const char **name, const char **desc, void (*fu
175
176
API_tree [API_cntr ].left = NULL ; // close the branch
176
177
API_tree [API_cntr ].right = NULL ;
177
178
178
- API_tree [API_cntr ].place = 0 ; // default place = 0
179
+ API_tree [API_cntr ].place = 0 ; // default place = 0
179
180
180
181
}
181
182
@@ -194,7 +195,7 @@ void index_apis_in_order(API_t *head){
194
195
#ifdef INTERPRETER_DBG
195
196
INTERPRETER_DBG ( "Indexer finished...\r\n" );
196
197
#endif
197
-
198
+
198
199
199
200
}
200
201
@@ -213,13 +214,13 @@ void recursive_indexer(API_t *head){
213
214
head -> place = API_place_cntr ;
214
215
API_place_cntr ++ ;
215
216
216
- recursive_indexer ( head -> right );
217
+ recursive_indexer ( head -> right );
217
218
218
219
}
219
220
220
221
// This function is used to print out the API to the console
221
222
void print_apis_in_order (API_t * head ){
222
-
223
+
223
224
// End of recursive algorythm
224
225
if ( head == 0 ){
225
226
return ;
@@ -239,7 +240,7 @@ uint16_t find_api_index_by_place( uint16_t place ){
239
240
for ( i = 0 ; i < NUM_OF_API_FUNCS ; i ++ ){
240
241
241
242
if ( API_tree [i ].place == place ){
242
-
243
+
243
244
return i ;
244
245
245
246
}
@@ -331,7 +332,7 @@ void recursive_optimiser( int32_t start_index, int32_t stop_index ){
331
332
}
332
333
333
334
void execute ( char * cmd , int (* resp_fn )(const char * , ...) ){
334
-
335
+
335
336
API_t * next ;
336
337
API_t * prev ;
337
338
int8_t comp_res ;
@@ -358,7 +359,7 @@ void execute( char *cmd, int(*resp_fn)(const char*, ...) ){
358
359
* arg = '\0' ;
359
360
arg ++ ;
360
361
361
- }
362
+ }
362
363
363
364
364
365
prev = & API_tree [0 ];
0 commit comments