@@ -28,7 +28,7 @@ void ddog_library_configurator_with_detect_process_info(struct ddog_Configurator
2828
2929void ddog_library_configurator_drop (struct ddog_Configurator * );
3030
31- struct ddog_Result_VecLibraryConfig ddog_library_configurator_get (const struct ddog_Configurator * configurator );
31+ struct ddog_LibraryConfigLoggedResult ddog_library_configurator_get (const struct ddog_Configurator * configurator );
3232
3333/**
3434 * Returns a static null-terminated string, containing the name of the environment variable
@@ -48,23 +48,63 @@ struct ddog_CStr ddog_library_config_fleet_stable_config_path(void);
4848 */
4949struct ddog_CStr ddog_library_config_local_stable_config_path (void );
5050
51- void ddog_library_config_drop (struct ddog_Vec_LibraryConfig );
51+ void ddog_library_config_drop (struct ddog_LibraryConfigLoggedResult config_result );
5252
5353/**
54- * Store tracer metadata to a file handle
54+ * Allocates and returns a pointer to a new `TracerMetadata` object on the heap.
5555 *
5656 * # Safety
57+ * This function returns a raw pointer. The caller is responsible for calling
58+ * `ddog_tracer_metadata_free` to deallocate the memory.
5759 *
58- * Accepts raw C-compatible strings
60+ * # Returns
61+ * A non-null pointer to a newly allocated `TracerMetadata` instance.
5962 */
60- struct ddog_Result_TracerMemfdHandle ddog_store_tracer_metadata (uint8_t schema_version ,
61- ddog_CharSlice runtime_id ,
62- ddog_CharSlice tracer_language ,
63- ddog_CharSlice tracer_version ,
64- ddog_CharSlice hostname ,
65- ddog_CharSlice service_name ,
66- ddog_CharSlice service_env ,
67- ddog_CharSlice service_version );
63+ struct ddog_TracerMetadata * ddog_tracer_metadata_new (void );
64+
65+ /**
66+ * Frees a `TracerMetadata` instance previously allocated with `ddog_tracer_metadata_new`.
67+ *
68+ * # Safety
69+ * - `ptr` must be a pointer previously returned by `ddog_tracer_metadata_new`.
70+ * - Double-freeing or passing an invalid pointer results in undefined behavior.
71+ * - Passing a null pointer is safe and does nothing.
72+ */
73+ void ddog_tracer_metadata_free (struct ddog_TracerMetadata * ptr );
74+
75+ /**
76+ * Sets a field of the `TracerMetadata` object pointed to by `ptr`.
77+ *
78+ * # Arguments
79+ * - `ptr`: Pointer to a `TracerMetadata` instance.
80+ * - `kind`: The metadata field to set (as defined in `MetadataKind`).
81+ * - `value`: A null-terminated C string representing the value to set.
82+ *
83+ * # Safety
84+ * - Both `ptr` and `value` must be non-null.
85+ * - `value` must point to a valid UTF-8 null-terminated string.
86+ * - If the string is not valid UTF-8, the function does nothing.
87+ */
88+ void ddog_tracer_metadata_set (struct ddog_TracerMetadata * ptr ,
89+ enum ddog_MetadataKind kind ,
90+ const char * value );
91+
92+ /**
93+ * Serializes the `TracerMetadata` into a platform-specific memory handle (e.g., memfd on Linux).
94+ *
95+ * # Safety
96+ * - `ptr` must be a valid, non-null pointer to a `TracerMetadata`.
97+ *
98+ * # Returns
99+ * - On Linux: a `TracerMemfdHandle` containing a raw file descriptor to a memory file.
100+ * - On unsupported platforms: an error.
101+ * - On failure: propagates any internal errors from the metadata storage process.
102+ *
103+ * # Platform Support
104+ * This function currently only supports Linux via `memfd`. On other platforms,
105+ * it will return an error.
106+ */
107+ struct ddog_Result_TracerMemfdHandle ddog_tracer_metadata_store (struct ddog_TracerMetadata * ptr );
68108
69109#ifdef __cplusplus
70110} // extern "C"
0 commit comments