Skip to content

API #42

Open
Open
API#42
@t-w

Description

@t-w

There is a lot of discussions already about it, I'd expect more, so maybe we can make a place for it (to list, brainstorm and set directions).

Some ideas to (eventually) consider (please update as needed):

  1. file / directory APIs (done)
  2. consistent naming (ie. submodule prefixes) across the library (done)
  3. isolating client API from internal one (separated headers in include/?) (mostly done, but may be improved)
    • eg. for file API, expose only a wrapper over the low level functions(?)
  4. devices (done)
    • allow more types of devices (not only one native and "dump"), also custom, user-implemented
    • add a memory/ramdisk device - useful ie. for testing (see the comment below
    • unify the device interface for all types
      • the type of the device is currently is set in adfOpenDev() and depend on the name (ie filename) of the device
        • instead: differentiate opening/creating depending on type (need rather different functions as different arguments are needed, eg. filename for dump, size for ramdisk device)
      • make the same device structure with interface also for dump devices
  5. review error codes (see the comment below) and their use (partially done, can be improved)
    • reduce amount of (or remove completely) string output to stdout/err (or leave if a "logger" defined/enabled)
    • replace output warnings with proper return codes
      • bitfield vs enumeration
        • bitfield would allow to aggregate more than one in single return code
        • that was the orig. idea (there is even a test hasRC() - but it is not used anywhere...)
    • user readable (string) error info: logger vs errno/last error info
      • errno/last error info
        • only static error string or dynamic (that would include more info like filename, block
          number or other data relevant for the error)
        • drawbacks: single, global (what can be problematic, even though the lib is not supporting multi-threading)
      • use logger for more detailed error info (if logger enabled/defined)?

Each of these might be a separated issue (or even issues), that could be linked here (so that it is easier to navigate).

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