Commit 96e73f52 authored by David Zeuthen's avatar David Zeuthen
Browse files

split libpolkit into more source/header files

parent 9a0ad189
......@@ -8,4 +8,4 @@ Description: library for querying system-wide policy
Version: @VERSION@
Requires: glib-2.0
Libs: -L${libdir} -lpolkit
Cflags: -I${includedir}/libpolkit
Cflags: -I${includedir}/PolicyKit
......@@ -12,13 +12,25 @@ INCLUDES = \
lib_LTLIBRARIES=libpolkit.la
libpolkitincludedir=$(includedir)/libpolkit
libpolkitinclude_HEADERS = \
libpolkit.h
libpolkit_la_SOURCES = \
libpolkit.c libpolkit.h
libpolkitincludedir=$(includedir)/PolicyKit/libpolkit
libpolkitinclude_HEADERS = \
libpolkit.h \
libpolkit-context.h \
libpolkit-privilege.h \
libpolkit-resource.h \
libpolkit-seat.h \
libpolkit-session.h \
libpolkit-caller.h
libpolkit_la_SOURCES = \
libpolkit.h libpolkit.c \
libpolkit-context.h libpolkit-context.c \
libpolkit-privilege.h libpolkit-privilege.c \
libpolkit-resource.h libpolkit-resource.c \
libpolkit-seat.h libpolkit-seat.c \
libpolkit-session.h libpolkit-session.c \
libpolkit-caller.h libpolkit-caller.c
libpolkit_la_LIBADD = @GLIB_LIBS@
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-caller.c : callers
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-caller.h"
struct PolKitCaller_s
{
};
PolKitCaller *
libpolkit_caller_new (void)
{
return NULL;
}
PolKitCaller *
libpolkit_caller_ref (PolKitCaller *caller)
{
return caller;
}
void
libpolkit_caller_set_dbus_name (PolKitCaller *caller, const char *dbus_name)
{
}
void
libpolkit_caller_set_uid (PolKitCaller *caller, uid_t uid)
{
}
void
libpolkit_caller_set_pid (PolKitCaller *caller, pid_t pid)
{
}
void
libpolkit_caller_set_selinux_context (PolKitCaller *caller, const char *selinux_context)
{
}
void
libpolkit_caller_set_ck_session (PolKitCaller *caller, PolKitSession *session)
{
}
gboolean
libpolkit_caller_get_dbus_name (PolKitCaller *caller, char **out_dbus_name)
{
return FALSE;
}
gboolean
libpolkit_caller_get_uid (PolKitCaller *caller, uid_t *out_uid)
{
return FALSE;
}
gboolean
libpolkit_caller_get_pid (PolKitCaller *caller, uid_t *out_pid)
{
return FALSE;
}
gboolean
libpolkit_caller_get_selinux_context (PolKitCaller *caller, char *out_selinux_context)
{
return FALSE;
}
gboolean
libpolkit_caller_get_ck_session (PolKitCaller *caller, PolKitSession **out_session)
{
return FALSE;
}
void
libpolkit_caller_unref (PolKitCaller *caller)
{
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-caller.h : callers
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
**************************************************************************/
#ifndef LIBPOLKIT_CALLER_H
#define LIBPOLKIT_CALLER_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
#include <libpolkit/libpolkit-session.h>
struct PolKitCaller_s;
typedef struct PolKitCaller_s PolKitCaller;
PolKitCaller *libpolkit_caller_new (void);
PolKitCaller *libpolkit_caller_ref (PolKitCaller *caller);
void libpolkit_caller_set_dbus_name (PolKitCaller *caller, const char *dbus_name);
void libpolkit_caller_set_uid (PolKitCaller *caller, uid_t uid);
void libpolkit_caller_set_pid (PolKitCaller *caller, pid_t pid);
void libpolkit_caller_set_selinux_context (PolKitCaller *caller, const char *selinux_context);
void libpolkit_caller_set_ck_session (PolKitCaller *caller, PolKitSession *session);
gboolean libpolkit_caller_get_dbus_name (PolKitCaller *caller, char **out_dbus_name);
gboolean libpolkit_caller_get_uid (PolKitCaller *caller, uid_t *out_uid);
gboolean libpolkit_caller_get_pid (PolKitCaller *caller, uid_t *out_pid);
gboolean libpolkit_caller_get_selinux_context (PolKitCaller *caller, char *out_selinux_context);
gboolean libpolkit_caller_get_ck_session (PolKitCaller *caller, PolKitSession **out_session);
void libpolkit_caller_unref (PolKitCaller *caller);
#endif /* LIBPOLKIT_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-context.c : context for PolicyKit
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-context.h"
struct PolKitContext_s
{
};
PolKitContext *
libpolkit_context_new (void)
{
return FALSE;
}
PolKitContext *
libpolkit_context_ref (PolKitContext *pk_context)
{
return pk_context;
}
void
libpolkit_context_set_config_changed (PolKitContext *pk_context,
PolKitContextConfigChangedCB cb,
gpointer user_data)
{
}
void
libpolkit_context_unref (PolKitContext *pk_context)
{
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-context.h : PolicyKit context
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
**************************************************************************/
#ifndef LIBPOLKIT_CONTEXT_H
#define LIBPOLKIT_CONTEXT_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
struct PolKitContext_s;
typedef struct PolKitContext_s PolKitContext;
/**
* PolKitContextConfigChangedCB:
* @pk_context: PolicyKit context
* @user_data: user data
*
* Called when configuration changes. Mechanisms should listen on this
* signal and e.g. reconfigure all permissions / acl's they have set
* in response to policy decisions made from information provided by
* PolicyKit.
*/
typedef void (*PolKitContextConfigChangedCB) (PolKitContext *pk_context,
gpointer user_data);
PolKitContext *libpolkit_context_new (void);
PolKitContext *libpolkit_context_ref (PolKitContext *pk_context);
void libpolkit_context_set_config_changed (PolKitContext *pk_context,
PolKitContextConfigChangedCB cb,
gpointer user_data);
void libpolkit_context_unref (PolKitContext *pk_context);
#endif /* LIBPOLKIT_CONTEXT_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-privilege.c : privilege
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-privilege.h"
struct PolKitPrivilege_s
{
};
PolKitPrivilege *
libpolkit_privilege_new (void)
{
return NULL;
}
PolKitPrivilege *
libpolkit_privilege_ref (PolKitPrivilege *privilege)
{
return privilege;
}
void
libpolkit_privilege_set_privilege_id (PolKitPrivilege *privilege, const char *privilege_id)
{
}
gboolean
libpolkit_privilege_get_privilege_id (PolKitPrivilege *privilege, char **out_privilege_id)
{
return FALSE;
}
void
libpolkit_privilege_unref (PolKitPrivilege *privilege)
{
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-privilege.h : privileges
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
**************************************************************************/
#ifndef LIBPOLKIT_PRIVILEGE_H
#define LIBPOLKIT_PRIVILEGE_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
struct PolKitPrivilege_s;
typedef struct PolKitPrivilege_s PolKitPrivilege;
PolKitPrivilege *libpolkit_privilege_new (void);
PolKitPrivilege *libpolkit_privilege_ref (PolKitPrivilege *privilege);
void libpolkit_privilege_set_privilege_id (PolKitPrivilege *privilege, const char *privilege_id);
gboolean libpolkit_privilege_get_privilege_id (PolKitPrivilege *privilege, char **out_privilege_id);
void libpolkit_privilege_unref (PolKitPrivilege *privilege);
#endif /* LIBPOLKIT_PRIVILEGE_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-resource.c : resources
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>
#include <glib.h>
#include "libpolkit-resource.h"
struct PolKitResource_s
{
};
PolKitResource *
libpolkit_resource_new (void)
{
return NULL;
}
PolKitResource *
libpolkit_resource_ref (PolKitResource *resource)
{
return resource;
}
void
libpolkit_resource_set_resource_type (PolKitResource *resource, const char *resource_type)
{
}
void
libpolkit_resource_set_resource_id (PolKitResource *resource, const char *resource_id)
{
}
gboolean
libpolkit_resource_get_resource_type (PolKitResource *resource, char **out_resource_type)
{
return FALSE;
}
gboolean
libpolkit_resource_get_resource_id (PolKitResource *resource, char **out_resource_id)
{
return FALSE;
}
void
libpolkit_resource_unref (PolKitResource *resource)
{
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-resource.h : resources
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
**************************************************************************/
#ifndef LIBPOLKIT_RESOURCE_H
#define LIBPOLKIT_RESOURCE_H
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <glib.h>
struct PolKitResource_s;
typedef struct PolKitResource_s PolKitResource;
PolKitResource *libpolkit_resource_new (void);
PolKitResource *libpolkit_resource_ref (PolKitResource *resource);
void libpolkit_resource_set_resource_type (PolKitResource *resource, const char *resource_type);
void libpolkit_resource_set_resource_id (PolKitResource *resource, const char *resource_id);
gboolean libpolkit_resource_get_resource_type (PolKitResource *resource, char **out_resource_type);
gboolean libpolkit_resource_get_resource_id (PolKitResource *resource, char **out_resource_id);
void libpolkit_resource_unref (PolKitResource *resource);
#endif /* LIBPOLKIT_RESOURCE_H */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* libpolkit-seat.c : seat
*
* Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <errno.h>