Move non-function declarations from .c files to *.internals.h headers#84
Merged
Conversation
Copilot
AI
changed the title
[WIP] Move non-function declarations to internal headers
Move non-function declarations from .c files to *.internals.h headers
Jun 15, 2026
There was a problem hiding this comment.
Pull request overview
This PR standardizes the placement of module-local declarations by moving non-function declarations (includes and static variables) out of .c files and into their corresponding *.internals.h headers, aligning these modules with the existing “single translation unit + internals header” pattern used elsewhere in the codebase.
Changes:
- Move
realloc_errmsg/vfprintf_errmsgstatic error strings fromlib/wrappers.cintolib/wrappers.internals.h. - Move
errmsgstatic error string fromlib/readline.cintolib/readline.internals.h. - Move
<setjmp.h>andstatic jmp_buf envfromhhss/c/rtdbparse.cintohhss/c/rtdbparse.internals.h.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/wrappers.internals.h | Adds a STATIC VARIABLES section containing static error message strings used by wrappers.c. |
| lib/wrappers.c | Removes file-local static error message definitions now centralized in wrappers.internals.h. |
| lib/readline.internals.h | Adds a STATIC VARIABLES section containing the read error message used by readline.c. |
| lib/readline.c | Removes the file-local static error message definition now provided by readline.internals.h. |
| hhss/c/rtdbparse.internals.h | Moves setjmp dependency and env jump buffer into the internals header alongside other module statics. |
| hhss/c/rtdbparse.c | Drops the now-redundant <setjmp.h> include and env definition from the translation unit. |
Removed unnecessary empty lines in wrappers.c
lshqqytiger
approved these changes
Jun 15, 2026
Closed
logic-finder
requested changes
Jun 15, 2026
Contributor
lshqqytiger
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-function declarations (static variables and includes) were scattered in
.cfiles instead of being consolidated in their corresponding*.internals.hheaders, inconsistent with the project convention.Changes
hhss/c/rtdbparse.c→rtdbparse.internals.h: moved#include <setjmp.h>andstatic jmp_buf env;lib/wrappers.c→wrappers.internals.h: movedstatic const char *realloc_errmsgandstatic const char *vfprintf_errmsg; addedSTATIC VARIABLESsectionlib/readline.c→readline.internals.h: movedstatic const char *errmsg; addedSTATIC VARIABLESsectionBefore (
rtdbparse.c):After (
rtdbparse.c):Each
*.internals.his included by exactly one translation unit, so moving statics into them is safe and consistent with the existing pattern in files likelex.internals.h.