Dependencies and References

// dependencies

The following dependencies are a complete list of the components required to use the runic API. Runic assumes a UNIX compatible operating system (e.g.: Linux, BSD, macOS). At this time, there is no support for Windows. Attempting to run programs linked with runic without these dependencies is considered undefined behavior and will most likely result in a compiler error.

The list is as follows:

  • stdio.h - Console and System I/O
  • stdlib.h – System-level (entry/exit) operations
  • stdbool.h – Boolean type compatibility
  • stddef.h – Data type compatibility
  • stdint.h – Integer type compatibility
  • string.h – String and memory manipulation
  • fcntl.h – File control
  • unistd.h – Accessing system configuration
  • sys/stat.h – File status access
  • sys/mman.h – Memory mapping

// preprocessor statements

The following preprocessor statements allow code execution in a C++ environment and prevent redeclaration/duplication of symbols.

#ifndef RUNIC_H
#define RUNIC_H
#ifdef __cplusplus
        extern "C" {
#endif

The following statements are required to “bookend” the opening statements at the top of the header file.

// closing statements
#ifndef __cplusplus
        }
#endif
#endif /* runic.h */

// constants

There is one constant exposed to the user which can be used to perform safety checks. DEFAULT_ROOT defines the first legal memory location for any data after the file header. runic_obj_t’s which have offset`s with values less than :c:`DEFAULT_ROOT are effectively NULL and should be treated as such. Writing information below this memory location will corrupt the file.

#define DEFAULT_ROOT 0x15