summaryrefslogtreecommitdiffstats
path: root/src/devicedb.c
AgeCommit message (Collapse)AuthorFilesLines
5 hoursWindows: Don't use dllimport; only apply dllexport to DLL objectsHEADmasterGravatar Nikias Bassen1-1/+5
Public headers declared the API macro as __declspec(dllimport) on Windows unless *_STATIC was defined. That made consumers reference __imp_<symbol>, which only exists in the DLL import library, so linking against the static library failed unless the consumer also defined *_STATIC. All exported symbols are functions, so dllimport is not needed: calls to plain symbols link against both the static library and the import library (via its thunks). Drop it from the public headers. On the library side, apply __declspec(dllexport) only when libtool defines DLL_EXPORT, i.e. when compiling the objects for the DLL. This keeps export directives out of the objects that go into the static library when both are built.
9 daysDrop redundant IRECV_API on definitions, fix unused function warningGravatar Nikias Bassen1-1/+1
10 daysMove device database to data/devices.txt with user-extensible device filesGravatar Nikias Bassen1-0/+661
The device table is now maintained in data/devices.txt (one device per line, "#!format 1" header) and the built-in table src/devices.c is generated from it at build time by data/gen-devices.sh. At runtime the built-in table is merged with, in order, <pkgdatadir>/devices.txt and ~/.libirecovery/devices.txt (%APPDATA%\libirecovery on Windows, or $LIBIRECOVERY_DEVICE_DB). Entries are matched by hardware_model; later files override earlier ones. User files must be owned by the user (or root) and not world-writable. Add irecv_devices_add() which appends an entry to the user device file so applications can register new models without rebuilding the library. If no display name is given, an existing entry keeps its name and a new one is named "<product_type> (<hardware_model>)". Adding is refused if another hardware_model already uses the same chip and board ID.