aboutsummaryrefslogblamecommitdiff
path: root/include/npassd/session.h
blob: 6763c6a8d356d052d65863c2f8673d32f0c46f6f (plain) (tree)


















                                                                  
#include <stdbool.h>
#include <systemd/sd-bus.h>

#include "npassd/common.h"

#define SESSION_IFACE "org.freedesktop.Secret.Session"

/* reusable slots */
struct session {
	bool isactive;
	sd_bus_slot *slot;
	/* +32 for snprintf("/session/%d") */
	char path[sizeof(DBUS_OBJECT_PATH) + 32];
};

void session_init(struct session *s, size_t n);
int session_slot_available(struct session *s, size_t n);
int session_free(struct session *s);
int session_new(sd_bus *bus, struct session *s, unsigned slot_no);