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

Refactor common/ini module to remove callbacks and duplicated code. #1968

Merged
merged 13 commits into from
Jan 12, 2023

Conversation

dwsteele
Copy link
Member

The callbacks in iniLoad made the downstream code more complicated than it needed to be so use an iterator model instead.

Combine the two functions that were used to load the ini data to remove code duplication. In theory it would be nice to use iniValueNext() in the config/parse module rather than loading a KeyValue store but this would mean a big change to the parser, which does not seem worthwhile.

@dwsteele dwsteele added this to the 2.44 milestone Dec 29, 2022
@dwsteele dwsteele self-assigned this Dec 29, 2022
# Conflicts:
#	src/common/ini.c
#	src/common/ini.h
#	src/info/info.c
#	test/src/module/common/iniTest.c
This should make it a little clearer what the variable (VR) macros are doing since the declaration/definition cannot both be set to extern (but functions can).

Splitting the variable macros out also allows them to be changed in the future with little churn, while changing the function macro creates a large amount of churn.
# Conflicts:
#	src/common/ini.c
#	src/common/ini.h
#	src/info/info.c
# Conflicts:
#	doc/xml/release.xml
#	src/common/ini.c
#	src/common/ini.h
#	src/info/info.c
Copy link
Member

@pgstef pgstef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I've built the sources and tried some basic actions, read the code a few times and didn't spot anything obvious. So, looks good to me.

@dwsteele dwsteele merged commit 34e4835 into pgbackrest:integration Jan 12, 2023
@dwsteele dwsteele deleted the dev-ini-refactor branch January 12, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants