~ecs/hare-mrsh

a8c0536e410cb93e88793470b950dffe9ac8ce64 — Ember Sawady 10 months ago e1b3f1f
opaque
4 files changed, 13 insertions(+), 13 deletions(-)

M mrsh/array.ha
M mrsh/ast.ha
M mrsh/hashtable.ha
M mrsh/parser.ha
M mrsh/array.ha => mrsh/array.ha +2 -2
@@ 1,11 1,11 @@
use types::c;

export type array = struct {
	data: **void,
	data: **opaque,
	length: size,
	capacity: size,
};

export @symbol("mrsh_array_reserve") fn array_reserve(array: *array, sz: size) bool;
export @symbol("mrsh_array_add") fn array_add(array: *array, value: *void) c::ssize;
export @symbol("mrsh_array_add") fn array_add(array: *array, value: *opaque) c::ssize;
export @symbol("mrsh_array_finish") fn array_finish(array: *array) void;

M mrsh/ast.ha => mrsh/ast.ha +2 -2
@@ 281,7 281,7 @@ export type program = struct {
	body: array,
};

export type node_iterator_func = *fn(node: *node, user_data: *void) void;
export type node_iterator_func = *fn(node: *node, user_data: *opaque) void;

export @symbol("mrsh_position_valid") fn position_valid(pos: *const position) bool;
export @symbol("mrsh_range_valid") fn range_valid(range: *const range) bool;


@@ 337,7 337,7 @@ export @symbol("mrsh_command_get_function_definition") fn command_get_function_d
export @symbol("mrsh_and_or_list_get_pipeline") fn and_or_list_get_pipeline(and_or_list: *const and_or_list) *pipeline;
export @symbol("mrsh_and_or_list_get_binop") fn and_or_list_get_binop(and_or_list: *const and_or_list) *binop;

export @symbol("mrsh_node_for_each") fn node_for_each(node: *node, iterator: node_iterator_func, user_data: *void) void;
export @symbol("mrsh_node_for_each") fn node_for_each(node: *node, iterator: node_iterator_func, user_data: *opaque) void;

export @symbol("mrsh_word_range") fn word_range(word: *word, begin: *position, end: *position) void;
export @symbol("mrsh_command_range") fn command_range(cmd: *command, begin: *position, end: *position) void;

M mrsh/hashtable.ha => mrsh/hashtable.ha +6 -6
@@ 6,17 6,17 @@ export type hashtable_entry = struct {
	next: *hashtable_entry,
	hash: uint,
	key: *c::char,
	value: *void,
	value: *opaque,
};

export type hashtable = struct {
	buckets: [HASHTABLE_BUCKETS]*hashtable_entry,
};

export type hashtable_iterator_func = *fn(key: *const c::char, value: *void, user_data: *void) void;
export type hashtable_iterator_func = *fn(key: *const c::char, value: *opaque, user_data: *opaque) void;

export @symbol("mrsh_hashtable_finish") fn hashtable_finish(table: *hashtable) void;
export @symbol("mrsh_hashtable_get") fn hashtable_get(table: *hashtable, key: *const c::char) *void;
export @symbol("mrsh_hashtable_set") fn hashtable_set(table: *hashtable, key: *const c::char, value: *void) *void;
export @symbol("mrsh_hashtable_del") fn hashtable_del(table: *hashtable, key: *const c::char) *void;
export @symbol("mrsh_hashtable_for_each") fn hashtable_for_each(table: *hashtable, iterator: hashtable_iterator_func, user_data: *void) void;
export @symbol("mrsh_hashtable_get") fn hashtable_get(table: *hashtable, key: *const c::char) *opaque;
export @symbol("mrsh_hashtable_set") fn hashtable_set(table: *hashtable, key: *const c::char, value: *opaque) *opaque;
export @symbol("mrsh_hashtable_del") fn hashtable_del(table: *hashtable, key: *const c::char) *opaque;
export @symbol("mrsh_hashtable_for_each") fn hashtable_for_each(table: *hashtable, iterator: hashtable_iterator_func, user_data: *opaque) void;

M mrsh/parser.ha => mrsh/parser.ha +3 -3
@@ 1,8 1,8 @@
use types::c;

export type parser = void; // opaque
export type parser = opaque;

export type parser_alias_func = *fn(name: *const c::char, user_data: *void) *const c::char;
export type parser_alias_func = *fn(name: *const c::char, user_data: *opaque) *const c::char;

export @symbol("mrsh_parser_with_fd") fn parser_with_fd(fd: int) *parser;
export @symbol("mrsh_parser_with_data") fn parser_with_data(buf: *const c::char, length: size) *parser;


@@ 13,7 13,7 @@ export @symbol("mrsh_parse_line") fn parse_line(parser: *parser) nullable *progr

export @symbol("mrsh_parse_arithm_expr") fn parse_arithm_expr(parser: *parser) *arithm_expr;
export @symbol("mrsh_parser_eof") fn parser_eof(parser: *parser) bool;
export @symbol("mrsh_parser_set_alias_func") fn parser_set_alias_func(parser: *parser, alias: parser_alias_func, user_data: *void) void;
export @symbol("mrsh_parser_set_alias_func") fn parser_set_alias_func(parser: *parser, alias: parser_alias_func, user_data: *opaque) void;
export @symbol("mrsh_parser_error") fn parser_error(parser: *parser, pos: *position) nullable *const c::char;
export @symbol("mrsh_parser_continuation_line") fn parser_continuation_line(parser: *parser) bool;
export @symbol("mrsh_parser_reset") fn parser_reset(parser: *parser) void;