This documenta- tion describes the current state of development.
Note that interfaces and functionality may still change.

Prokee Modules:
  A
  B
  C
  D
  E
  F
  G
  I
  L
  M
  N
  O
  P
  R
  S
  T
  U
  W

     open all    |    close all

GUI Elements:
  B
  C
  I
  M
  P
  R
  S
  T

     open all    |    close all

GUI Interactions:
  B
  F
  H
  S

     open all    |    close all

GUI Layouts:
  L

     open all    |    close all

Games/Demos:
  M

     open all    |    close all

Third Party Libraries:
  P
  F
  Z

     open all    |    close all

Information about this Website / Informationen zu dieser Webseite:
In case of any questions, or comments, please feel free to contact me via email at apoll500@gmail.com.

Module bmsetup [Version: v01]

This documentation describes the Prokee module interface.


Functions:
bmsetup_run_script
int bmsetup_run_script(const char *baseman_project_path,const char *package_path,const char *run_token)
bmsetup_run_script2
int bmsetup_run_script2(const char *baseman_project_path,const char *package_path,const char *run_token,const char *username,const char *userpass)
bmsetup_download
int bmsetup_download(const char *baseman_project_path,const char *package_path,bool update)
bmsetup_download2
int bmsetup_download2(const char *baseman_project_path,const char *package_path,bool update,const char *username,const char *userpass)
bmsetup_exporter
int bmsetup_exporter()
bmsetup_importer
int bmsetup_importer()
bmsetup_exporter2
int bmsetup_exporter2(const char *baseman_project_path)
bmsetup_importer2
int bmsetup_importer2(const char *baseman_project_path)
bmsetup_import_info
int bmsetup_import_info(const char *infopath)
bmsetup_export_projects
int bmsetup_export_projects(const char *csvpath)
bmsetup_export_versions
int bmsetup_export_versions(const char *csvpath)
bmsetup_get_all_paths
char **bmsetup_get_all_paths(const char *baseman_project_path,char **base_path,char **project_path,char **version_path)
bmsetup_construct_package_path
char *bmsetup_construct_package_path(const char *baseman_project_path,const char *package_path,const char *append)
bmsetup_install
int bmsetup_install(const char *baseman_project_path,const char *package_path,bool dotar)
bmsetup_publish
int bmsetup_publish(const char *baseman_project_path,const char *publish_path,bool dotar)
bmsetup_get_base_path
char *bmsetup_get_base_path(const char *base_name)

Static Methods:
main
int bmsetup::main(int argc,char **argv)

Motivation

The module bmsetup provides extended functionality for baseman to download, install and publish prokee modules.


Functions

   bmsetup_run_script


Runs a script.

The function runs the following command:

bmsetup_run_token.sh package_path unique_package_name

(Where unique_package_name is constructed from the baseman_project_path.)

Signature:
int bmsetup_run_script(const char *baseman_project_path,const char *package_path,const char *run_token)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
const char *package_path[IN]The path to the directory, where downloaded software packages are stored.
const char *run_token[IN]Specifies the script to be executed. The function executes the file bmsetup_run_token.sh.
The script files should be placed at /usr/local/bin/ or any other directory on the path. Or at the path specified by BMSETUP_INSTALLATION_PATH.

Return value:
Returns 0.

Remarks:
Mind that there are no security checks, on the content of the parameters. A program must not allow any other (potentially malicious) software or user, to execute this function or alter the strings provided as parameters.

   bmsetup_run_script2


Runs a script.

The function runs the following command:

bmsetup_run_token.sh package_path unique_package_name b64_username b64_userpass

(Where unique_package_name is constructed from the baseman_project_path.)

Signature:
int bmsetup_run_script2(const char *baseman_project_path,const char *package_path,const char *run_token,const char *username,const char *userpass)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
const char *package_path[IN]The path to the directory, where downloaded software packages are stored.
const char *run_token[IN]Specifies the script to be executed. The function executes the file bmsetup_run_token.sh.
The script files should be placed at /usr/local/bin/ or any other directory on the path. Or at the path specified by BMSETUP_INSTALLATION_PATH.
const char *username[IN]Username.
const char *userpass[IN]Password.

Return value:
Returns 0.

Remarks:
Mind that there are no security checks, on the content of the parameters. A program must not allow any other (potentially malicious) software or user, to execute this function or alter the strings provided as parameters.

   bmsetup_download


Downloads a software package.

The function executes the download script bmsetup_download.sh.

Signature:
int bmsetup_download(const char *baseman_project_path,const char *package_path,bool update)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
const char *package_path[IN]The path to the directory, where downloaded software packages are stored.
bool updateSpecifies, wheter a already downloaded package should be deleted and re-downloaded.

Return value:
Returns 0 if successful and a value other than 0 if not.

Remarks:
Mind that there are no security checks, on the content of the parameters. A program must not allow any other (potentially malicious) software or user, to execute this function or alter the strings provided as parameters.

   bmsetup_download2


Downloads a software package.

The function executes the download script bmsetup_download2.sh.

Signature:
int bmsetup_download2(const char *baseman_project_path,const char *package_path,bool update,const char *username,const char *userpass)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
const char *package_path[IN]The path to the directory, where downloaded software packages are stored.
bool updateSpecifies, wheter a already downloaded package should be deleted and re-downloaded.
const char *username[IN]Username.
const char *userpass[IN]Password.

Return value:
Returns 0 if successful and a value other than 0 if not.

Remarks:
Mind that there are no security checks, on the content of the parameters. A program must not allow any other (potentially malicious) software or user, to execute this function or alter the strings provided as parameters.

   bmsetup_exporter


Runs cfg-export for the current directory and all subdirectories.

Signature:
int bmsetup_exporter()

Return value:
Returns 0.

   bmsetup_importer


Runs cfg-import for the current directory and all subdirectories.

Signature:
int bmsetup_importer()

Return value:
Returns 0.

   bmsetup_exporter2


Runs cfg-export for the project given by baseman_project_path.

Signature:
int bmsetup_exporter2(const char *baseman_project_path)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.

Return value:
Returns 0.

   bmsetup_importer2


Runs cfg-import for the project given by baseman_project_path.

Signature:
int bmsetup_importer2(const char *baseman_project_path)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.

Return value:
Returns 0.

   bmsetup_import_info


Reads settings from the file given by infopath and updates the related .csv files.

Signature:
int bmsetup_import_info(const char *infopath)

Parameters:
Type Name Direction Description
const char *infopath[IN]The path to the .info file.

Return value:
Returns 0 if successful and a value other than 0 if not.

   bmsetup_export_projects


Reads the records from the projects.csv file given by csvpath and creates the .info files.

Signature:
int bmsetup_export_projects(const char *csvpath)

Parameters:
Type Name Direction Description
const char *csvpath[IN]The path to a projects.csv file.

Return value:
Returns 0.

   bmsetup_export_versions


Reads the records from the versions.csv file given by csvpath and creates the .info files.

Signature:
int bmsetup_export_versions(const char *csvpath)

Parameters:
Type Name Direction Description
const char *csvpath[IN]The path to a versions.csv file.

Return value:
Returns 0.

   bmsetup_get_all_paths


Determines the file system paths to base, project and version of the baseman project given by baseman_project_path.

  1. The function determines the path to the base (base_path). If the base does not exist, than *base_path, *project_path and *version_path are set to NULL and the function returns.
  2. To construct the project path (project_path), the function searches for the project and subsequently for all sub-projects within project.csv files. The construction of the path ends as soon as a name within baseman_project_path does not match with an existing project (at a given location). In this case the name is considered to be the name of a version. If the first project name does not exist, project_path is set to the empty string.
  3. The path to the version is constructed the same way as the path to the project (by searching versions within versions.csv files). If any version or sub-version cannot be found within baseman, the function sets *version_path to NULL. If no version is given in baseman_project_path, *version_path is set to the empty string.


Signature:
char **bmsetup_get_all_paths(const char *baseman_project_path,char **base_path,char **project_path,char **version_path)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
char **base_path[OUT]Receives a pointer to the null-terminated file system path to the baseman base. (If the function fails, *base_path may be set to NULL.)
char **project_path[OUT]Receives a pointer to the null-terminated file system path to the baseman project. (If the function fails, *project_path may be set to NULL.)
char **version_path[OUT]Receives a pointer to the null-terminated file system path to the baseman version. (If the function fails, *version_path may be set to NULL.)

Return value:
Returns the baseman_project_path exploded by "/".

Remarks:
The application has to free the memory blocks *base_path, *project_path and *version_path.
The application also has to free memory blocks associated to the return value. Use strman::explode_free() to free this memory blocks.

   bmsetup_construct_package_path


Constructs the path to the package.

1) Occurrences of "/" within baseman_project_path are replaced by "--" to construct the package_filename.
2) The path to the package is constructed as follows: package_path + package_filename + append.

Signature:
char *bmsetup_construct_package_path(const char *baseman_project_path,const char *package_path,const char *append)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
const char *package_path[IN]The path to the directory, where downloaded software packages are stored.
const char *append[IN]A null-terminated string that will be appended to the constructed path. This can be used to append appropriate file extensions.

Return value:
Returns the path to the package.

Remarks:
The application has to free the returned memory block.

   bmsetup_install


Installs a software package.

Signature:
int bmsetup_install(const char *baseman_project_path,const char *package_path,bool dotar)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
const char *package_path[IN]The path to the directory, where downloaded software packages are stored.
bool dotarIf dotar is set to true, the function executes the unpack script bmsetup_unpack.sh.

Return value:
Returns 0.

Remarks:
Mind that there are no security checks, on the content of the parameters. A program must not allow any other (potentially malicious) software or user, to execute this function or alter the strings provided as parameters.

   bmsetup_publish


Creates a shareable software package.

Signature:
int bmsetup_publish(const char *baseman_project_path,const char *publish_path,bool dotar)

Parameters:
Type Name Direction Description
const char *baseman_project_path[IN]A valid path to a module within baseman. This path may differ from the path within the file system.
const char *publish_path[IN]The path to the directory, where downloaded software packages are stored.
bool dotarIf dotar is set to true, the function executes the pack script bmsetup_pack.sh.

Return value:
Returns 0.

Remarks:
Mind that there are no security checks, on the content of the parameters. A program must not allow any other (potentially malicious) software or user, to execute this function or alter the strings provided as parameters.

   bmsetup_get_base_path


Determines the path to the base base_name.

Signature:
char *bmsetup_get_base_path(const char *base_name)

Parameters:
Type Name Direction Description
const char *base_name[IN]The null-terminated name of an existing base within baseman.

Return value:
Returns the path to the base or NULL, if the base does not exist.

Remarks:
The application has to free the returned memory block.


Static Methods

   main


Runs bmsetup as if it would be called from the command-line.

See Commandline-Interface.

Signature:
int bmsetup::main(int argc,char **argv)

Parameters:
Type Name Direction Description
int argcThe number of command-line parameters.
char **argv[IN]The command-line parameters.

Return value:
Exit status. bmsetup always returns EXIT_SUCCESS(0).


Copyright © 2017 - 2019 by Andreas Pollhammer