From 68c324ae8a0b85b4afe4a8cf051f0b552149ee69 Mon Sep 17 00:00:00 2001 From: Søren Sandmann Date: Tue, 25 Mar 2008 00:59:56 -0400 Subject: Get rid of g types from public interface --- src/lac.h | 174 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/src/lac.h b/src/lac.h index b2f7c84..32c5dcf 100644 --- a/src/lac.h +++ b/src/lac.h @@ -56,23 +56,23 @@ typedef void (* LacAddressFunc) (const LacAddress *address, typedef void (* LacAddressesFunc) (const GPtrArray *addresses, gpointer data, const GError *err); -typedef void (* LacNameFunc) (const gchar *name, +typedef void (* LacNameFunc) (const char *name, gpointer data, const GError *err); -LacAddress *lac_address_new_from_a_b_c_d (gchar a, - gchar b, - gchar c, - gchar d); -LacAddress *lac_address_new_from_string (const gchar *str); +LacAddress *lac_address_new_from_a_b_c_d (char a, + char b, + char c, + char d); +LacAddress *lac_address_new_from_string (const char *str); -void lac_address_new_lookup_from_name (const gchar *name, +void lac_address_new_lookup_from_name (const char *name, LacAddressFunc f, gpointer data); -void lac_address_new_lookup_all_from_name (const gchar *name, +void lac_address_new_lookup_all_from_name (const char *name, LacAddressesFunc f, gpointer data); -LacAddress *lac_address_new_from_name_wait (const gchar *name, +LacAddress *lac_address_new_from_name_wait (const char *name, GError **err); void lac_address_new_lookup_from_localhost (LacAddressFunc f, gpointer data); @@ -80,11 +80,11 @@ LacAddress *lac_address_new_from_localhost_wait (GError **err); void lac_address_lookup_name (const LacAddress *addr, LacNameFunc f, gpointer data); -gchar * lac_address_lookup_name_wait (const LacAddress *addr, +char * lac_address_lookup_name_wait (const LacAddress *addr, GError **err); -gchar * lac_address_to_string (const LacAddress *addr); +char * lac_address_to_string (const LacAddress *addr); guint lac_address_hash (gconstpointer addr); -gint lac_address_compare (gconstpointer addr1, +int lac_address_compare (gconstpointer addr1, gconstpointer addr2); gboolean lac_address_equal (gconstpointer addr1, gconstpointer addr2); @@ -92,10 +92,10 @@ LacAddress *lac_address_copy (const LacAddress *addr); void lac_address_free (LacAddress *addr); #ifdef LAC_IPV6_UNSAFE void lac_address_get_a_b_c_d (const LacAddress *addr, - gint *a, - gint *b, - gint *c, - gint *d); + int *a, + int *b, + int *c, + int *d); #endif /* @@ -129,79 +129,79 @@ typedef enum { void lac_sigpipe_ignore (void); void lac_sigpipe_default (void); -gboolean lac_close (gint fd, +gboolean lac_close (int fd, GError **err); -gboolean lac_shutdown (gint fd, +gboolean lac_shutdown (int fd, LacShutdownMethod how, GError **err); -gboolean lac_set_blocking (gint fd, +gboolean lac_set_blocking (int fd, gboolean blocking, GError **err); -gboolean lac_listen (gint fd, +gboolean lac_listen (int fd, guint backlog, GError **err); -gint lac_send (gint fd, - const gchar *msg, +int lac_send (int fd, + const char *msg, guint len, GError **err); -gint lac_recv (gint fd, - gchar *buf, +int lac_recv (int fd, + char *buf, guint len, GError **err); -gint lac_sendto (gint fd, - gchar *buf, +int lac_sendto (int fd, + char *buf, guint len, const LacAddress *address, - gint port, + int port, GError **err); -gint lac_recvfrom (gint fd, - gchar *buf, +int lac_recvfrom (int fd, + char *buf, guint len, LacAddress **address, - gint *port, + int *port, GError **err); -gint lac_socket_tcp (GError **err); -gint lac_socket_udp (GError **err); -gboolean lac_set_nagle (gint fd, +int lac_socket_tcp (GError **err); +int lac_socket_udp (GError **err); +gboolean lac_set_nagle (int fd, gboolean use_nagle, GError **err); -gboolean lac_bind (gint fd, +gboolean lac_bind (int fd, const LacAddress *address, - gint port, + int port, GError **err); -gint lac_accept (gint fd, +int lac_accept (int fd, LacAddress **addr, - gint *port, + int *port, GError **err); -gboolean lac_connect (gint fd, +gboolean lac_connect (int fd, const LacAddress *address, - gint port, + int port, GError **err); -gboolean lac_getpeername (gint fd, +gboolean lac_getpeername (int fd, LacAddress **addr, - gint *port, + int *port, GError **err); -gchar * lac_gethostname (void); +char * lac_gethostname (void); /* LacByteQueue */ typedef struct LacByteQueue LacByteQueue; LacByteQueue *lac_byte_queue_new (void); -gchar *lac_byte_queue_free (LacByteQueue *queue, +char *lac_byte_queue_free (LacByteQueue *queue, gboolean free_data); gsize lac_byte_queue_get_length (LacByteQueue *queue); gboolean lac_byte_queue_is_empty (LacByteQueue *queue); -const gchar *lac_byte_queue_peek (LacByteQueue *queue, +const char *lac_byte_queue_peek (LacByteQueue *queue, gsize *n_bytes); -gchar *lac_byte_queue_steal (LacByteQueue *queue, +char *lac_byte_queue_steal (LacByteQueue *queue, gsize *n_bytes); -gchar *lac_byte_queue_alloc_tail (LacByteQueue *queue, +char *lac_byte_queue_alloc_tail (LacByteQueue *queue, gsize size); void lac_byte_queue_append (LacByteQueue *queue, - const gchar *bytes, + const char *bytes, gsize n_bytes); void lac_byte_queue_append_printf (LacByteQueue *queue, - const gchar *fmt, + const char *fmt, ...); void lac_byte_queue_swap_content (LacByteQueue *q1, LacByteQueue *q2); @@ -218,20 +218,20 @@ void lac_byte_queue_delete_tail (LacByteQueue *queue, */ typedef void (* LacWatchCallback) (gpointer data); -void lac_fd_add_watch (gint fd, +void lac_fd_add_watch (int fd, gpointer data); -void lac_fd_set_read_callback (gint fd, +void lac_fd_set_read_callback (int fd, LacWatchCallback read_cb); -void lac_fd_set_write_callback (gint fd, +void lac_fd_set_write_callback (int fd, LacWatchCallback write_cb); -void lac_fd_set_hangup_callback (gint fd, +void lac_fd_set_hangup_callback (int fd, LacWatchCallback hangup_cb); -void lac_fd_set_error_callback (gint fd, +void lac_fd_set_error_callback (int fd, LacWatchCallback error_cb); -void lac_fd_set_priority_callback (gint fd, +void lac_fd_set_priority_callback (int fd, LacWatchCallback priority_cb); -void lac_fd_remove_watch (gint fd); -gboolean lac_fd_is_watched (gint fd); +void lac_fd_remove_watch (int fd); +gboolean lac_fd_is_watched (int fd); /* * Connection @@ -254,7 +254,7 @@ typedef struct { gpointer _lac_reserved0; gpointer _lac_reserved1; LacByteQueue *byte_queue; - const gchar *data; + const char *data; guint len; } LacConnectionReadEvent; @@ -283,24 +283,24 @@ typedef void (* LacConnectionFunc) (LacConnection *connection, const LacConnectionEvent *event); LacConnection * lac_connection_new_tcp (const LacAddress *address, - gint port, + int port, LacConnectionFunc callback, gpointer data); LacConnection * lac_connection_new_tls (const LacAddress *address, - gint port, + int port, LacConnectionFunc callback, gpointer data); gpointer lac_connection_get_data (LacConnection *connection); void lac_connection_write (LacConnection *connection, - const gchar *data, + const char *data, guint len); void lac_connection_write_cstr (LacConnection *connection, - const gchar *data); + const char *data); void lac_connection_shutdown_write (LacConnection *connection); LacConnection * lac_connection_ref (LacConnection *connection); void lac_connection_unref (LacConnection *connection); const LacAddress *lac_connection_get_address (LacConnection *connection); -gint lac_connection_get_port (LacConnection *connection); +int lac_connection_get_port (LacConnection *connection); void lac_connection_close (LacConnection *connection); gboolean lac_connection_is_connected (LacConnection *connection); void lac_connection_flush (LacConnection *connection); @@ -328,36 +328,36 @@ struct _LacUri { LacScheme scheme; union { struct { - gchar *scheme; - gchar *authority; - gchar *path; - gchar *query; + char *scheme; + char *authority; + char *path; + char *query; } unknown; struct { - gchar *host; + char *host; guint port; - gchar *path; - gchar *query; + char *path; + char *query; gboolean is_https; } http; struct { - gchar *host; - gchar *username; - gchar *password; + char *host; + char *username; + char *password; guint port; - gchar *path; + char *path; LacFtpType type; } ftp; } u; - gchar *fragment; + char *fragment; guint checksum; /* used internally */ }; LacUri * lac_uri_new_from_string (const LacUri *base, - const gchar *str); + const char *str); LacUri * lac_uri_copy (const LacUri *uri); -gchar * lac_uri_string (const LacUri *uri); +char * lac_uri_string (const LacUri *uri); gboolean lac_uri_equal (const LacUri *uri1, const LacUri *uri2); void lac_uri_free (LacUri *uri); @@ -402,11 +402,11 @@ LacHttpRequest *lac_http_request_new_delete (const LacUri *uri, LacHttpFunc func, gpointer data); void lac_http_request_add_content (LacHttpRequest *request, - const gchar *content, + const char *content, gsize length); void lac_http_request_add_header (LacHttpRequest *request, - const gchar *header, - const gchar *value); + const char *header, + const char *value); gpointer lac_http_request_get_data (LacHttpRequest *request); void lac_http_request_dispatch (LacHttpRequest *request); void lac_http_request_cancel (LacHttpRequest *request); @@ -435,10 +435,10 @@ typedef struct { typedef struct { LacHttpEventType type; - gint status_code; - gint major; /* major version number */ - gint minor; /* minor version number */ - const gchar * reason_phrase; + int status_code; + int major; /* major version number */ + int minor; /* minor version number */ + const char * reason_phrase; } LacHttpStatusLineEvent; typedef struct { @@ -447,13 +447,13 @@ typedef struct { typedef struct { LacHttpEventType type; - const gchar * header; - const gchar * value; + const char * header; + const char * value; } LacHttpHeaderEvent; typedef struct { LacHttpEventType type; - gint length; /* total length of content in bytes, + int length; /* total length of content in bytes, * -1 if unknown */ } LacHttpBeginContentEvent; @@ -467,7 +467,7 @@ typedef struct { typedef struct { LacHttpEventType type; - gint total; + int total; } LacHttpEndContentEvent; typedef struct { -- cgit v1.2.3