feat(rust): first green Rust crates — oakcore-rs, oakundo, oakcommon, oaktimeline, oakaudio

- oakcore-rs: Rational/TimeRange/TimeRangeList/PixelFormat/SampleFormat
  mirroring oakcore C++ semantics (91.6% coverage)
- oakundo: UndoCommand/UndoStack with vtable commands (99.6%)
- oakcommon: config/XML/VideoParams/logging etc. (89.8%, 516 tests);
  XML via quick-xml, logging via the log facade
- oaktimeline: markers/workarea/edit commands (95.4%)
- oakaudio: processor/manager/sync/waveform/levelmeter (88.4%)
- unified -MMCCCC error codes across all C ABI headers (registry in
  include/common/error.h; pass-through rule)
- olive::Variant moved node -> common (cross-module value type)
- oakcommon_videoparams_set_is_3d added to the C ABI
- M11 (oakplugin Rust rewrite) plan + notes.md freeze line for the
  inter-module C ABI wiring
This commit is contained in:
2026-08-09 04:24:28 +08:00
parent 5a564f30ca
commit 4b24aa9d67
138 changed files with 47853 additions and 48 deletions
+5 -5
View File
@@ -50,10 +50,10 @@
* (including the terminating NUL) as a non-negative value instead.
*/
#define OAKAUDIO_OK 0 /**< Success. */
#define OAKAUDIO_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKAUDIO_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKAUDIO_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKAUDIO_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKAUDIO_E_NOMEM (-5) /**< Allocation failed. */
#define OAKAUDIO_E_INVALID (-60001) /**< NULL handle or invalid argument. */
#define OAKAUDIO_E_STATE (-60002) /**< Call not valid in the current state. */
#define OAKAUDIO_E_FAILED (-60003) /**< The underlying operation failed. */
#define OAKAUDIO_E_NOT_FOUND (-60004) /**< Index out of range / entry not found. */
#define OAKAUDIO_E_NOMEM (-60005) /**< Allocation failed. */
#endif //OAK_EDITOR_AUDIO_ERROR_H
+6 -6
View File
@@ -30,12 +30,12 @@
* (including the terminating NUL) as a non-negative value instead.
*/
#define OAKCODEC_OK 0 /**< Success. */
#define OAKCODEC_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKCODEC_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKCODEC_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKCODEC_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKCODEC_E_NOMEM (-5) /**< Allocation failed. */
#define OAKCODEC_E_CANCELLED (-6) /**< The operation was cancelled. */
#define OAKCODEC_E_INVALID (-50001) /**< NULL handle or invalid argument. */
#define OAKCODEC_E_STATE (-50002) /**< Call not valid in the current state. */
#define OAKCODEC_E_FAILED (-50003) /**< The underlying operation failed. */
#define OAKCODEC_E_NOT_FOUND (-50004) /**< Index out of range / entry not found. */
#define OAKCODEC_E_NOMEM (-50005) /**< Allocation failed. */
#define OAKCODEC_E_CANCELLED (-50006) /**< The operation was cancelled. */
/**
* @brief Current ABI version stamped into every oakcodec handle.
+30 -5
View File
@@ -28,13 +28,38 @@
* 0 (OAKCOMMON_OK) on success, a negative OAKCOMMON_E_* error code on
* failure. String getters return the required buffer size in bytes
* (including the terminating NUL) as a non-negative value instead.
*
* Project-wide error code scheme (-MMCCCC, 2026-08):
* every module's error codes are negative integers of the form
* -(MM * 10000 + CCCC), where MM is the module number from the registry
* below and CCCC is a module-local code. The first module-local codes
* are reserved and identical across modules: 0001 INVALID, 0002 STATE,
* 0003 FAILED, 0004 NOT_FOUND, 0005 NOMEM, 0006 CANCELLED.
*
* An error code crossing a module boundary is passed through
* UNTRANSLATED — the numeric module prefix preserves provenance
* (e.g. -30004 is oaknode's NOT_FOUND no matter which module reports it
* to the caller).
*
* Module number registry (only ever appended to; numbers are frozen):
*/
#define OAK_ERROR_MODULE_COMMON 1 /**< oakcommon */
#define OAK_ERROR_MODULE_UNDO 2 /**< oakundo */
#define OAK_ERROR_MODULE_NODE 3 /**< oaknode */
#define OAK_ERROR_MODULE_TIMELINE 4 /**< oaktimeline */
#define OAK_ERROR_MODULE_CODEC 5 /**< oakcodec */
#define OAK_ERROR_MODULE_AUDIO 6 /**< oakaudio */
#define OAK_ERROR_MODULE_RENDER 7 /**< oakrender */
#define OAK_ERROR_MODULE_TASK 8 /**< oaktask */
#define OAK_ERROR_MODULE_PLUGIN 9 /**< oakplugin */
#define OAK_ERROR_MODULE_STORAGE 10 /**< oakstorage (reserved) */
#define OAKCOMMON_OK 0 /**< Success. */
#define OAKCOMMON_E_INVALID (-1) /**< Empty handle (ctx == NULL) or invalid argument. */
#define OAKCOMMON_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKCOMMON_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKCOMMON_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKCOMMON_E_NOMEM (-5) /**< Allocation failed. */
#define OAKCOMMON_E_INVALID (-10001) /**< Empty handle (ctx == NULL) or invalid argument. */
#define OAKCOMMON_E_STATE (-10002) /**< Call not valid in the current state. */
#define OAKCOMMON_E_FAILED (-10003) /**< The underlying operation failed. */
#define OAKCOMMON_E_NOT_FOUND (-10004) /**< Index out of range / entry not found. */
#define OAKCOMMON_E_NOMEM (-10005) /**< Allocation failed. */
#define SUCCESS OAKCOMMON_OK /**< @deprecated Use OAKCOMMON_OK. */
+5 -5
View File
@@ -40,10 +40,10 @@
#define OAKNODE_ABI_VERSION 1
#define OAKNODE_OK 0 /**< Success. */
#define OAKNODE_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKNODE_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKNODE_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKNODE_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKNODE_E_NOMEM (-5) /**< Allocation failed. */
#define OAKNODE_E_INVALID (-30001) /**< NULL handle or invalid argument. */
#define OAKNODE_E_STATE (-30002) /**< Call not valid in the current state. */
#define OAKNODE_E_FAILED (-30003) /**< The underlying operation failed. */
#define OAKNODE_E_NOT_FOUND (-30004) /**< Index out of range / entry not found. */
#define OAKNODE_E_NOMEM (-30005) /**< Allocation failed. */
#endif //OAK_EDITOR_NODE_ERROR_H
+6 -6
View File
@@ -27,12 +27,12 @@
* @brief Status and error codes shared by all oakplugin C API families.
*/
#define OAKPLUGIN_OK 0 /**< Success. */
#define OAKPLUGIN_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKPLUGIN_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKPLUGIN_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKPLUGIN_E_NOT_FOUND (-4) /**< Entry not found. */
#define OAKPLUGIN_E_NOMEM (-5) /**< Allocation failed. */
#define OAKPLUGIN_E_CANCELLED (-6) /**< The operation was cancelled. */
#define OAKPLUGIN_E_INVALID (-90001) /**< NULL handle or invalid argument. */
#define OAKPLUGIN_E_STATE (-90002) /**< Call not valid in the current state. */
#define OAKPLUGIN_E_FAILED (-90003) /**< The underlying operation failed. */
#define OAKPLUGIN_E_NOT_FOUND (-90004) /**< Entry not found. */
#define OAKPLUGIN_E_NOMEM (-90005) /**< Allocation failed. */
#define OAKPLUGIN_E_CANCELLED (-90006) /**< The operation was cancelled. */
/** @brief ABI version stamped into every oakplugin handle. */
#define OAKPLUGIN_ABI_VERSION 1
+5 -5
View File
@@ -40,10 +40,10 @@
#define OAKRENDER_ABI_VERSION 1
#define OAKRENDER_OK 0 /**< Success. */
#define OAKRENDER_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKRENDER_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKRENDER_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKRENDER_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKRENDER_E_NOMEM (-5) /**< Allocation failed. */
#define OAKRENDER_E_INVALID (-70001) /**< NULL handle or invalid argument. */
#define OAKRENDER_E_STATE (-70002) /**< Call not valid in the current state. */
#define OAKRENDER_E_FAILED (-70003) /**< The underlying operation failed. */
#define OAKRENDER_E_NOT_FOUND (-70004) /**< Index out of range / entry not found. */
#define OAKRENDER_E_NOMEM (-70005) /**< Allocation failed. */
#endif //OAK_EDITOR_RENDER_ERROR_H
+6 -6
View File
@@ -32,11 +32,11 @@
#define OAKTASK_ABI_VERSION 1
#define OAKTASK_OK 0 /**< Success. */
#define OAKTASK_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKTASK_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKTASK_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKTASK_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKTASK_E_NOMEM (-5) /**< Allocation failed. */
#define OAKTASK_E_CANCELLED (-6) /**< The operation was cancelled. */
#define OAKTASK_E_INVALID (-80001) /**< NULL handle or invalid argument. */
#define OAKTASK_E_STATE (-80002) /**< Call not valid in the current state. */
#define OAKTASK_E_FAILED (-80003) /**< The underlying operation failed. */
#define OAKTASK_E_NOT_FOUND (-80004) /**< Index out of range / entry not found. */
#define OAKTASK_E_NOMEM (-80005) /**< Allocation failed. */
#define OAKTASK_E_CANCELLED (-80006) /**< The operation was cancelled. */
#endif //OAK_EDITOR_TASK_ERROR_H
+5 -5
View File
@@ -32,10 +32,10 @@
#define OAKTIMELINE_ABI_VERSION 1
#define OAKTIMELINE_OK 0 /**< Success. */
#define OAKTIMELINE_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKTIMELINE_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKTIMELINE_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKTIMELINE_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKTIMELINE_E_NOMEM (-5) /**< Allocation failed. */
#define OAKTIMELINE_E_INVALID (-40001) /**< NULL handle or invalid argument. */
#define OAKTIMELINE_E_STATE (-40002) /**< Call not valid in the current state. */
#define OAKTIMELINE_E_FAILED (-40003) /**< The underlying operation failed. */
#define OAKTIMELINE_E_NOT_FOUND (-40004) /**< Index out of range / entry not found. */
#define OAKTIMELINE_E_NOMEM (-40005) /**< Allocation failed. */
#endif //OAK_EDITOR_TIMELINE_ERROR_H
+5 -5
View File
@@ -30,10 +30,10 @@
* (including the terminating NUL) as a non-negative value instead.
*/
#define OAKUNDO_OK 0 /**< Success. */
#define OAKUNDO_E_INVALID (-1) /**< NULL handle or invalid argument. */
#define OAKUNDO_E_STATE (-2) /**< Call not valid in the current state. */
#define OAKUNDO_E_FAILED (-3) /**< The underlying operation failed. */
#define OAKUNDO_E_NOT_FOUND (-4) /**< Index out of range / entry not found. */
#define OAKUNDO_E_NOMEM (-5) /**< Allocation failed. */
#define OAKUNDO_E_INVALID (-20001) /**< NULL handle or invalid argument. */
#define OAKUNDO_E_STATE (-20002) /**< Call not valid in the current state. */
#define OAKUNDO_E_FAILED (-20003) /**< The underlying operation failed. */
#define OAKUNDO_E_NOT_FOUND (-20004) /**< Index out of range / entry not found. */
#define OAKUNDO_E_NOMEM (-20005) /**< Allocation failed. */
#endif //OAK_EDITOR_UNDO_ERROR_H