LICK
 All Data Structures Files Functions Variables Enumerations Enumerator
Functions
id-utils.h File Reference

Handle and generate names and IDs. More...

#include "../lickdir.h"
Include dependency graph for id-utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int is_valid_id (const char *id, lickdir_t *lick, const char *install_path)
 determine if the given ID is valid More...
 
char * gen_id (const char *iso, lickdir_t *lick, const char *install_path)
 generate a valid ID from an ISO path More...
 
char * gen_name (const char *iso)
 generate a human-readable name from an ISO path More...
 

Detailed Description

Handle and generate names and IDs.

Function Documentation

char* gen_id ( const char *  iso,
lickdir_t lick,
const char *  install_path 
)

generate a valid ID from an ISO path

Given an ISO path name, takes the base name of the ISO without the .iso extension, then converts any invalid characters to dashes. If this ID is used, appends a number, from 2 to 100. If a valid ID has still not been found, returns NULL.

Parameters
isothe ISO path
lickthe lick directory
install_paththe drive or path to install under
Returns
an ID, or NULL if a valid ID could not be created
char* gen_name ( const char *  iso)

generate a human-readable name from an ISO path

Given an ISO path name, takes the base name of the ISO without the .iso extension, then converts any dashes and underscores to spaces.

Parameters
isothe ISO path
Returns
a human-readable name
int is_valid_id ( const char *  id,
lickdir_t lick,
const char *  install_path 
)

determine if the given ID is valid

Parameters
idthe ID to check
lickthe lick directory
install_paththe drive or path to install under
Returns
1 if the ID is valid; 0 if it is not valid