You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
naka/include/project.h

42 lines
1.2 KiB

//! Re-exports Makefile defines as more usable types
#ifndef _PROJECT_H
#define _PROJECT_H
#include "macros.h"
#include "ints.h"
#include "version.h"
/// Project version, as a raw version identifier (u32).
/// Use `v_rawtoc()` to convert to `version_t`.
#define PROG_VERSION VERSION(_VERSION_MAJOR, \
_VERSION_MINOR, \
_VERSION_BUGFIX, \
_VERSION_REVISION)
/// Project name. Output binary name
#define PROG_NAME _PROJECT_NAME
/// Project description
#define PROG_DESCRIPTION _PROJECT_DESCRIPTION
/// Project authour(s)
#define PROG_AUTHOUR _PROJECT_AUTHOR
/// Project license
#define PROG_LICENSE _PROJECT_LICENSE
/// Compiled time (UTC unix timestamp)
#define PROG_COMPILED_TIMESTAMP AS(_PROJECT_COMPILED, u64)
// Returns from the program
// Invalid arguments to program (print usage to stderr)
#define PROG_RET_ARGS 1
// Mapping of argv[1] failed
#define PROG_RET_MAP_NEEDLE_FAILED 2
// `h` is the number in argv[] of the haystack file
#define PROG_RET_MAP_HAYSTACK_N_FAILED(h) ((h) << 2)
// `h` is the number in argv[] of the haystack file
#define PROG_RET_UNMAP_HAYSTACK_N_FAILED(h) (((h) << 2) | 1)
// Unmapping of argv[1] failed
#define PROG_RET_UNMAP_NEEDLE_FAILED 3
#endif /* _PROJECT_H */