Viewing is open to everyone. Downloading and starring need a GitHub sign-in. Sign in with GitHub

layout_probe.c

v0.1.0-build.85 Latest Commit ede38f5

Size
3.3 KB
Lines
65
Language
c
SHA-256
1442c6cb9802…
View on GitHub

Sign in with GitHub to download. Each download is recorded with your GitHub username.

1/* Prints the size and field offsets of every C struct that the CKey .NET
2 * interop mirrors (src/CKey/Interop/NativeStructs.cs). Build it with the
3 * native CMake project and diff the output against layout_expected.txt; the
4 * xUnit test StructLayoutTests asserts the same numbers on the managed side. */
5#include <stddef.h>
6#include <stdio.h>
7
8#include "ckey/ckey.h"
9#include "ckey/telemetry.h"
10
11#define S(T) printf("%s size %u\n", #T, (unsigned)sizeof(T))
12#define O(T, f) printf("%s.%s %u\n", #T, #f, (unsigned)offsetof(T, f))
13
14int main(void) {
15 S(ckey_diagnostics);
16 O(ckey_diagnostics, status); O(ckey_diagnostics, corrected_symbols);
17 O(ckey_diagnostics, erasures_used); O(ckey_diagnostics, message);
18
19 S(ckey_scalable_symbol);
20 O(ckey_scalable_symbol, version); O(ckey_scalable_symbol, ecc_level); O(ckey_scalable_symbol, layout);
21 O(ckey_scalable_symbol, payload_length); O(ckey_scalable_symbol, codeword_length);
22 O(ckey_scalable_symbol, codeword);
23
24 S(ckey_rgb);
25 S(ckey_style);
26 O(ckey_style, background); O(ckey_style, background_edge); O(ckey_style, ink); O(ckey_style, ink_shade);
27 O(ckey_style, accents); O(ckey_style, accent_count); O(ckey_style, accent_percent);
28 O(ckey_style, modules); O(ckey_style, rings); O(ckey_style, rays);
29 O(ckey_style, bevel); O(ckey_style, shadow); O(ckey_style, texture);
30 O(ckey_style, logo_href); O(ckey_style, logo_radius); O(ckey_style, logo_plate); O(ckey_style, policy);
31
32 S(ckey_logo_image);
33 O(ckey_logo_image, rgba); O(ckey_logo_image, width); O(ckey_logo_image, height); O(ckey_logo_image, stride);
34
35 S(ckey_raster_options);
36 O(ckey_raster_options, size_px); O(ckey_raster_options, policy); O(ckey_raster_options, format);
37 O(ckey_raster_options, transparent); O(ckey_raster_options, supersample);
38 O(ckey_raster_options, min_feature_px); O(ckey_raster_options, materials); O(ckey_raster_options, logo);
39
40 S(ckey_backdrop);
41 O(ckey_backdrop, colours); O(ckey_backdrop, colour_count); O(ckey_backdrop, rgba);
42 O(ckey_backdrop, width); O(ckey_backdrop, height); O(ckey_backdrop, stride);
43
44 S(ckey_scan_model);
45 O(ckey_scan_model, px_per_module); O(ckey_scan_model, blur_px); O(ckey_scan_model, noise);
46 O(ckey_scan_model, glare); O(ckey_scan_model, trials);
47
48 S(ckey_certification);
49 O(ckey_certification, certified); O(ckey_certification, policy); O(ckey_certification, adjustments);
50 O(ckey_certification, trials); O(ckey_certification, trials_passed);
51 O(ckey_certification, min_contrast); O(ckey_certification, feature_separation);
52 O(ckey_certification, logo_load); O(ckey_certification, message);
53
54 S(ckey_telemetry_histogram);
55 O(ckey_telemetry_histogram, sum); O(ckey_telemetry_histogram, buckets);
56 S(ckey_telemetry_counters);
57 O(ckey_telemetry_counters, sessions_succeeded); O(ckey_telemetry_counters, sessions_failed);
58 O(ckey_telemetry_counters, frames); O(ckey_telemetry_counters, decoded);
59 O(ckey_telemetry_counters, time_to_decode_ms); O(ckey_telemetry_counters, frame_ms);
60 S(ckey_safe_action);
61 O(ckey_safe_action, scope); O(ckey_safe_action, issuer); O(ckey_safe_action, app); O(ckey_safe_action, action);
62 O(ckey_safe_action, key_id); O(ckey_safe_action, request_id); O(ckey_safe_action, issued_at);
63 O(ckey_safe_action, expires_at); O(ckey_safe_action, params); O(ckey_safe_action, params_len);
64 return 0;
65}