67 lines
1.3 KiB
C
67 lines
1.3 KiB
C
#ifndef __HF__HYDROFORTH_H__
|
|
#define __HF__HYDROFORTH_H__
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#define HF__VERSION "0.1.0"
|
|
|
|
/**
|
|
* @brief Checks if specific bit at position it set to 1
|
|
*
|
|
*/
|
|
#define HF__CHECK_BIT(var, pos) ((var) & (1 << (pos)))
|
|
|
|
/**
|
|
* @brief Checks if char is a space- or tab-like
|
|
*
|
|
* @param c
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
extern bool hf__is_space_like(const char c);
|
|
|
|
/**
|
|
* @brief Checks if a char is a decimal numeric (0-9)
|
|
*
|
|
* @param c
|
|
* @return true
|
|
* @return false
|
|
*/
|
|
extern bool hf__is_numeric(const char c);
|
|
|
|
/**
|
|
* @brief Quotes a string with either single or double quotes. Returned string
|
|
* needs to be freed.
|
|
*
|
|
* @param str
|
|
* @param double_quote
|
|
* @return char*
|
|
*/
|
|
extern char *hf__quote(const char *const str, const bool double_quote);
|
|
|
|
/**
|
|
* @brief Quotes a string inside a slice of memory with either single or double
|
|
* quotes. Returned string needs to be freed.
|
|
*
|
|
* @param src
|
|
* @param start
|
|
* @param end
|
|
* @param double_quote
|
|
* @return char*
|
|
*/
|
|
extern char *hf__quote_mem_str(const char *const src, const size_t start,
|
|
const size_t end, const bool double_quote);
|
|
|
|
#include "hash.h"
|
|
#include "hashmap.h"
|
|
#include "interpreter.h"
|
|
#include "keywords.h"
|
|
#include "lexer.h"
|
|
#include "location.h"
|
|
#include "parser.h"
|
|
#include "result.h"
|
|
|
|
#endif
|