SqueezeBrains SDK 1.18
Source code migration

In this section there are some notes on the changes that need to be made to the source code to move from one version to the next.
Mainly only those changes are reported that concern a change in the way of using functions and data structures.
For other changes, please refer to the Change Log .

Migrate from version 1.17.x to version 1.18.x

No source code migration on the main functions is necessary to move from version 1.17.x to version 1.18.x.

Migrate from version 1.16.x to version 1.17.x

No source code migration on the main functions is necessary to move from version 1.16.x to version 1.17.x.

Migrate from version 1.15.x to version 1.16.x

No source code migration on the main functions is necessary to move from version 1.15.x to version 1.16.x.

Migrate from version 1.14.x to version 1.15.x

No source code migration on the main functions is necessary to move from version 1.14.x to version 1.15.x.

Migrate from version 1.13.x to version 1.14.x

The source code to get project parameters structure in version 1.13.x:

// Get project parameters structure.
sb_project_get_par(project_handle, &par);
sb_t_err sb_project_get_par(SB_HANDLE handle, sb_t_par **const par)
Retrieves the project parameters structure.
Project parameters.
Definition: sb.h:11797

or:

sb_t_par* par = NULL;
// Memory allocation for the project parameters structure
par = (sb_t_par*) malloc(sizeof(*par));
// Get project parameters structure.
sb_project_get_par(project_handle, &par);
//Free project parameters structure
free(par);

should be modified as:

sb_t_par* par = NULL;
// Get project parameters structure, the function allocates the structure
sb_project_get_par(project_handle, &par);
//Destroy project parameters structure
sb_t_err sb_par_destroy(sb_t_par **const par)
Destroys the project parameters structure.

Migrate from version 1.12.x to version 1.13.x

No source code migration on the main functions is necessary to move from version 1.12.x to version 1.13.x.

Migrate from version 1.11.x to version 1.12.x

No source code migration on the main functions is necessary to move from version 1.11.x to version 1.12.x.

Migrate from version 1.10.x to version 1.11.x

No source code migration on the main functions is necessary to move from version 1.10.x to version 1.11.x.

Migrate from version 1.9.x to version 1.10.x

Load a project

The source code to load a project in version 1.9.x:

SB_HANDLE project = NULL;
sb_t_solution_info* solution = NULL;
// Get the solution information.
sb_solution_get_info("../images/wheels." SB_SOLUTION_EXT, &solution);
// Load the project from solution file.
sb_project_load(&project, "test.rprj", solution->projects.info[solution->current_project].uuid, SB_PROJECT_LOAD_DETECTION_ONLY);
void * SB_HANDLE
HANDLE definition.
Definition: sb.h:6766
sb_t_err sb_project_load(SB_HANDLE *phandle, const char *const solution_file, const char *const project_uuid, sb_t_project_mode mode)
Loads an existing project from a solution file.
sb_t_err sb_solution_get_info(const char *const solution_file, sb_t_solution_info **const solution)
Returns the information contained in the solution_file.
#define SB_SOLUTION_EXT
Extension of the SqueezeBrains solution file.
Definition: sb.h:9721
sb_t_err sb_solution_destroy_info(sb_t_solution_info **const solution)
Destroys the structure of the solution information.
char uuid[SB_PROJECT_UUID_LEN]
Project UUID.
Definition: sb.h:9697
sb_t_project_info * info
Array of solution project information.
Definition: sb.h:9707
Solution info structure.
Definition: sb.h:9727
sb_t_projects_info projects
Array of the projects info.
Definition: sb.h:9728
int current_project
Index of the current project in the projects array.
Definition: sb.h:9729

should be modified as:

SB_HANDLE project = NULL;
sb_t_solution_info* solution = NULL;
// Get the solution information.
sb_solution_get_info("../images/wheels." SB_SOLUTION_EXT, &solution);
// Load the project from solution file.
sb_project_load(&project, "test.rprj", solution->projects.info[solution->current_project].uuid, SB_PROJECT_MODE_DETECTION_ONLY);
@ SB_PROJECT_MODE_DETECTION_ONLY
Load/save the minimum module information to allow detection.
Definition: sb.h:9822

Save a project

The source code to save a project in version 1.9.x:

// Save the project into the solution file.
sb_project_save(project, "solution.rprj");
sb_t_err sb_project_save(SB_HANDLE handle, const char *const solution_file, sb_t_project_mode mode)
Saves the project to file.

should be modified as:

// Save the project into the solution file.
@ SB_PROJECT_MODE_DETECTION_AND_SVL
Load/save all the module information.
Definition: sb.h:9823

Migrate from version 1.8.x to version 1.9.x

Load a project

The source code to load a project in version 1.8.x:

SB_HANDLE project = NULL;
sb_project_load(&project, "test.rprj", NULL, SB_PROJECT_TYPE_RETINA, SB_PROJECT_LOAD_DETECTION_ONLY);
@ SB_PROJECT_TYPE_RETINA
Project Retina.
Definition: sb.h:9670

should be modified as:

SB_HANDLE project = NULL;
sb_t_solution_info* solution = NULL;
// Get the solution information.
sb_solution_get_info("../images/wheels." SB_SOLUTION_EXT, &solution);
// Load the project from solution file.
sb_project_load(&project, "test.rprj", solution->projects.info[solution->current_project].uuid, SB_PROJECT_LOAD_DETECTION_ONLY);

Migrate from version 1.7.x to version 1.8.x

To load a Retina project

The source code to load a Retina project in version 1.7.x:

SB_HANDLE project = NULL;
sb_retina_load(&project, "test.rprj", NULL);

should be modified as:

SB_HANDLE project = NULL;
sb_project_load(&project, "test.rprj", NULL, SB_PROJECT_TYPE_RETINA, SB_PROJECT_LOAD_DETECTION_ONLY);

To load a Surface project

The source code to load a Surface project in version 1.7.x:

SB_HANDLE project = NULL;
sb_surface_load(&project, "test.rprj", NULL);

should be modified as:

SB_HANDLE project = NULL;
sb_project_load(&project, "test.rprj", NULL, SB_PROJECT_TYPE_SURFACE, SB_PROJECT_LOAD_DETECTION_ONLY);
@ SB_PROJECT_TYPE_SURFACE
Project Surface.
Definition: sb.h:9671