Skip to content

feat: align common C API - #13

Open
Jvlegod wants to merge 1 commit into
unicorn-engine:mainfrom
Jvlegod:feat/api-parity-complete
Open

feat: align common C API#13
Jvlegod wants to merge 1 commit into
unicorn-engine:mainfrom
Jvlegod:feat/api-parity-complete

Conversation

@Jvlegod

@Jvlegod Jvlegod commented Aug 11, 2026

Copy link
Copy Markdown

Hello maintainers,

This PR adds:

  • version, arch_supported, and strerror, errno, context_size helpers
  • context register r/w APIs(reg_r/w_batch, reg_r/w_bytes, reg_r/w_batch_bytes)
  • TCG buffer size get and set operations(ctl_get_tcg_buffer_size, ctl_set_tcg_buffer_size)

Also I notice that in unicorn core's repo(https://github.com/unicorn-engine/unicorn/blob/master/include/unicorn/unicorn.h#L73)

// Unicorn API version
#define UC_API_MAJOR 2
#define UC_API_MINOR 1
#define UC_API_PATCH 4
// Release candidate version, 255 means the official release.
#define UC_API_EXTRA 255

// Unicorn package version
#define UC_VERSION_MAJOR UC_API_MAJOR
#define UC_VERSION_MINOR UC_API_MINOR
#define UC_VERSION_PATCH UC_API_PATCH
#define UC_VERSION_EXTRA UC_API_EXTRA

so I sync the code in unicorn_const.rs.

pub const API_MAJOR: u64 = 2;
pub const API_MINOR: u64 = 1;
pub const API_PATCH: u64 = 4;
pub const API_EXTRA: u64 = 255;
pub const VERSION_MAJOR: u64 = API_MAJOR;
pub const VERSION_MINOR: u64 = API_MINOR;
pub const VERSION_PATCH: u64 = API_PATCH;
pub const VERSION_EXTRA: u64 = API_EXTRA;
pub const SECOND_SCALE: u64 = 1_000_000;
pub const MILLISECOND_SCALE: u64 = 1_000;

Signed-off-by: Keke Ming <ming.jvle@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant