Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some refactors to main.c #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Some refactors to main.c #15

wants to merge 2 commits into from

Conversation

Slayer95
Copy link
Contributor

@Slayer95 Slayer95 commented Mar 16, 2025

I'm currently working on several features(*) I intend to PR. These refactors are meant to simplify their diffs.

(*) Features:

  1. Eagerly exit / fail fast on first error found (flag +ff?)
  2. Flag to disable dynamic toggling of flags from parsed code (flag +???)
  3. Static build including the following APIs, supporting
    3.1. Parse in-memory buffer(s).
    3.2. Output to a buffer instead of stdout.
// Parse an in-memory buffer
int _cdecl parse_jass(char *output, const int n_max_out_size, int *n_out_size, const char* target, const int target_size);

// Parse in-memory buffers for common.j, Blizzard.j, war3map.j
int _cdecl parse_jass_triad(char *output, const int n_max_out_size, int *n_out_size, const char* buf_common, const int size_common, const char* buf_blizz, const int size_blizz, const char* buf_script, const int size_script);

// Versatile function to parse inputs as if they were passed to latest ``pjass`` binary. (``doparse`` can be refactored to use it.)
int _cdecl parse_jass_custom_r(char *output, const int n_max_out_size, int *n_out_size, const int targets_or_opts_count, const char **targets_or_opts);

// Versatile function to parse inputs with fine-grained control over each file/buffer's flags. (This is my main use case.)
int _cdecl parse_jass_custom(char *output, const int n_max_out_size, int *n_out_size, const int targets_count, const int *targets_sizes, const char **targets, const char **flags);

Do let me know if you find some of these features/APIs useless or w.e.

(cherry picked from commit 13cf484b86d533e0bdaec9ba3cc484baebc3ffe9)
(cherry picked from commit 007d6b6d4462eb1def16ed1de5494d1c2afbd7d1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant