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
{
15
ZP_OPT_INVALID__
= 0,
16
FUNCTIONARGZERO__
,
17
PATHDIRS__
,
18
POSIXBUILTINS__
,
19
SHINSTDIN__
,
20
SOURCETRACE__
,
21
ZP_OPT_COUNT__
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__
@ ZP_OPT_COUNT__
Definition:
zpmod_compat.h:21
SOURCETRACE__
@ SOURCETRACE__
Definition:
zpmod_compat.h:20
POSIXBUILTINS__
@ POSIXBUILTINS__
Definition:
zpmod_compat.h:18
PATHDIRS__
@ PATHDIRS__
Definition:
zpmod_compat.h:17
FUNCTIONARGZERO__
@ FUNCTIONARGZERO__
Definition:
zpmod_compat.h:16
ZP_OPT_INVALID__
@ ZP_OPT_INVALID__
Definition:
zpmod_compat.h:15
SHINSTDIN__
@ SHINSTDIN__
Definition:
zpmod_compat.h:19
zp_conv_opt
int zp_conv_opt(int zp_opt_num)
Convert a stable option enum to a runtime option index (sign-preserving).
Definition:
options.c:52
zp_setup_options_table
void zp_setup_options_table(void)
Populate runtime option indices for the stable enum table.
Definition:
options.c:37
src
include
zpmod_compat.h
Generated by
1.9.1