1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
7 static void device_done(Name
*n
) {
14 static void device_dump(Name
*n
, FILE *f
, const char *prefix
) {
16 static const char* const state_table
[_DEVICE_STATE_MAX
] = {
17 [DEVICE_DEAD
] = "dead",
18 [DEVICE_AVAILABLE
] = "available"
21 Device
*s
= DEVICE(n
);
26 "%sDevice State: %s\n",
27 prefix
, state_table
[s
->state
]);
30 static NameActiveState
device_active_state(Name
*n
) {
31 return DEVICE(n
)->state
== DEVICE_DEAD
? NAME_INACTIVE
: NAME_ACTIVE
;
34 const NameVTable device_vtable
= {
37 .init
= name_load_fragment_and_dropin
,
41 .active_state
= device_active_state