2024-12-20 08:48:21 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Interface for controlling communication with the UI.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef UI_SOCKET_H
|
|
|
|
#define UI_SOCKET_H
|
|
|
|
|
2024-12-25 11:00:35 +01:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2024-12-20 08:48:21 +01:00
|
|
|
struct process_info {
|
2024-12-25 11:00:35 +01:00
|
|
|
pid_t PID;
|
|
|
|
const char *name;
|
|
|
|
uid_t UID;
|
2024-12-20 08:48:21 +01:00
|
|
|
};
|
|
|
|
|
2024-12-25 11:00:35 +01:00
|
|
|
// For default socket location, set socket_path = NULL.
|
|
|
|
int init_ui_socket(const char *socket_path);
|
2024-12-20 08:48:21 +01:00
|
|
|
|
|
|
|
// TODO: design an interface for asking user for permission.
|
|
|
|
|
2024-12-25 11:00:35 +01:00
|
|
|
int ask_access(const char *filename, struct process_info pi);
|
2024-12-20 08:48:21 +01:00
|
|
|
|
|
|
|
#endif // !UI_SOCKET_H
|