Skip to content

Fix documentation grammar, types, signatures, and add missing docs#417

Merged
horgh merged 12 commits into
mainfrom
greg/eng-4241
Feb 24, 2026
Merged

Fix documentation grammar, types, signatures, and add missing docs#417
horgh merged 12 commits into
mainfrom
greg/eng-4241

Conversation

@oschwald

Copy link
Copy Markdown
Member

Summary

  • Fix grammar and typos across README.md, README.dev.md, and doc/libmaxminddb.md (subject-verb agreement, missing prepositions, duplicated articles, possessive "its")
  • Fix incorrect type reference (MMDB_result_sMMDB_entry_s) and field reference (data_typetype)
  • Update function signatures in docs to match const MMDB_s *const mmdb qualifiers from maxminddb.h for MMDB_lookup_string, MMDB_lookup_sockaddr, MMDB_read_node, and MMDB_get_metadata_as_entry_data_list
  • Update MMDB_read_node bounds check description to match >= implementation
  • Clarify MMDB_get_entry_data_list start parameter (relates to Improvement needed in libmaxminddb docs #145)
  • Document how to work with maps and arrays using MMDB_get_value() and MMDB_get_entry_data_list() (relates to Iterating over map or array returned with MMDB_get_value() #255)

Test plan

  • make check passes (all 28 tests)
  • Man page generation with lowdown succeeds
  • Rendered man pages display correctly

🤖 Generated with Claude Code

oschwald and others added 4 commits February 24, 2026 09:46
- Fix subject-verb agreement: "compilers that supports" → "support"
- Fix subject-verb agreement: "sources are possible" → "is possible"
- Remove extra word: "to include specify" → "to specify"
- Add missing preposition: "working MaxMind DB" → "working with MaxMind DB"
- Fix possessive: "it's major version" → "its major version"
- Remove duplicated article: "the the records" → "the records"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix section heading: MMDB_result_s → MMDB_entry_s (MMDB_result_s
  doesn't exist; the section describes MMDB_entry_s)
- Fix field reference: data_type → type (the actual field in
  MMDB_entry_data_s is "type", not "data_type")

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The documentation showed MMDB_s *const mmdb but the header declares
const MMDB_s *const mmdb for these functions. Update both the SYNOPSIS
and individual function sections for:

- MMDB_lookup_string
- MMDB_lookup_sockaddr
- MMDB_read_node
- MMDB_get_metadata_as_entry_data_list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The implementation (maxminddb.c) uses >= to check node_number against
node_count, so passing a node_number equal to node_count is also an
error. Update the documentation to say "greater than or equal to"
instead of "greater than".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @oschwald, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the clarity, accuracy, and completeness of the project's documentation. It addresses numerous grammatical inconsistencies and typos, corrects outdated or incorrect API references, and ensures that function signatures in the documentation precisely match their C header definitions. Furthermore, it provides crucial new guidance on handling complex data structures like maps and arrays, making the library easier to understand and use for developers.

Highlights

  • Documentation Grammar and Typos: Corrected various grammatical errors and typos across README.md, README.dev.md, and doc/libmaxminddb.md to improve readability and accuracy.
  • API Reference Corrections: Fixed an incorrect type reference from MMDB_result_s to MMDB_entry_s and a field reference from data_type to type within the documentation.
  • Function Signature Alignment: Updated function signatures in doc/libmaxminddb.md to consistently use const MMDB_s *const mmdb qualifiers for MMDB_lookup_string, MMDB_lookup_sockaddr, MMDB_read_node, and MMDB_get_metadata_as_entry_data_list, matching the maxminddb.h header.
  • MMDB_read_node Bounds Check Clarification: Clarified the description of the MMDB_read_node bounds check to accurately reflect the >= implementation.
  • MMDB_get_entry_data_list Parameter Clarification: Added clarification for the start parameter of MMDB_get_entry_data_list to explain its expected value source.
  • Map and Array Documentation: Provided new documentation on how to effectively work with maps and arrays using MMDB_get_value() and MMDB_get_entry_data_list().
Changelog
  • README.dev.md
    • Corrected a typo in the release instructions from 'include specify' to 'specify'.
  • README.md
    • Fixed subject-verb agreement for compiler support from 'supports' to 'support'.
    • Corrected verb agreement for installation sources from 'are possible' to 'is possible'.
  • doc/libmaxminddb.md
    • Updated MMDB_lookup_string signature to include const qualifier for mmdb parameter.
    • Updated MMDB_lookup_sockaddr signature to include const qualifier for mmdb parameter.
    • Updated MMDB_get_metadata_as_entry_data_list signature to include const qualifier for mmdb parameter.
    • Updated MMDB_read_node signature to include const qualifier for mmdb parameter.
    • Corrected grammar in the library description, adding 'with' after 'working'.
    • Changed section heading from MMDB_result_s to MMDB_entry_s.
    • Added documentation for accessing map and array elements using MMDB_get_value() and MMDB_get_entry_data_list().
    • Corrected field reference from data_type to type in MMDB_get_value() description.
    • Corrected possessive 'it's' to 'its' in error message description.
    • Clarified the usage of MMDB_get_entry_data_list() for complex structures.
    • Added a description for the start parameter of MMDB_get_entry_data_list().
    • Updated the MMDB_read_node bounds check description from 'greater than' to 'greater than or equal to'.
Activity
  • The author confirmed that make check passes all 28 tests.
  • The author verified that man page generation with lowdown succeeds.
  • The author confirmed that rendered man pages display correctly.
  • The pull request was generated with Claude Code.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request focuses on improving the documentation by fixing grammar, typos, and incorrect type/field references, as well as updating function signatures to match the header files. The changes are well-executed and enhance the clarity and accuracy of the documentation. I've found one minor inaccuracy in the description of a function parameter and have provided a suggestion to correct it.

Comment thread doc/libmaxminddb.md Outdated
Comment on lines +634 to +636
The `start` parameter is an `MMDB_entry_s` value. In most cases this will come
from the `entry` field of the `MMDB_lookup_result_s` value returned by
`MMDB_lookup_string()` or `MMDB_lookup_sockaddr()`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The description of the start parameter is slightly inaccurate. The function signature int MMDB_get_entry_data_list(MMDB_entry_s *start, ...) shows that start is a pointer to an MMDB_entry_s struct, not the struct value itself. The documentation should reflect this to avoid confusion.

Suggested change
The `start` parameter is an `MMDB_entry_s` value. In most cases this will come
from the `entry` field of the `MMDB_lookup_result_s` value returned by
`MMDB_lookup_string()` or `MMDB_lookup_sockaddr()`.
The `start` parameter is a pointer to an `MMDB_entry_s` struct. In most cases this will be a pointer to the `entry` field of the `MMDB_lookup_result_s` value returned by `MMDB_lookup_string()` or `MMDB_lookup_sockaddr()`.

oschwald and others added 2 commits February 24, 2026 10:04
Add an explicit description of the start parameter: it is an
MMDB_entry_s value, typically obtained from the entry field of an
MMDB_lookup_result_s returned by MMDB_lookup_string() or
MMDB_lookup_sockaddr(). This mirrors the existing description for
the data lookup functions.

Relates to GitHub #145.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add documentation explaining how to access individual entries in maps
and arrays:

- In the Data Lookup Functions section, explain that multiple keys in
  the same map are accessed via separate calls with the full lookup
  path, and that MMDB_get_entry_data_list() is more efficient for
  retrieving all data from a complex structure.

- In the MMDB_entry_data_s section, note that MAP and ARRAY types
  represent collections and explain how to access their items.

Relates to GitHub #255.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
oschwald and others added 6 commits February 24, 2026 10:18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaced by precious tidy with the clang-format command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reformat C and Markdown files to match precious configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add pipx:clang-format 21.1.8 to mise.toml so that both local dev and
CI use the exact same clang-format binary. This avoids formatting
differences between clang-format versions (e.g. v18 on Ubuntu 24.04 CI
vs v20 locally).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reformat to match clang-format 21.1.8 output. The only change is
indentation of preprocessor directives inside #ifdef/#ifndef blocks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@horgh horgh merged commit f3adfb6 into main Feb 24, 2026
33 checks passed
@horgh horgh deleted the greg/eng-4241 branch February 24, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants