Rootbeer API

This header defines all of the publicly accessible APIs for Rootbeer plugins. These can be called within a native Rootbeer plugin to interact with the core Rootbeer revision system. See src/plugins/rootbeer_core for an example of a plugin.

Defines

RB_OK

The return code for a successful operation.

RB_ULIMIT_EXTFILES

The return code when the maximum external files limit is reached.

RB_ULIMIT_TRANSFORMS

The return code when the maximum plugin transforms limit is reached.

RB_ENOENT

The return code when a file or directory does not exist.

RB_EACCES

Functions

int rb_track_ref_file(rb_ctx_t *ctx, const char *path)

Registers the provided filepath as a reference file. Reference files are kept track of as “imported” files in the revision system. For example, rb.link_file() uses this to track the source files for links.

Parameters:
  • ctx – The Lua context to track the file in.

  • path – The ABSOLUTE path to the file to track.

Returns:

0 on success, or a negative error code on failure. TODO: Make this use absolute paths instead of relative paths.

int rb_track_gen_file(rb_ctx_t *ctx, const char *path)

Registers the provided filepath as a generated file. Generated files are those that are created by a plugin at runtime. For example, rb.link_file() uses this to track destination files for links.

Parameters:
  • ctx – The Lua context to track the file in.

  • path – The ABSOLUTE path to the file to track.

Returns:

0 on success, or a negative error code on failure.