Task 002: Utility modules (log, plist_helpers, usb_helpers)

Implemented three foundational utility modules:
- log: leveled logging with ANSI colors to stderr
- plist_helpers: libplist convenience wrappers for dict access and XML serialization
  (renamed plist_dict_get_bool_val/plist_dict_get_uint_val to avoid collision with
  libplist 2.x native symbols plist_dict_get_bool/plist_dict_get_uint)
- usb_helpers: libusb control transfer wrappers for DFU operations

Files created:
- include/util/log.h, src/util/log.c
- include/util/plist_helpers.h, src/util/plist_helpers.c
- include/util/usb_helpers.h, src/util/usb_helpers.c

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
tr4m0ryp 2026-04-05 01:55:57 +02:00
parent 85caaefa9c
commit f369657971
6 changed files with 276 additions and 0 deletions

17
include/util/log.h Normal file
View file

@ -0,0 +1,17 @@
#ifndef LOG_H
#define LOG_H
typedef enum {
LOG_DEBUG = 0,
LOG_INFO,
LOG_WARN,
LOG_ERROR
} log_level_t;
void log_set_level(log_level_t level);
void log_debug(const char *fmt, ...);
void log_info(const char *fmt, ...);
void log_warn(const char *fmt, ...);
void log_error(const char *fmt, ...);
#endif /* LOG_H */