bglibs: instlib: Installation program generation

- Main Page
- Modules
- Data Structures
- Files
- Directories
- Related Pages
- Examples

# instlib: Installation program generation

## Functions
int | opendir (const char *dir)
int | opensubdir (int dir, const char *subdir)
int | d (int dir, const char *subdir, unsigned uid, unsigned gid, unsigned mode)
void | cf (int dir, const char *file, unsigned uid, unsigned gid, unsigned mode, const char *srcfile)
void | c (int dir, const char *file, unsigned uid, unsigned gid, unsigned mode)
void | s (int dir, const char *file, const char *target)
void | insthier (void)
## Variables
const char * | install_prefix

## Detailed Description

The installer libraries provide for building a program to install files, to verify (check) an installation, and to show what would be installed, from a single source. This single source is typically called `insthier.c` and contains a single routine also named `insthier` (so-named as it provides the installation hierarchy). The libraries provide the `main` function that calls `insthier` as well as all the necessary support functions.

Where given, `uid` and `gid` may be set to `-1` if there is no need to force the installed UID and GID to a particular value. The `dir` argument is a directory number previously opened by `opendir`.

## Function Documentation

void c | ( | int | dir,
|  | const char * | file,
|  | unsigned | uid,
|  | unsigned | gid,
|  | unsigned | mode |
| ) |  |  |

Copy a file from the source directory, retaining its name.

void cf | ( | int | dir,
|  | const char * | file,
|  | unsigned | uid,
|  | unsigned | gid,
|  | unsigned | mode,
|  | const char * | srcfile |
| ) |  |  |

Copy a file from the source directory to a different name.

int d | ( | int | dir,
|  | const char * | subdir,
|  | unsigned | uid,
|  | unsigned | gid,
|  | unsigned | mode |
| ) |  |  |

Create a subdirectory.

void insthier | ( | void |  | ) |

The single function that the `insthier.c` source needs to define.

int opendir | ( | const char * | dir | ) |

Open a directory and provide a file handle reference for future operations.

int opensubdir | ( | int | dir,
|  | const char * | subdir |
| ) |  |  |

Open a subdirectory of a directory already opened by `opendir`.

void s | ( | int | dir,
|  | const char * | file,
|  | const char * | target |
| ) |  |  |

Create a symbolic link.

## Variable Documentation

const char* install_prefix

The directory prefix under which all files are placed.