Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

GTaskConnection


Data Structures

struct  _GTaskConnection
struct  _GTaskConnectionClass
struct  _GTaskConnectionPrivate

Defines

#define GTASK_CONNECTION_TYPE   (gtask_connection_get_type())
#define GTASK_CONNECTION(obj)
#define GTASK_CONNECTION_CLASS(klass)
#define GTASK_IS_CONNECTION(obj)
#define GTASK_IS_CONNECTION_CLASS(klass)
#define GTASK_CONNECTION_GET_CLASS(obj)
#define GTASK_ROLE_TYPE   (gtask_role_get_type())

Typedefs

typedef _GTaskConnection GTaskConnection
typedef _GTaskConnectionPrivate GTaskConnectionPrivate
typedef _GTaskConnectionClass GTaskConnectionClass

Enumerations

enum  {
  PROP_0, PROP_NAME, PROP_ROLE, PROP_STREAM_PARSER,
  PROP_EVENT_PARSER
}
enum  GTaskRole { GTASK_ROLE_NONE, GTASK_ROLE_PROXY, GTASK_ROLE_REPORTER, GTASK_ROLE_PROVIDER }
enum  GTaskConnectionMethod { GTASK_CONNECTION_METHOD_SOCKET, GTASK_CONNECTION_METHOD_LOOPBACK, GTASK_CONNECTION_METHOD_FD, GTASK_CONNECTION_METHOD_UNKNOWN }

Functions

gboolean gtask_connection_write (GTaskConnection *conn, char *buff)
 writes a c string directly to the file descriptor this function is for debug purposes only and will eventually vanish

void gtask_connection_class_init (GTaskConnectionClass *klass)
void gtask_connection_init (GTaskConnection *connection, gpointer g_class)
 initializes a GTaskConnection

void gtask_connection_finalize (GObject *obj)
 finalizes a GTaskConnection

gboolean gtask_connection_init_xml_buffers (GTaskConnection *conn)
 creates the output output buffer to be used by libxml

gboolean gtask_connection_init_gio_channels (GTaskConnection *conn)
 creates the input channel to be used by glib

void gtask_connection_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec)
void gtask_connection_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec)
GType gtask_role_get_type ()
GType gtask_connection_get_type (void)
 registers the GTaskConnection object with the GObject system if that has yet to be done and then returns the GType for GTaskConnection

GTaskConnectiongtask_connection_new ()
 creates a new GTaskConnection

GTaskConnectiongtask_connection_new_with_properties (const gchar *name, GTaskRole role)
gchar * gtask_connection_default_server_bind_path ()
 returns the default location of the socket that the gtask daemon will create to communicate with its' clients.

gboolean gtask_connection_connect_domain_socket_default (GTaskConnection *conn)
 attempts to connect to the default unix domain socket used by the gtask daemon (usually $HOME/.gtaskd/server/socket)

gboolean gtask_connection_connect_domain_socket (GTaskConnection *conn, const char *file)
 attempts to initiate a connection to the passed in file (while should be a valid unix domain socket)

gboolean gtask_connection_connect_loopback (GTaskConnection *conn)
gboolean gtask_connection_connection_broken (GIOChannel *source, GIOCondition cond, gpointer data)
gboolean gtask_connection_connect_fd (GTaskConnection *conn, int inp_fd, int out_fd)
 connects a GTaskConnection to a file descriptor

gboolean gtask_connection_is_connected (GTaskConnection *conn)
 determines if the passed in GTaskConnection has been connected to something

gint gtask_connection_get_input_fd (GTaskConnection *conn)
 returns the unix file descriptor that the connection is receiving its input from

gint gtask_connection_get_output_fd (GTaskConnection *conn)
 returns the unix file descriptor that the connection is sending its output to

gboolean gtask_connection_close (GTaskConnection *conn)
 closes all filehandles held by the GTaskConnection

GIOChannel * gtask_connection_get_gio_input_channel (GTaskConnection *conn)
 Returns the GIOChannel that is used for input.

xmlOutputBufferPtr gtask_connection_get_xml_output_buffer (GTaskConnection *conn)
 Returns the xmlOutputBufferPtr to be used by libxml.

const gchar * gtask_connection_get_name (GTaskConnection *conn)
 Returns the name of the GTaskConnection.

void gtask_connection_set_name (GTaskConnection *conn, const gchar *name)
 Sets the name of the GTaskConnection.

GTaskRole gtask_connection_get_role (GTaskConnection *conn)
 Returns the GTaskRole of the passed in GTaskConnection.

void gtask_connection_set_role (GTaskConnection *conn, GTaskRole role)
 Sets the GTaskRole of the passed in GTaskConnection.

GTaskStreamParsergtask_connection_get_stream_parser (GTaskConnection *conn)
 Returns the GTaskStreamParser that is being used to parse the input from the passed in GTaskConnection.

GTaskEventDispatchergtask_connection_get_event_dispatcher (GTaskConnection *conn)
 Returns the GTaskEventDispatcher for the passed in GTaskConnection.

gboolean gtask_connection_is_connection (GTaskConnection *conn)

Variables

gpointer parent_class

Define Documentation

#define GTASK_CONNECTION obj   ) 
 

Value:

(G_TYPE_CHECK_INSTANCE_CAST( (obj), \
                                          GTASK_CONNECTION_TYPE, \
                                          GTaskConnection ))
casts the passed in object to a GTaskConnection

Definition at line 23 of file gtask-connection.h.

#define GTASK_CONNECTION_CLASS klass   ) 
 

Value:

(G_TYPE_CHECK_CLASS_CAST( (klass), \
                                          GTASK_CONNECTION_TYPE, \
                                          GTaskConnectionClass ))
casts the passed in object to a GTaskConnectionClass

Definition at line 28 of file gtask-connection.h.

#define GTASK_CONNECTION_GET_CLASS obj   ) 
 

Value:

(G_TYPE_INSTANCE_GET_CLASS( (obj), \
                                          GTASK_CONNECTION_TYPE, \
                                          GTaskConnectionClass ))

Definition at line 46 of file gtask-connection.h.

#define GTASK_CONNECTION_TYPE   (gtask_connection_get_type())
 

returns the GType of GTaskConnection

Definition at line 20 of file gtask-connection.h.

#define GTASK_IS_CONNECTION obj   ) 
 

Value:

(G_TYPE_CHECK_INSTANCE_TYPE( (obj), \
                                          GTASK_CONNECTION_TYPE ))
returns TRUE if the passed in object is a GTaskConnection, FALSE otherwise

Definition at line 36 of file gtask-connection.h.

#define GTASK_IS_CONNECTION_CLASS klass   ) 
 

Value:

(G_TYPE_CHECK_CLASS_TYPE( (klass), \
                                          GTASK_CONNECTION_TYPE ))
returns TRUE if the passed in object is a GTaskConnectionClass, FALSE otherwise

Definition at line 43 of file gtask-connection.h.

#define GTASK_ROLE_TYPE   (gtask_role_get_type())
 

Definition at line 64 of file gtask-connection.h.


Typedef Documentation

typedef struct _GTaskConnection GTaskConnection
 

Definition at line 15 of file gtask-connection.h.

typedef struct _GTaskConnectionClass GTaskConnectionClass
 

Definition at line 17 of file gtask-connection.h.

typedef struct _GTaskConnectionPrivate GTaskConnectionPrivate
 

Definition at line 16 of file gtask-connection.h.


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
PROP_0 
PROP_NAME 
PROP_ROLE 
PROP_STREAM_PARSER 
PROP_EVENT_PARSER 

Definition at line 16 of file gtask-connection.c.

enum GTaskConnectionMethod
 

Enumeration values:
GTASK_CONNECTION_METHOD_SOCKET 
GTASK_CONNECTION_METHOD_LOOPBACK 
GTASK_CONNECTION_METHOD_FD 
GTASK_CONNECTION_METHOD_UNKNOWN 

Definition at line 57 of file gtask-connection.h.

enum GTaskRole
 

Enumeration values:
GTASK_ROLE_NONE  no role has been specified
GTASK_ROLE_PROXY  the proxy role -- callbacks, etc are sent back to another gtask server for exectution
GTASK_ROLE_REPORTER  the reporter role -- the ui displaying tasks
GTASK_ROLE_PROVIDER  the provider role -- the program creating tasks

Definition at line 50 of file gtask-connection.h.


Function Documentation

void gtask_connection_class_init GTaskConnectionClass klass  )  [static]
 

Definition at line 109 of file gtask-connection.c.

gboolean gtask_connection_close GTaskConnection conn  ) 
 

closes all filehandles held by the GTaskConnection

Author:
Michael Henson
Parameters:
conn a GTaskConnection
Returns:
the success/failure of the operation

Definition at line 668 of file gtask-connection.c.

gboolean gtask_connection_connect_domain_socket GTaskConnection conn,
const char *  file
 

attempts to initiate a connection to the passed in file (while should be a valid unix domain socket)

Author:
Michael Henson
Parameters:
conn a GTaskConnection
file a file (should be a domain socket) to connect to
Returns:
the success/failure of the operation
Todo:
much better error messages here

Definition at line 338 of file gtask-connection.c.

gboolean gtask_connection_connect_domain_socket_default GTaskConnection conn  ) 
 

attempts to connect to the default unix domain socket used by the gtask daemon (usually $HOME/.gtaskd/server/socket)

Author:
Michael Henson
Parameters:
conn a GTaskConnection
Returns:
the success/failure of the operation

Definition at line 310 of file gtask-connection.c.

gboolean gtask_connection_connect_fd GTaskConnection conn,
int  inp_fd,
int  out_fd
 

connects a GTaskConnection to a file descriptor

Author:
Michael Henson
Parameters:
conn a GTaskConnection
inp_fd a unix file descriptor (for input)
out_fd a unix file descriptor (for output)
Returns:
the success/failure of the operation
Todo:
decide how we want to handle roles

Definition at line 524 of file gtask-connection.c.

gboolean gtask_connection_connect_loopback GTaskConnection conn  ) 
 

Todo:
more checking

Definition at line 382 of file gtask-connection.c.

gboolean gtask_connection_connection_broken GIOChannel *  source,
GIOCondition  cond,
gpointer  data
[static]
 

Todo:
one again -- perhaps just formally close down the end of the pipe that spazzed, as opposed to everything?

write up the reconnection code

Definition at line 479 of file gtask-connection.c.

char * gtask_connection_default_server_bind_path void   ) 
 

returns the default location of the socket that the gtask daemon will create to communicate with its' clients.

Attention:
It is the caller's responsibility to free the returned string.
Author:
Michael Henson
Returns:
the location of the unix domain socket.

Definition at line 295 of file gtask-connection.c.

void gtask_connection_finalize GObject *  obj  )  [static]
 

finalizes a GTaskConnection

Author:
Michael Henson
Parameters:
conn a GTaskConnection

Definition at line 613 of file gtask-connection.c.

GTaskEventDispatcher * gtask_connection_get_event_dispatcher GTaskConnection conn  ) 
 

Returns the GTaskEventDispatcher for the passed in GTaskConnection.

Attention:
This function does not increment the reference count of the GTaskEventDispatcher that is returned.
Parameters:
conn a GTaskConnection.
Returns:
the GTaskEventDispatcher

Definition at line 837 of file gtask-connection.c.

GIOChannel * gtask_connection_get_gio_input_channel GTaskConnection conn  ) 
 

Returns the GIOChannel that is used for input.

Attention:
This function does not add any additional references to the GIOChannel that is returned.
Author:
Michael Henson
Parameters:
conn a GTaskConnection
Returns:
the GIOChannel or NULL if not connected

Definition at line 726 of file gtask-connection.c.

int gtask_connection_get_input_fd GTaskConnection conn  ) 
 

returns the unix file descriptor that the connection is receiving its input from

Author:
Michael Henson
Parameters:
conn a GTaskConnection
Returns:
a unix file descriptor of -1 if not connected

Definition at line 635 of file gtask-connection.c.

const gchar * gtask_connection_get_name GTaskConnection conn  ) 
 

Returns the name of the GTaskConnection.

Attention:
The returned string should be considered a read only value.
Parameters:
conn a GTaskConnection
Returns:
the name of the GTaskConnection

Definition at line 757 of file gtask-connection.c.

int gtask_connection_get_output_fd GTaskConnection conn  ) 
 

returns the unix file descriptor that the connection is sending its output to

Author:
Michael Henson
Parameters:
conn a GTaskConnection
Returns:
a unix file descriptor or -1 if not connected

Definition at line 652 of file gtask-connection.c.

void gtask_connection_get_property GObject *  object,
guint  param_id,
GValue *  value,
GParamSpec *  pspec
[static]
 

Definition at line 183 of file gtask-connection.c.

GTaskRole gtask_connection_get_role GTaskConnection conn  ) 
 

Returns the GTaskRole of the passed in GTaskConnection.

Parameters:
conn a GTaskConnetion
Returns:
the GTaskRole

Definition at line 787 of file gtask-connection.c.

GTaskStreamParser * gtask_connection_get_stream_parser GTaskConnection conn  ) 
 

Returns the GTaskStreamParser that is being used to parse the input from the passed in GTaskConnection.

Attention:
This function does not increment the reference count of the the GTaskStreamParser that is returned.
Parameters:
conn a GTaskConnection
Returns:
the GTaskStreamParser

Definition at line 820 of file gtask-connection.c.

GType gtask_connection_get_type void   ) 
 

registers the GTaskConnection object with the GObject system if that has yet to be done and then returns the GType for GTaskConnection

Author:
Michael Henson
Returns:
the GType object for GTaskConnection

Definition at line 83 of file gtask-connection.c.

xmlOutputBufferPtr gtask_connection_get_xml_output_buffer GTaskConnection conn  ) 
 

Returns the xmlOutputBufferPtr to be used by libxml.

Author:
Michael Henson
Returns:
the output buffer or NULL is not connected

Definition at line 740 of file gtask-connection.c.

void gtask_connection_init GTaskConnection connection,
gpointer  g_class
[static]
 

initializes a GTaskConnection

Author:
Michael Henson

Definition at line 238 of file gtask-connection.c.

gboolean gtask_connection_init_gio_channels GTaskConnection conn  )  [static]
 

creates the input channel to be used by glib

Author:
Michael Henson
Parameters:
conn a GTaskConnection
Returns:
the success/failure of the operation

Definition at line 446 of file gtask-connection.c.

gboolean gtask_connection_init_xml_buffers GTaskConnection conn  )  [static]
 

creates the output output buffer to be used by libxml

Author:
Michael Henson
Parameters:
conn a GTaskConnection
Returns:
the sucess/failure of the operation

Definition at line 420 of file gtask-connection.c.

gboolean gtask_connection_is_connected GTaskConnection conn  ) 
 

determines if the passed in GTaskConnection has been connected to something

Author:
Michael Henson
Parameters:
conn a GTaskConnetion
Returns:
TRUE if connected, FALSE otherwise

Definition at line 598 of file gtask-connection.c.

gboolean gtask_connection_is_connection GTaskConnection conn  ) 
 

GTaskConnection * gtask_connection_new void   ) 
 

creates a new GTaskConnection

Author:
Michael Henson
Returns:
the new GTaskConnection

Definition at line 268 of file gtask-connection.c.

GTaskConnection * gtask_connection_new_with_properties const gchar *  name,
GTaskRole  role
 

Definition at line 273 of file gtask-connection.c.

void gtask_connection_set_name GTaskConnection conn,
const gchar *  name
 

Sets the name of the GTaskConnection.

Parameters:
conn a GTaskConnection
name the new name for the GTaskConnection

Definition at line 770 of file gtask-connection.c.

void gtask_connection_set_property GObject *  object,
guint  param_id,
const GValue *  value,
GParamSpec *  pspec
[static]
 

Definition at line 163 of file gtask-connection.c.

void gtask_connection_set_role GTaskConnection conn,
GTaskRole  role
 

Sets the GTaskRole of the passed in GTaskConnection.

Parameters:
conn a GTaskConnection
role a GTaskRole

Definition at line 800 of file gtask-connection.c.

gboolean gtask_connection_write GTaskConnection conn,
char *  buff
[static]
 

writes a c string directly to the file descriptor this function is for debug purposes only and will eventually vanish

Author:
Michael Henson
Parameters:
conn a GTaskConnection
buff the string to write out
Returns:
the success/failure of the operation

Definition at line 215 of file gtask-connection.c.

GType gtask_role_get_type void   ) 
 

Definition at line 56 of file gtask-connection.c.


Variable Documentation

gpointer parent_class [static]
 

Definition at line 24 of file gtask-connection.c.


Generated on Mon Feb 2 21:26:17 2004 for libgtask by doxygen 1.3.4