Core API Reference - Session
Desktop Apps Training - Policy Kit

Session

Session — Represents a ConsoleKit Session.

 

Synopsis



PolKitSession;
PolKitSession* polkit_session_new (void);
PolKitSession* polkit_session_ref (PolKitSession *session);
void polkit_session_unref (PolKitSession *session);
polkit_bool_t polkit_session_set_uid (PolKitSession *session,
uid_t uid);
polkit_bool_t polkit_session_set_seat (PolKitSession *session,
PolKitSeat *seat);
polkit_bool_t polkit_session_set_ck_objref (PolKitSession *session,
const char *ck_objref);
polkit_bool_t polkit_session_set_ck_is_active (PolKitSession *session,
polkit_bool_t is_active);
polkit_bool_t polkit_session_set_ck_is_local (PolKitSession *session,
polkit_bool_t is_local);
polkit_bool_t polkit_session_set_ck_remote_host (PolKitSession *session,
const char *remote_host);
polkit_bool_t polkit_session_get_uid (PolKitSession *session,
uid_t *out_uid);
polkit_bool_t polkit_session_get_seat (PolKitSession *session,
PolKitSeat **out_seat);
polkit_bool_t polkit_session_get_ck_objref (PolKitSession *session,
char **out_ck_objref);
polkit_bool_t polkit_session_get_ck_is_active (PolKitSession *session,
polkit_bool_t *out_is_active);
polkit_bool_t polkit_session_get_ck_is_local (PolKitSession *session,
polkit_bool_t *out_is_local);
polkit_bool_t polkit_session_get_ck_remote_host (PolKitSession *session,
char **out_remote_host);
void polkit_session_debug (PolKitSession *session);
polkit_bool_t polkit_session_validate (PolKitSession *session);

Description

This class is used to represent a session.

 

Details

PolKitSession

typedef struct _PolKitSession PolKitSession;

Objects of this class are used to record information about a session.

 


polkit_session_new ()

PolKitSession*      polkit_session_new                  (void);

Creates a new PolKitSession object.

 

Returns :

the new object

polkit_session_ref ()

PolKitSession*      polkit_session_ref                  (PolKitSession *session);

Increase reference count.

 

session :

The session object

Returns :

the object

polkit_session_unref ()

void                polkit_session_unref                (PolKitSession *session);

Decreases the reference count of the object. If it becomes zero, the object is freed. Before freeing, reference counts on embedded objects are decresed by one.

 

session :

The session object

polkit_session_set_uid ()

polkit_bool_t       polkit_session_set_uid              (PolKitSession *session,
uid_t uid);

Set the UNIX user id of the user owning the session.

 

session :

The session object

uid :

UNIX user id

Returns :

TRUE only if the value validated and was set

polkit_session_set_seat ()

polkit_bool_t       polkit_session_set_seat             (PolKitSession *session,
PolKitSeat *seat);

Set the seat that the session belongs to. The reference count on the given object will be increased by one. If an existing seat object was set already, the reference count on that one will be decreased by one.

 

session :

The session object

seat :

a PolKitSeat object

Returns :

TRUE only if the value validated and was set

polkit_session_set_ck_objref ()

polkit_bool_t       polkit_session_set_ck_objref        (PolKitSession *session,
const char *ck_objref);

Set the D-Bus object path to the ConsoleKit session object.

 

session :

The session object

ck_objref :

D-Bus object path

Returns :

TRUE only if the value validated and was set

polkit_session_set_ck_is_active ()

polkit_bool_t       polkit_session_set_ck_is_active     (PolKitSession *session,
polkit_bool_t is_active);

Set whether ConsoleKit regard the session as active.

 

session :

The session object

is_active :

whether ConsoleKit reports the session as active

Returns :

TRUE only if the value validated and was set

polkit_session_set_ck_is_local ()

polkit_bool_t       polkit_session_set_ck_is_local      (PolKitSession *session,
polkit_bool_t is_local);

Set whether ConsoleKit regard the session as local.

 

session :

The session object

is_local :

whether ConsoleKit reports the session as local

Returns :

TRUE only if the value validated and was set

polkit_session_set_ck_remote_host ()

polkit_bool_t       polkit_session_set_ck_remote_host   (PolKitSession *session,
const char *remote_host);

Set the remote host/display that ConsoleKit reports the session to occur at.

 

session :

The session object

remote_host :

hostname of the host/display that ConsoleKit reports the session to occur at

Returns :

TRUE only if the value validated and was set

polkit_session_get_uid ()

polkit_bool_t       polkit_session_get_uid              (PolKitSession *session,
uid_t *out_uid);

Get the UNIX user id of the user owning the session.

 

session :

The session object

out_uid :

UNIX user id

Returns :

TRUE iff the value is returned

polkit_session_get_seat ()

polkit_bool_t       polkit_session_get_seat             (PolKitSession *session,
PolKitSeat **out_seat);

Get the seat that the session belongs to.

 

session :

The session object

out_seat :

Returns the seat the session belongs to. Shall not be unreffed by the caller.

Returns :

TRUE iff the value is returned

polkit_session_get_ck_objref ()

polkit_bool_t       polkit_session_get_ck_objref        (PolKitSession *session,
char **out_ck_objref);

Get the D-Bus object path to the ConsoleKit session object.

 

session :

The session object

out_ck_objref :

D-Bus object path. Shall not be freed by the caller.

Returns :

TRUE iff the value is returned

polkit_session_get_ck_is_active ()

polkit_bool_t       polkit_session_get_ck_is_active     (PolKitSession *session,
polkit_bool_t *out_is_active);

Get whether ConsoleKit regard the session as active.

 

session :

The session object

out_is_active :

whether ConsoleKit reports the session as active

Returns :

TRUE iff the value is returned

polkit_session_get_ck_is_local ()

polkit_bool_t       polkit_session_get_ck_is_local      (PolKitSession *session,
polkit_bool_t *out_is_local);

Set whether ConsoleKit regard the session as local.

 

session :

The session object

out_is_local :

whether ConsoleKit reports the session as local

Returns :

TRUE iff the value is returned

polkit_session_get_ck_remote_host ()

polkit_bool_t       polkit_session_get_ck_remote_host   (PolKitSession *session,
char **out_remote_host);

Get the remote host/display that ConsoleKit reports the session to occur at.

 

session :

The session object

out_remote_host :

hostname of the host/display that ConsoleKit reports the session to occur at. Shall not be freed by the caller.

Returns :

TRUE iff the value is returned

polkit_session_debug ()

void                polkit_session_debug                (PolKitSession *session);

Print debug details

 

session :

the object

polkit_session_validate ()

polkit_bool_t       polkit_session_validate             (PolKitSession *session);

Validate the object

 

session :

the object

Returns :

TRUE iff the object is valid.