44 lines
837 B
C
44 lines
837 B
C
/*
|
|
* Copyright (c) 2026, Mirocom Laboratories
|
|
* Provided under the BSD-3 clause
|
|
*
|
|
* Abstract:
|
|
* This header defines the quip state machine
|
|
* Author:
|
|
* Ian M. Moffett <ian@mirocom.org>
|
|
*/
|
|
|
|
#ifndef COMMON_STATE_H
|
|
#define COMMON_STATE_H 1
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
/*
|
|
* Represents the build state machine
|
|
*
|
|
* @in_fd: Input file descriptor of build file
|
|
* @line_num: Current line number
|
|
*/
|
|
struct quip_state {
|
|
int in_fd;
|
|
size_t line_num;
|
|
};
|
|
|
|
/*
|
|
* Initialize the quip state machine
|
|
*
|
|
* @build_file: Path to build file
|
|
* @state: State instance to initialize
|
|
*
|
|
* Returns zero on success
|
|
*/
|
|
int quip_state_init(const char *build_file, struct quip_state *state);
|
|
|
|
/*
|
|
* Destroy a quip state
|
|
*/
|
|
void quip_state_destroy(struct quip_state *state);
|
|
|
|
#endif /* !COMMON_STATE_H */
|