Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Switch to opaque structs

Open
#39 3 comments 2 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@michael-grunder is already working on this.

Since Jul 2, 2024.

Assessment

This issue has not been assessed yet.

Description

Right now, we declare valkeyContext, valkeyAsyncContext, valkeyClusterContext, and valkeyAsyncClusterContext in our public headers, exposing their memory layout.

This makes it a lot harder to make changes to them without breaking the ABI contract and therefore having to bump the SONAME.

We could switch to simply defining:

typedef struct valkeyContext valkeyContext;
typedef struct valkeyClusterContext valkeyClusterContext;

in our public headers, and declare the actual struct internally in a private header.

The only real downside is that it might break code for users who are directly accessing struct members. Personally, I can live with that 😄.

@bjosv @zuiderkwast What does everybody think?

Dominant language
C
Stars
62
Forks
26
Avg merge
1d 5h
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from valkey-io/libvalkey

All issues in valkey-io/libvalkey

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.