Updated on 2026-08-03 GMT+08:00

Initializing the SDK (SDK for C)

If you have any questions during development, post them on the Issues page of GitHub.

The OBS SDK for C provides APIs for accessing OBS and managing resources such as buckets and objects.

Before using the OBS SDK for C, you need to call obs_initialize to complete the initialization (only once in a process). Before the process exits, call obs_deinitialize to release resources.

obs_status  ret_status = OBS_STATUS_BUTT;
ret_status = obs_initialize(OBS_INIT_ALL);
if (OBS_STATUS_OK != ret_status)
{
    printf("obs_initialize failed(%s).\n", obs_get_status_name(ret_status));
    return ret_status;
}

/* Do not repeatedly call obs_initialize. Otherwise, these operations may lead to invalid memory access. */
/* Call obs_deinitialize () to release resources before the process exits. */