zpmod  b19981f
High-performance Zsh module for script optimization and filesystem helpers
zpmod_compat.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
2 #pragma once
3 
4 /* Stable-to-runtime option mapping for zsh variants */
5 void zp_setup_options_table(void);
6 int zp_conv_opt(int zp_opt_num);
7 
8 /*
9  * Minimal version-stable option identifiers (all suffixed with __) that
10  * zpmod uses. Keep this list minimal to avoid upstream enum collisions
11  * with vendor/zsh headers. Only add a new enumerator when it is referenced
12  * in C code or tests. Never mirror the full upstream option list here.
13  */
14 enum {
22 };
23 
24 /* Some upstream structs referenced via vendor headers rely on system types
25  * like time_t, dev_t, ino_t, struct timespec before they are declared via
26  * system headers. Ensure we include the standard headers early (without
27  * editing vendor files). */
28 #include <sys/types.h>
29 #include <time.h>
@ ZP_OPT_COUNT__
Definition: zpmod_compat.h:21
@ SOURCETRACE__
Definition: zpmod_compat.h:20
@ POSIXBUILTINS__
Definition: zpmod_compat.h:18
@ PATHDIRS__
Definition: zpmod_compat.h:17
@ FUNCTIONARGZERO__
Definition: zpmod_compat.h:16
@ ZP_OPT_INVALID__
Definition: zpmod_compat.h:15
@ SHINSTDIN__
Definition: zpmod_compat.h:19
int zp_conv_opt(int zp_opt_num)
Convert a stable option enum to a runtime option index (sign-preserving).
Definition: options.c:52
void zp_setup_options_table(void)
Populate runtime option indices for the stable enum table.
Definition: options.c:37