aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas/pas-book.h
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-03-08 08:51:11 +0800
committerChris Toshok <toshok@src.gnome.org>2002-03-08 08:51:11 +0800
commitda6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6 (patch)
tree613214c31c5e45a6a21357a2e8ca652c2294e413 /addressbook/backend/pas/pas-book.h
parenta9791c82f0513cdeb607c94f8b73c8040dc16bf5 (diff)
downloadgsoc2013-evolution-da6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6.tar
gsoc2013-evolution-da6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6.tar.gz
gsoc2013-evolution-da6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6.tar.bz2
gsoc2013-evolution-da6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6.tar.lz
gsoc2013-evolution-da6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6.tar.xz
gsoc2013-evolution-da6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6.tar.zst
gsoc2013-evolution-da6e1ea98dcf2614ea71ea5dfb88ef63e194c8f6.zip
track union/struct change. (pas_book_queue_remove_card): same.
2002-03-07 Chris Toshok <toshok@ximian.com> * backend/pas/pas-book.c (pas_book_queue_create_card): track union/struct change. (pas_book_queue_remove_card): same. (pas_book_queue_modify_card): same. (pas_book_queue_get_cursor): same. (pas_book_queue_get_vcard): same. (pas_book_queue_authenticate_user): same. (pas_book_queue_get_book_view): same. (pas_book_queue_get_changes): same. (pas_book_free_request): new function - free everything we need to for each type of request. (pas_book_destroy): call pas_book_free_request here instead of just freeing 3 elements of the old struct. yay plugging memleaks. * backend/pas/pas-book.h: make PASRequest a union and split out members into structs, so it's a little clearer which fields are used by which requests. Also, add prototype for pas_book_free_request so backends can just free everything at once (usually in their requests_queued signal func.) * backend/pas/pas-backend-file.c (pas_backend_file_process_create_card): track struct/union change. (pas_backend_file_process_remove_card): same. (pas_backend_file_process_modify_card): same. (pas_backend_file_build_cards_list): same. (pas_backend_file_process_get_vcard): same. (pas_backend_file_process_get_cursor): same. (pas_backend_file_process_get_book_view): same. (pas_backend_file_process_get_changes): same. (pas_backend_file_process_check_connection): same. (pas_backend_file_process_authenticate_user): same. (pas_backend_file_process_get_supported_fields): same. (pas_backend_file_process_client_requests): case the union to the specific struct and pass it to the process_* functions. also, call pas_book_free_request here, instead of relying on each of the functions to free their stuff. svn path=/trunk/; revision=15987
Diffstat (limited to 'addressbook/backend/pas/pas-book.h')
-rw-r--r--addressbook/backend/pas/pas-book.h74
1 files changed, 65 insertions, 9 deletions
diff --git a/addressbook/backend/pas/pas-book.h b/addressbook/backend/pas/pas-book.h
index 8afba26b45..a6f2fda3cc 100644
--- a/addressbook/backend/pas/pas-book.h
+++ b/addressbook/backend/pas/pas-book.h
@@ -38,16 +38,71 @@ typedef enum {
} PASOperation;
typedef struct {
- PASOperation op;
- char *id;
- char *vcard;
- char *search;
- char *change_id;
- char *user;
- char *passwd;
- char *auth_method;
+ PASOperation op;
+ char *id;
+ char *vcard;
+} PASCreateCardRequest;
+
+typedef struct {
+ PASOperation op;
+ char *id;
+} PASRemoveCardRequest;
+
+typedef struct {
+ PASOperation op;
+ char *vcard;
+} PASModifyCardRequest;
+
+typedef struct {
+ PASOperation op;
+ char *id;
+} PASGetVCardRequest;
+
+typedef struct {
+ PASOperation op;
+ char *search;
+} PASGetCursorRequest;
+
+typedef struct {
+ PASOperation op;
+ char *search;
GNOME_Evolution_Addressbook_BookViewListener listener;
- GNOME_Evolution_Addressbook_stringlist fields;
+} PASGetBookViewRequest;
+
+typedef struct {
+ PASOperation op;
+ char *change_id;
+ GNOME_Evolution_Addressbook_BookViewListener listener;
+} PASGetChangesRequest;
+
+typedef struct {
+ PASOperation op;
+} PASCheckConnectionRequest;
+
+typedef struct {
+ PASOperation op;
+ char *user;
+ char *passwd;
+ char *auth_method;
+} PASAuthenticateUserRequest;
+
+typedef struct {
+ PASOperation op;
+} PASGetSupportedFieldsRequest;
+
+typedef union {
+ PASOperation op;
+
+ PASCreateCardRequest create;
+ PASRemoveCardRequest remove;
+ PASModifyCardRequest modify;
+ PASGetVCardRequest get_vcard;
+ PASGetCursorRequest get_cursor;
+ PASGetBookViewRequest get_book_view;
+ PASGetChangesRequest get_changes;
+ PASCheckConnectionRequest check_connection;
+ PASAuthenticateUserRequest auth_user;
+ PASGetSupportedFieldsRequest get_supported_fields;
} PASRequest;
struct _PASBook {
@@ -71,6 +126,7 @@ PASBackend *pas_book_get_backend (PASBook
GNOME_Evolution_Addressbook_BookListener pas_book_get_listener (PASBook *book);
int pas_book_check_pending (PASBook *book);
PASRequest *pas_book_pop_request (PASBook *book);
+void pas_book_free_request (PASRequest *request);
void pas_book_respond_open (PASBook *book,
GNOME_Evolution_Addressbook_BookListener_CallStatus status);
void pas_book_respond_create (PASBook *book,