Mescal
|
Management of savefiles. More...
#include "main.h"
#include "nfa.h"
#include "parser.h"
#include "regexp.h"
#include "shell_languages.h"
#include "shell_memb.h"
#include "type_basic.h"
#include <json-c/json.h>
Go to the source code of this file.
Macros | |
#define | OUTPUT_DIR "./outputs" |
#define | EXPSIZE 2048 |
Maximal size of a regular expression that can be saved. | |
Functions | |
int | files_save_exall (const char *filename, exall_profile *profile) |
Initializes the json description for example generation. | |
int | files_read_exall (const char *filename, exall_profile *profile) |
void | reg_to_string (regexp *, char *) |
Converts a regular expression into a string. | |
json_object * | files_regexp_to_json (regexp *) |
Converts a regular expression into a json object. | |
json_object * | files_nfa_to_json (nfa *) |
Converts a NFA into a json object. | |
json_object * | files_dfa_to_json (dfa *) |
Converts a DFA into a json object. | |
void * | files_json_to_automaton (json_object *, bool *) |
Reads a json object encoding an automaton and extracts this automaton. | |
void | files_save_object (object *, char *) |
Saves a shell object into a file. | |
int | files_read_object (char *, char *) |
Reads a shell object from a file and assigns it to a variable name. | |
void | files_save_session (char *) |
Saves a complete session in a file. | |
void | files_load_session (char *) |
Loads a complete session from a file. | |
Management of savefiles.
Contains all the functions that can be used to save objects in files and then load these files in the software.
json_object * files_dfa_to_json | ( | dfa * | A | ) |
Converts a DFA into a json object.
A | The automaton. |
void * files_json_to_automaton | ( | json_object * | root, |
bool * | is_dfa ) |
Reads a json object encoding an automaton and extracts this automaton.
Reads a json object encoding an automaton and extracts this automaton.
root | The json object. |
is_dfa | Set to true if the automaton is a DFA, false if it is a NFA. |
void files_load_session | ( | char * | filename | ) |
Loads a complete session from a file.
filename | The path to the file that needs to be read. |
json_object * files_nfa_to_json | ( | nfa * | A | ) |
Converts a NFA into a json object.
A | The automaton. |
int files_read_exall | ( | const char * | filename, |
exall_profile * | profile ) |
filename | The path to the file that needs to be read. |
profile | The profile to fill with the data read from the file. |
int files_read_object | ( | char * | filename, |
char * | varname ) |
Reads a shell object from a file and assigns it to a variable name.
filename | The path to the file that needs to be read. |
varname | The variable name. |
json_object * files_regexp_to_json | ( | regexp * | exp | ) |
Converts a regular expression into a json object.
exp | The regular expression. |
int files_save_exall | ( | const char * | filename, |
exall_profile * | profile ) |
Initializes the json description for example generation.
filename | The path to the file where the data has to be saved. |
profile | The profile to save in the file. |
void files_save_object | ( | object * | theobj, |
char * | filename ) |
Saves a shell object into a file.
theobj | The object that needs to be saved. |
filename | The path to the file in which the save has to be made. |
void files_save_session | ( | char * | filename | ) |
Saves a complete session in a file.
filename | The path to the file in which the save has to be made. |
void reg_to_string | ( | regexp * | r, |
char * | buffer ) |
Converts a regular expression into a string.
r | The regular expression. |
buffer | The buffer used to return the string (it needs to be large enough). |