sjef
Functions
sjef-c.h File Reference

Go to the source code of this file.

Functions

int sjef_project_open (const char *project)
 
void sjef_project_close (const char *project)
 
int sjef_project_copy (const char *project, const char *destination_filename, int keep_hash, int keep_run_directories)
 
int sjef_project_move (const char *project, const char *destination_filename)
 
void sjef_project_erase (const char *project)
 
void sjef_project_property_erase (const char *project)
 
void sjef_project_clean (const char *project, int keep_run_directories)
 
int sjef_project_import (const char *project, const char *file)
 
int sjef_project_export (const char *project, const char *file)
 
int sjef_project_run_needed (const char *project)
 
int sjef_project_synchronize (const char *project, const char *backend, int verbosity)
 
int sjef_project_run (const char *project, const char *backend, int verbosity, int force, int wait)
 
int sjef_project_status (const char *project, int verbosity)
 
const char * sjef_project_status_message (const char *project, int verbosity)
 
int sjef_project_status_initiate (const char *project, int verbosity)
 
void sjef_project_kill (const char *project)
 
void sjef_project_property_set (const char *project, const char *key, const char *value)
 
void sjef_project_properties_set (const char *project, const char **key, const char **value)
 
char * sjef_project_property_get (const char *project, const char *key)
 
char ** sjef_project_properties_get (const char *project, const char **key)
 
void sjef_project_property_delete (const char *project, const char *key)
 
char * sjef_project_filename (const char *project)
 
const char * sjef_project_backend_cache (const char *project)
 
char * sjef_project_filename_general (const char *project, const char *suffix, const char *name, int run)
 Get the file name of the bundle, or a primary file of particular type, or a general file in the bundle. More...
 
char * sjef_project_name (const char *project)
 
size_t sjef_project_project_hash (const char *project)
 
size_t sjef_project_input_hash (const char *project)
 
int sjef_project_recent_find (const char *filename)
 
char * sjef_project_recent (int number, const char *suffix)
 
int sjef_project_change_backend (const char *project, const char *backend)
 
char * sjef_project_backend_parameter_get (const char *project, const char *backend, const char *parameter)
 
char * sjef_project_backend_parameter_expand (const char *project, const char *backend, const char *templ)
 
void sjef_project_backend_parameter_set (const char *project, const char *backend, const char *parameter, const char *value)
 
void sjef_project_backend_parameter_delete (const char *project, const char *backend, const char *parameter)
 
char ** sjef_project_backend_parameters (const char *project, const char *backend, int def)
 Get all of the parameters referenced in the run_command of a backend. More...
 
char ** sjef_project_backend_names (const char *project)
 
char * sjef_expand_path (const char *path, const char *default_suffix)
 
char ** sjef_backend_keys ()
 Obtain a list of the names of the defined fields in a sjef::Backend. More...
 
char * sjef_backend_value (const char *project, const char *backend, const char *key)
 Obtain the value of a defined field in a backend belonging to a project. More...
 
char * sjef_project_backend_parameter_documentation (const char *project, const char *backend, const char *parameter)
 
char * sjef_project_run_directory (const char *project, int run)
 Obtain the path of a run directory. More...
 
void sjef_project_run_delete (const char *project, int run)
 Delete a run directory. More...
 
void sjef_project_take_run_files (const char *project, int run, const char *fromname, const char *toname)
 Copy files from a run directory to the main project. More...
 
void sjef_project_set_current_run (const char *project, unsigned int run)
 Set the focussed run directory. More...
 
unsigned int sjef_project_current_run (const char *project)
 Get the focussed run directory. More...
 

Function Documentation

◆ sjef_backend_keys()

char** sjef_backend_keys ( )

Obtain a list of the names of the defined fields in a sjef::Backend.

Returns
null-terminated list of pointers to malloc-allocated key names

◆ sjef_backend_value()

char* sjef_backend_value ( const char *  project,
const char *  backend,
const char *  key 
)

Obtain the value of a defined field in a backend belonging to a project.

Parameters
projectThe project.
backendThe backend. If empty string or null, the default backend is assumed
keyThe field required
Returns
malloc-allocated value. If the backend does not exist, or if key is not valid, a null pointer is returned.

◆ sjef_expand_path()

char* sjef_expand_path ( const char *  path,
const char *  default_suffix 
)

◆ sjef_project_backend_cache()

const char* sjef_project_backend_cache ( const char *  project)

◆ sjef_project_backend_names()

char** sjef_project_backend_names ( const char *  project)

◆ sjef_project_backend_parameter_delete()

void sjef_project_backend_parameter_delete ( const char *  project,
const char *  backend,
const char *  parameter 
)

◆ sjef_project_backend_parameter_documentation()

char* sjef_project_backend_parameter_documentation ( const char *  project,
const char *  backend,
const char *  parameter 
)

◆ sjef_project_backend_parameter_expand()

char* sjef_project_backend_parameter_expand ( const char *  project,
const char *  backend,
const char *  templ 
)

◆ sjef_project_backend_parameter_get()

char* sjef_project_backend_parameter_get ( const char *  project,
const char *  backend,
const char *  parameter 
)

◆ sjef_project_backend_parameter_set()

void sjef_project_backend_parameter_set ( const char *  project,
const char *  backend,
const char *  parameter,
const char *  value 
)

◆ sjef_project_backend_parameters()

char** sjef_project_backend_parameters ( const char *  project,
const char *  backend,
int  def 
)

Get all of the parameters referenced in the run_command of a backend.

Parameters
projectThe name of the project
backendThe name of the backend
defIf zero, return the parameter names, otherwise the default values.
Returns

◆ sjef_project_change_backend()

int sjef_project_change_backend ( const char *  project,
const char *  backend 
)

◆ sjef_project_clean()

void sjef_project_clean ( const char *  project,
int  keep_run_directories 
)

◆ sjef_project_close()

void sjef_project_close ( const char *  project)

◆ sjef_project_copy()

int sjef_project_copy ( const char *  project,
const char *  destination_filename,
int  keep_hash,
int  keep_run_directories 
)

◆ sjef_project_current_run()

unsigned int sjef_project_current_run ( const char *  project)

Get the focussed run directory.

Parameters
project
Returns

◆ sjef_project_erase()

void sjef_project_erase ( const char *  project)

◆ sjef_project_export()

int sjef_project_export ( const char *  project,
const char *  file 
)

◆ sjef_project_filename()

char* sjef_project_filename ( const char *  project)

◆ sjef_project_filename_general()

char* sjef_project_filename_general ( const char *  project,
const char *  suffix,
const char *  name,
int  run 
)

Get the file name of the bundle, or a primary file of particular type, or a general file in the bundle.

Parameters
projectThe project
suffixIf present without name, look for a primary file with that type. If absent, the file name of the bundle is instead selected
nameIf present, look for a file of this name, appended with .suffix if that is non-blank
runIf specified, look in a run directory for the file, instead of the main project directory. A value of 0 is interpreted as the most recent run directory.
Returns
the fully-qualified name of the file

◆ sjef_project_import()

int sjef_project_import ( const char *  project,
const char *  file 
)

◆ sjef_project_input_hash()

size_t sjef_project_input_hash ( const char *  project)

◆ sjef_project_kill()

void sjef_project_kill ( const char *  project)

◆ sjef_project_move()

int sjef_project_move ( const char *  project,
const char *  destination_filename 
)

◆ sjef_project_name()

char* sjef_project_name ( const char *  project)

◆ sjef_project_open()

int sjef_project_open ( const char *  project)

◆ sjef_project_project_hash()

size_t sjef_project_project_hash ( const char *  project)

◆ sjef_project_properties_get()

char** sjef_project_properties_get ( const char *  project,
const char **  key 
)

◆ sjef_project_properties_set()

void sjef_project_properties_set ( const char *  project,
const char **  key,
const char **  value 
)

◆ sjef_project_property_delete()

void sjef_project_property_delete ( const char *  project,
const char *  key 
)

◆ sjef_project_property_erase()

void sjef_project_property_erase ( const char *  project)

◆ sjef_project_property_get()

char* sjef_project_property_get ( const char *  project,
const char *  key 
)

◆ sjef_project_property_set()

void sjef_project_property_set ( const char *  project,
const char *  key,
const char *  value 
)

◆ sjef_project_recent()

char* sjef_project_recent ( int  number,
const char *  suffix 
)

◆ sjef_project_recent_find()

int sjef_project_recent_find ( const char *  filename)

◆ sjef_project_run()

int sjef_project_run ( const char *  project,
const char *  backend,
int  verbosity,
int  force,
int  wait 
)

◆ sjef_project_run_delete()

void sjef_project_run_delete ( const char *  project,
int  run 
)

Delete a run directory.

Parameters
projectThe project
run

◆ sjef_project_run_directory()

char* sjef_project_run_directory ( const char *  project,
int  run 
)

Obtain the path of a run directory.

Parameters
projectThe project
run
  • 0: the most recent run directory
  • other: the specified run directory
Returns
the fully-qualified name of the directory

◆ sjef_project_run_needed()

int sjef_project_run_needed ( const char *  project)

◆ sjef_project_set_current_run()

void sjef_project_set_current_run ( const char *  project,
unsigned int  run 
)

Set the focussed run directory.

Parameters
project
runThe index of an existing run directory, a positive integer, or zero, indicating that the focus is on the most recent run directory

◆ sjef_project_status()

int sjef_project_status ( const char *  project,
int  verbosity 
)

◆ sjef_project_status_initiate()

int sjef_project_status_initiate ( const char *  project,
int  verbosity 
)

◆ sjef_project_status_message()

const char* sjef_project_status_message ( const char *  project,
int  verbosity 
)

◆ sjef_project_synchronize()

int sjef_project_synchronize ( const char *  project,
const char *  backend,
int  verbosity 
)

◆ sjef_project_take_run_files()

void sjef_project_take_run_files ( const char *  project,
int  run,
const char *  fromname,
const char *  toname 
)

Copy files from a run directory to the main project.

Parameters
projectThe project
runSpecifies the run to use as source, with 0 meaning the most recent.
fromnameThe file to copy.
tonameThe destination, defaulting to fromname.