next up previous contents index
Next: Complex numbers Up: Other useful functions in Previous: Memory management   Contents   Index


Useful functions in the command interpreter library

Most of these functions correspond to commands. They are of the following type

int func(int argc,char *argv[]);

where argc is the number of arguments (including the name of the command) and argv[] the arguments. It is possible to call these functions (to simulate the execution of the corresponding commands). The list of commands is given in 11.




int add_objet(int argc,char *argv[]);


This function corresponds to the command add.




int assign_membre(int argc, char *argv[]) ;


This function corresponds to the command assign.




char *ch_copy(char *);


This function returns a (null-terminated) copy of its argument (and allocates memory for this).




char *ch_copy_int(char *);


This function returns a string containing the value of the argument. For example if i=5785, ch_copy_int(i) will be the null-terminated string ``5785''.




void clean_exit_interp(flow_data *);


This function is called when the command exit is given. It frees all the memory used by the interpreter. The argument is the thread from which it is been called. It can be used when the interpreter is used non-interactively (cf. 14.3).




int Cmult_objet(int argc,char *argv[]);


This function corresponds to the command cmultiply.




int copie_objet(int argc,char *argv[]);


This function corresponds to the command copy.




int convert_int(char *, flow_data *);


This function sends the first argument to the expression evaluator and returns its evaluation casted to an int (see 7). The second argument is the flow_data structure corresponding to the thread from which the function is called.




double convert_float(char *, flow_data *) ;


This function sends the first argument to the expression evaluator and returns the evaluation (see 7). The second argument is the flow_data structure corresponding to the thread from which the function is called.




int delcom(int argc, char *argv[]);


This function corresponds to the command delcom.




int deldon(int argc, char *argv[]);


This function corresponds to the command deldat.




int delprog_cmd(int argc, char *argv[]);


This function corresponds to the command delprog.




int delres(int argc, char *argv[]);


This function corresponds to the command delres.




int desassign_membre(int argc, char *argv[]) ;


This function corresponds to the command desassign.




int detruit_obj(int argc, char *argv[]);


This function corresponds to the command destroy.




void error_mess(flow_data *, int);


This function prints the message whose number is the second argument. These messages are defined in the initialization file (cf. 3). The first argument is the flow_data structure corresponding to the thread from which the function is called.




void Exec_interp_command(char *);


This function executes the command contained in the argument. It should be used when the interpreter has to work non-interactively.




int init_obj(int, flow_data *);


This function deletes all the objects of the type given in argument. The second argument is the flow_data structure corresponding to the thread from which the function is called.




int init_str(int, flow_data *);


This function deletes all the structures of the type given in argument. The second argument is the flow_data structure corresponding to the thread from which the function is called.




int load_cmd(int argc, char *argv[]);


This function corresponds to the command load. It can also be used to load programs when the interpreter is working in a non-interactive way. In this case the function will load the programs contained in the string argv[1], argv[0] must be NULL and argc=0 (see 14.3).




int loadcmd(char *W);


This function loads the program file W in the command directory. This function should be useful in particular when the interpreter is used in a non-interactive way.




int mult_objet(int argc,char *argv[]);


This function corresponds to the command multiply.




int obj_create(int argc, char *argv[]);


This function corresponds to the commands creating objects (cf. 6).




void print(flow_data *, char *, ...);


This function is a version of printf (only the flags %d, %f and %s are supported) with the following modifications : if the interpreter is running silently (for instance inside a silent program or after the command silence...) nothing will be printed. Moreover if a monitor file has been defined this function will also print in this file. The first argument is the flow_data structure corresponding to the thread from which the function is called. See also the command send_print.




void prog_c(int, char *, char *, char *, int, char *, int) ;


This is the function that launches the command interpreter or initializes it when it is used non-interactively (cf. 14).




void read_char(char *, flow_data *);


This function can be used instead of scanf to read input (character strings). It will behave like scanf if the interperter is used in an interactive way, but differently if it is running a program (cf. 4.8.3). The second argument is the flow_data structure corresponding to the thread from which the function is called.




void read_float(float *, flow_data *);


This function can be used instead of scanf to read input (floating point numbers). It will behave like scanf if the interperter is used in an interactive way, but differently if it is running a program (cf. 4.8.3). The second argument is the flow_data structure corresponding to the thread from which the function is called.




void read_int(int *, flow_data *);


This function can be used instead of scanf to read input (integers). It will behave like scanf if the interperter is used in an interactive way, but differently if it is running a program (cf. 4.8.3). The second argument is the flow_data structure corresponding to the thread from which the function is called.




int restore_cmd(int argc,char *argv[]);


This function corresponds to the command restore.



int S_convert_int(char *, flow_data *) ;


This function is used to manipulate hidden variables of the expression evaluator (cf. 7). The second argument is the flow_data structure corresponding to the thread from which the function is called.




int S_convert_float(char *, flow_data *) ;


This function is used to manipulate hidden variables of the expression evaluator (cf. 7). The second argument is the flow_data structure corresponding to the thread from which the function is called.




int shell_cmd(int argc, char *argv[]);


This function corresponds to the command shell.




int sketch_obj(char *, int *, flow_data *);


This function is used to manipulate objects (cf. 6.2). The last argument is the flow_data structure corresponding to the thread from which the function is called.




int sketch_obj_restr(char *, int *, int, flow_data *) ;


This function is used to manipulate objects (cf. 6.2). The last argument is the flow_data structure corresponding to the thread from which the function is called.




int sketch_struc(int, int, char *, int *, flow_data *) ;


This function is used to manipulate structures (cf. 6.9). The last argument is the flow_data structure corresponding to the thread from which the function is called.




int struc_create(int argc, char *argv[]);


This function corresponds to the commands creating structures (cf. 6).




int sub_objet(int argc,char *argv[]);


This function corresponds to the command substract.




int svg_cmd(int argc,char *argv[]);


This function corresponds to the command svg.




int undef_cmd(int argc, char *argv[]);


This function corresponds to the command undef.





next up previous contents index
Next: Complex numbers Up: Other useful functions in Previous: Memory management   Contents   Index
2009-11-12