uint64_t media_session_last_offset;
} Context;
+#define CONTEXT_EMPTY { \
+ .fd = -1, \
+ .media_feature = _FEATURE_INVALID, \
+ .media_state = _MEDIA_STATE_INVALID, \
+ }
+
static void context_clear(Context *c) {
if (!c)
return;
free(c->drive_features);
}
-static void context_init(Context *c) {
- assert(c);
-
- *c = (Context) {
- .fd = -1,
- .media_feature = _FEATURE_INVALID,
- .media_state = _MEDIA_STATE_INVALID,
- };
-}
-
static bool drive_has_feature(const Context *c, Feature f) {
assert(c);
}
static int run(int argc, char *argv[]) {
- _cleanup_(context_clear) Context c;
+ _cleanup_(context_clear) Context c = CONTEXT_EMPTY;
int r;
log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();
- context_init(&c);
-
r = parse_argv(argc, argv);
if (r <= 0)
return r;