Commit f2bc7838 authored by David Zeuthen's avatar David Zeuthen

move all private functions into a private header file

parent bfa9f0d6
......@@ -10,6 +10,7 @@ INCLUDES = \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
-DPACKAGE_LIB_DIR=\""$(libdir)"\" \
-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT \
-DPOLKIT_COMPILATION \
@GLIB_CFLAGS@ @DBUS_CFLAGS@
lib_LTLIBRARIES=libpolkit-dbus.la
......
......@@ -45,6 +45,7 @@
#include <fcntl.h>
#include <polkit-dbus/polkit-dbus.h>
#include <polkit/polkit-private.h>
static polkit_bool_t
check_pid_for_authorization (pid_t caller_pid, const char *action_id)
......@@ -108,9 +109,6 @@ out:
return ret;
}
/* this function is in polkit/polkit-authorization-db.c */
extern polkit_bool_t _polkit_authorization_db_auth_file_add (const char *root, polkit_bool_t transient, uid_t uid, char *str_to_add);
int
main (int argc, char *argv[])
{
......
......@@ -38,7 +38,8 @@ libpolkitinclude_HEADERS = \
libpolkit_la_SOURCES = \
polkit.h \
polkit-types.h \
polkit-private.h \
polkit-types.h \
polkit-error.h polkit-error.c \
polkit-result.h polkit-result.c \
polkit-context.h polkit-context.c \
......
......@@ -41,6 +41,7 @@
#include "polkit-debug.h"
#include "polkit-authorization-constraint.h"
#include "polkit-utils.h"
#include "polkit-private.h"
/**
* SECTION:polkit-authorization-constraint
......@@ -80,8 +81,6 @@ static PolKitAuthorizationConstraint _local_active_constraint = {-1,
POLKIT_AUTHORIZATION_CONSTRAINT_REQUIRE_LOCAL |
POLKIT_AUTHORIZATION_CONSTRAINT_REQUIRE_ACTIVE};
extern PolKitAuthorizationConstraint *_polkit_authorization_constraint_new (const char *entry_in_auth_file);
PolKitAuthorizationConstraint *
_polkit_authorization_constraint_new (const char *entry_in_auth_file)
{
......
......@@ -45,9 +45,6 @@
#include "polkit-authorization-db.h"
#include "polkit-utils.h"
extern PolKitAuthorizationDB *_polkit_authorization_db_new (void);
extern void _polkit_authorization_db_invalidate_cache (PolKitAuthorizationDB *authdb);
struct _PolKitAuthorizationDB
{
int refcount;
......
......@@ -44,9 +44,7 @@
#include "polkit-debug.h"
#include "polkit-authorization-db.h"
#include "polkit-utils.h"
extern PolKitAuthorizationDB *_polkit_authorization_db_new (void);
extern void _polkit_authorization_db_invalidate_cache (PolKitAuthorizationDB *authdb);
#include "polkit-private.h"
/**
* SECTION:polkit-authorization-db
......@@ -272,8 +270,6 @@ out:
return start_time;
}
extern PolKitAuthorization *_polkit_authorization_new_for_uid (const char *entry_in_auth_file, uid_t uid);
/**
* _authdb_get_auths_for_uid:
* @authdb: authorization database
......@@ -819,9 +815,6 @@ out:
return ret;
}
/* this function is also used by polkit-dbus/polkit-explicit-grant-helper */
extern polkit_bool_t _polkit_authorization_db_auth_file_add (const char *root, polkit_bool_t transient, uid_t uid, char *str_to_add);
polkit_bool_t
_polkit_authorization_db_auth_file_add (const char *root, polkit_bool_t transient, uid_t uid, char *str_to_add)
{
......@@ -1181,9 +1174,6 @@ polkit_authorization_db_add_entry_always (PolKitAuthorizationDB *authd
return ret;
}
extern const char *_polkit_authorization_get_authfile_entry (PolKitAuthorization *auth);
/**
* polkit_authorization_db_revoke_entry:
* @authdb: the authorization database
......
......@@ -41,6 +41,7 @@
#include "polkit-debug.h"
#include "polkit-authorization.h"
#include "polkit-utils.h"
#include "polkit-private.h"
/**
* SECTION:polkit-authorization
......@@ -84,10 +85,6 @@ struct _PolKitAuthorization
char *session_id;
};
extern PolKitAuthorization *_polkit_authorization_new_for_uid (const char *entry_in_auth_file, uid_t uid);
extern const char *_polkit_authorization_get_authfile_entry (PolKitAuthorization *auth);
const char *
_polkit_authorization_get_authfile_entry (PolKitAuthorization *auth)
{
......
......@@ -43,9 +43,7 @@
#include "polkit-debug.h"
#include "polkit-context.h"
#include "polkit-policy-cache.h"
extern PolKitAuthorizationDB *_polkit_authorization_db_new (void);
extern void _polkit_authorization_db_invalidate_cache (PolKitAuthorizationDB *authdb);
#include "polkit-private.h"
/**
* SECTION:polkit
......@@ -388,8 +386,6 @@ polkit_context_set_load_descriptions (PolKitContext *pk_context)
pk_context->load_descriptions = TRUE;
}
extern PolKitPolicyCache *_polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error);
/**
* polkit_context_get_policy_cache:
* @pk_context: the context
......
......@@ -41,6 +41,7 @@
#include "polkit-debug.h"
#include "polkit-policy-file.h"
#include "polkit-policy-cache.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-cache
......@@ -76,8 +77,6 @@ _append_entry (PolKitPolicyFile *policy_file,
policy_cache->priv_entries = g_slist_append (policy_cache->priv_entries, policy_file_entry);
}
extern PolKitPolicyCache *_polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error);
PolKitPolicyCache *
_polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error)
{
......
......@@ -40,6 +40,7 @@
#include "polkit-debug.h"
#include "polkit-error.h"
#include "polkit-policy-default.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-default
......@@ -63,10 +64,6 @@ struct _PolKitPolicyDefault
PolKitResult default_active;
};
extern PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active);
PolKitPolicyDefault *
_polkit_policy_default_new (PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
......
......@@ -42,6 +42,7 @@
#include "polkit-result.h"
#include "polkit-policy-file-entry.h"
#include "polkit-authorization-db.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-file-entry
......@@ -68,23 +69,9 @@ struct _PolKitPolicyFileEntry
GHashTable *annotations;
};
extern void _polkit_policy_file_entry_set_descriptions (PolKitPolicyFileEntry *pfe,
const char *policy_description,
const char *policy_message);
extern PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active);
extern PolKitPolicyFileEntry *_polkit_policy_file_entry_new (const char *action_id,
PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active,
GHashTable *annotations);
/* NOTE: we take ownership of the annotations object */
extern PolKitPolicyFileEntry *
PolKitPolicyFileEntry *
_polkit_policy_file_entry_new (const char *action_id,
PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
......
......@@ -45,6 +45,7 @@
#include "polkit-policy-file.h"
#include "polkit-policy-file-entry.h"
#include "polkit-debug.h"
#include "polkit-private.h"
/**
* SECTION:polkit-policy-file
......@@ -66,12 +67,6 @@ struct _PolKitPolicyFile
GSList *entries;
};
extern PolKitPolicyFileEntry *_polkit_policy_file_entry_new (const char *action_id,
PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active,
GHashTable *annotations);
enum {
STATE_NONE,
STATE_UNKNOWN_TAG,
......@@ -308,11 +303,6 @@ error:
XML_StopParser (pd->parser, FALSE);
}
extern void _polkit_policy_file_entry_set_descriptions (PolKitPolicyFileEntry *pfe,
const char *policy_description,
const char *policy_message);
/**
* _localize:
* @translations: a mapping from xml:lang to the value, e.g. 'da' -> 'Smadre', 'en_CA' -> 'Punch, Aye!'
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/***************************************************************************
*
* polkit-private.h : Private functions
*
* 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
*
**************************************************************************/
#if !defined (POLKIT_COMPILATION)
#error "This is a private file and shouldn't be included outside PolicyKit."
#endif
#ifndef POLKIT_PRIVATE_H
#define POLKIT_PRIVATE_H
#include <glib.h>
#include <polkit/polkit.h>
POLKIT_BEGIN_DECLS
PolKitAuthorization *_polkit_authorization_new_for_uid (const char *entry_in_auth_file, uid_t uid);
const char *_polkit_authorization_get_authfile_entry (PolKitAuthorization *auth);
PolKitAuthorizationConstraint *_polkit_authorization_constraint_new (const char *entry_in_auth_file);
PolKitAuthorizationDB *_polkit_authorization_db_new (void);
void _polkit_authorization_db_invalidate_cache (PolKitAuthorizationDB *authdb);
PolKitAuthorization *_polkit_authorization_new_for_uid (const char *entry_in_auth_file, uid_t uid);
polkit_bool_t _polkit_authorization_db_auth_file_add (const char *root, polkit_bool_t transient, uid_t uid, char *str_to_add);
const char *_polkit_authorization_get_authfile_entry (PolKitAuthorization *auth);
PolKitAuthorizationDB *_polkit_authorization_db_new (void);
void _polkit_authorization_db_invalidate_cache (PolKitAuthorizationDB *authdb);
PolKitPolicyCache *_polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error);
PolKitPolicyCache *_polkit_policy_cache_new (const char *dirname, polkit_bool_t load_descriptions, PolKitError **error);
PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active);
PolKitPolicyFileEntry *_polkit_policy_file_entry_new (const char *action_id,
PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active,
GHashTable *annotations);
void _polkit_policy_file_entry_set_descriptions (PolKitPolicyFileEntry *pfe,
const char *policy_description,
const char *policy_message);
PolKitPolicyDefault *_polkit_policy_default_new (PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active);
PolKitPolicyFileEntry *_polkit_policy_file_entry_new (const char *action_id,
PolKitResult defaults_allow_any,
PolKitResult defaults_allow_inactive,
PolKitResult defaults_allow_active,
GHashTable *annotations);
void _polkit_policy_file_entry_set_descriptions (PolKitPolicyFileEntry *pfe,
const char *policy_description,
const char *policy_message);
POLKIT_END_DECLS
#endif /* POLKIT_PRIVATE_H */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment