Skip to content

Misc API cleanup #24

@marktsuchida

Description

@marktsuchida
  • Functions returning arrays of borrowed objects (OSc_GetAllDevices(), OSc_Device_GetSettings()) should not return borrowed array. Instead they should copy into caller-provided array (or introduce a PtrArray type).
  • Functions returning strings should standardized to using fixed-size (OSc_MAX_STR_SIZE) buffers: OSc_Device_GetName() and OSc_Device_GetDisplayName().
  • Avoid losing information: separate OSc_Device_GetDisplayName() into two functions, for model name and device name.
  • OSc_SetDeviceModuleSearchPaths() parameter type should be const char *const *.
  • Error-related functions that write to string buffer should return would-be-written string length rather than void.
  • Settings functions returning arrays of numbers should avoid returning internal pointer (whose lifetime is hard to specify) and copy to caller-provided buffer (or introduce NumArray type).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions