16#ifndef DTTR_SDK_ENABLE_UNSTABLE
17#error "Define DTTR_SDK_ENABLE_UNSTABLE before including dttr_util_pkg.h"
22#define DTTR_UTIL_API extern
30#define DTTR_UTIL_PKG_DEFAULT_TOC_COUNT 138u
167#define DTTR_UTIL_PKG_VISIT_AS(FnSuffix, Kind, Type) \
168 static inline const Type *DTTR_Util_PkgVisit_As##FnSuffix( \
169 const DTTR_Util_PkgVisit *visit \
171 return visit && visit->kind == (Kind) ? (const Type *)visit->ptr : NULL; \
DTTR_Util_PkgVisitAction(* DTTR_Util_PkgVisitor)(const DTTR_Util_PkgVisit *visit, void *userdata)
Visitor called once per visit. Its return value steers traversal.
DTTR_UTIL_API const char * DTTR_Util_PkgVisitStatusName(DTTR_Util_PkgVisitStatus status)
Return a static log-friendly name such as ok or load failed.
#define DTTR_UTIL_PKG_VISIT_AS(FnSuffix, Kind, Type)
Define a typed accessor that returns visit->ptr only for the matching kind.
DTTR_PCDOGS_T_Material_Entry DTTR_UTIL_PKG_VISIT_COLLISION_SHAPE
DTTR_Util_PkgVisitKind
Values stored in DTTR_Util_PkgVisit.kind.
@ DTTR_UTIL_PKG_VISIT_TOC_ENTRY
@ DTTR_UTIL_PKG_VISIT_SCENE_NODE
@ DTTR_UTIL_PKG_VISIT_LEVEL_RUNTIME_DATA
@ DTTR_UTIL_PKG_VISIT_SPRITE_ENTRY
@ DTTR_UTIL_PKG_VISIT_MESH_NODE
@ DTTR_UTIL_PKG_VISIT_LOADED_ENTRY
@ DTTR_UTIL_PKG_VISIT_UNSUPPORTED
DTTR_Util_PkgVisitAction
Visitor actions that steer the next walk step.
@ DTTR_UTIL_PKG_VISIT_LOAD_AND_RECURSE
@ DTTR_UTIL_PKG_VISIT_RECURSE
@ DTTR_UTIL_PKG_VISIT_SKIP_SUBTREE
@ DTTR_UTIL_PKG_VISIT_STOP
@ DTTR_UTIL_PKG_VISIT_CONTINUE
DTTR_UTIL_API DTTR_Util_PkgWalkResult DTTR_Util_PkgWalk(const DTTR_Core_Context *ctx, const DTTR_Util_PkgWalkOptions *options, DTTR_Util_PkgVisitor visitor, void *userdata)
Walk live package structures and call the visitor for each visit.
bool(* DTTR_Util_PkgLoadEntryFn)(const DTTR_Core_Context *ctx, int32_t toc_index, const DTTR_PCDOGS_T_PKG_TOCEntry *entry, void *userdata, void **out_entry, size_t *out_size, DTTR_Util_PkgVisitStatus *out_status)
Load data for a TOC entry, reporting failures through out_status.
DTTR_UTIL_API DTTR_Util_PkgWalkOptions DTTR_Util_PkgWalk_DefaultOptions()
Return default options covering all known domains, entry loading included.
DTTR_Util_PkgWalkDomain
Bit flags for DTTR_Util_PkgWalkOptions.domains.
@ DTTR_UTIL_PKG_DOMAIN_ALL_KNOWN
@ DTTR_UTIL_PKG_DOMAIN_TOC
@ DTTR_UTIL_PKG_DOMAIN_COLLISION
@ DTTR_UTIL_PKG_DOMAIN_SPRITE
@ DTTR_UTIL_PKG_DOMAIN_MESH
@ DTTR_UTIL_PKG_DOMAIN_ENTRY
@ DTTR_UTIL_PKG_DOMAIN_LEVEL
@ DTTR_UTIL_PKG_DOMAIN_SCENE
@ DTTR_UTIL_PKG_DOMAIN_KNOWN_CHILDREN
@ DTTR_UTIL_PKG_DOMAIN_MATERIAL
void(* DTTR_Util_PkgFreeEntryFn)(const DTTR_Core_Context *ctx, int32_t toc_index, const DTTR_PCDOGS_T_PKG_TOCEntry *entry, void *entry_data, void *userdata)
Release entry data produced by the matching load callback.
DTTR_UTIL_PKG_VISIT_MATERIAL_ENTRY
DTTR_Util_PkgVisitStatus
Status values reported by visits and the final walk result.
@ DTTR_UTIL_PKG_STATUS_UNRESOLVED_SYMBOL
@ DTTR_UTIL_PKG_STATUS_OK
@ DTTR_UTIL_PKG_STATUS_INVALID_ARGUMENT
@ DTTR_UTIL_PKG_STATUS_LOAD_FAILED
@ DTTR_UTIL_PKG_STATUS_DECODE_UNSUPPORTED
@ DTTR_UTIL_PKG_STATUS_UNKNOWN_ENTRY_KIND
@ DTTR_UTIL_PKG_STATUS_BOUNDS_INVALID
Concrete runtime level-data block carried by Level_Data* APIs.
Package TOC entry used by the package table. Size-lane aliases share this storage.
Pointers last only for the visit unless PCDOGS documents a longer lifetime.
DTTR_Util_PkgVisitKind kind
const void * loaded_entry_base
const DTTR_Util_PkgVisit * parent
DTTR_Util_PkgVisitStatus status
const DTTR_PCDOGS_T_PKG_TOCEntry * toc_entry
Walk options. Start from DTTR_Util_PkgWalk_DefaultOptions() for defaults.
const DTTR_PCDOGS_T_PKG_TOCEntry * toc_entries
DTTR_Util_PkgLoadEntryFn load_entry
DTTR_Util_PkgFreeEntryFn free_entry
Non-fatal per-entry failures keep traversal moving.
DTTR_Util_PkgVisitStatus status