Only in libgcal-0.9.6/: .deps
Only in libgcal-0.9.6/: Doxyfile
Only in libgcal-0.9.6/: Makefile
Only in libgcal-0.9.6/: config.h
Only in libgcal-0.9.6/: config.log
Only in libgcal-0.9.6/: config.status
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//inc/gcal.h libgcal-0.9.6//inc/gcal.h
*** libgcal-0.9.6.org//inc/gcal.h	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//inc/gcal.h	2011-02-23 12:00:07.000000000 +0900
***************
*** 42,47 ****
--- 42,54 ----
  /* For size_t */
  #include <stdlib.h>
  
+ #ifdef  __cplusplus
+ extern "C" {
+ #endif
+ 
+ #define GDATA_VERSION_2 "GData-Version: 2"
+ #define GCAL_GDATA_VERSION_3 "GData-Version: 3.0"
+ 
  /** Set gcal Google service mode */
  typedef enum { GCALENDAR, GCONTACT } gservice;
  
***************
*** 161,170 ****
   *                 \ref gcal_get_authentication.
   *
   * @param gdata_version Version of Data API.
   *
   * @return Returns 0 on success, -1 otherwise.
   */
! int gcal_dump(struct gcal_resource *gcalobj, const char *gdata_version);
  
  /** Get a list of users calendars (gcalendar supports multiple calendars
   * besides the default calendar).
--- 168,178 ----
   *                 \ref gcal_get_authentication.
   *
   * @param gdata_version Version of Data API.
+  * @param user NULL(=primary) or "XXXXXXXXXXXXXXXXXXXXXXXXXX@group.calendar.google.com"
   *
   * @return Returns 0 on success, -1 otherwise.
   */
! int gcal_dump(struct gcal_resource *gcalobj, const char *gdata_version,const char *user);
  
  /** Get a list of users calendars (gcalendar supports multiple calendars
   * besides the default calendar).
***************
*** 349,361 ****
   * @param updated Pass a pointer to a \ref gcal_event structure if you
   * wish to access the newly created contact (i.e. access fields like
   * edit_uri and id). If you don't need it, just pass NULL.
   *
   * @return -1 on error, 0 on success, -2 if operation went correctly but
   * cannot return 'updated' entry.
   */
  int gcal_create_event(struct gcal_resource *gcalobj,
  		      struct gcal_event *entries,
! 		      struct gcal_event *updated);
  
  /** Deletes a calendar event.
   *
--- 357,371 ----
   * @param updated Pass a pointer to a \ref gcal_event structure if you
   * wish to access the newly created contact (i.e. access fields like
   * edit_uri and id). If you don't need it, just pass NULL.
+  * @param user NULL(=primary) or "XXXXXXXXXXXXXXXXXXXXXXXXXX@group.calendar.google.com"
   *
   * @return -1 on error, 0 on success, -2 if operation went correctly but
   * cannot return 'updated' entry.
   */
  int gcal_create_event(struct gcal_resource *gcalobj,
  		      struct gcal_event *entries,
! 		      struct gcal_event *updated,
! 		      const char *user);
  
  /** Deletes a calendar event.
   *
***************
*** 367,377 ****
   *                 \ref gcal_get_authentication.
   *
   * @param entry A pointer to one calendar entry event (see \ref gcal_event).
   *
   * @return -1 on error, 0 on success.
   */
  int gcal_delete_event(struct gcal_resource *gcalobj,
! 		      struct gcal_event *entry);
  
  
  /** Edits a calendar event.
--- 377,389 ----
   *                 \ref gcal_get_authentication.
   *
   * @param entry A pointer to one calendar entry event (see \ref gcal_event).
+  * @param user NULL(=primary) or "XXXXXXXXXXXXXXXXXXXXXXXXXX@group.calendar.google.com"
   *
   * @return -1 on error, 0 on success.
   */
  int gcal_delete_event(struct gcal_resource *gcalobj,
! 		      struct gcal_event *entry,
! 		      const char *user);
  
  
  /** Edits a calendar event.
***************
*** 389,401 ****
   * @param updated Pass a pointer to a \ref gcal_event structure if you
   * wish to access the newly created contact (i.e. access fields like
   * edit_uri and id). If you don't need it, just pass NULL.
   *
   * @return -1 on error, 0 on success, -2 if operation went correctly but
   * cannot return 'updated' entry.
   */
  int gcal_edit_event(struct gcal_resource *gcalobj,
  		    struct gcal_event *entry,
! 		    struct gcal_event *updated);
  
  
  
--- 401,415 ----
   * @param updated Pass a pointer to a \ref gcal_event structure if you
   * wish to access the newly created contact (i.e. access fields like
   * edit_uri and id). If you don't need it, just pass NULL.
+  * @param user NULL(=primary) or "XXXXXXXXXXXXXXXXXXXXXXXXXX@group.calendar.google.com"
   *
   * @return -1 on error, 0 on success, -2 if operation went correctly but
   * cannot return 'updated' entry.
   */
  int gcal_edit_event(struct gcal_resource *gcalobj,
  		    struct gcal_event *entry,
! 		    struct gcal_event *updated,
! 		    const char *user);
  
  
  
***************
*** 650,653 ****
--- 664,671 ----
   */
  void gcal_final_cleanup();
  
+ #ifdef  __cplusplus
+ }
+ #endif
+ 
  #endif
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//inc/gcalendar.h libgcal-0.9.6//inc/gcalendar.h
*** libgcal-0.9.6.org//inc/gcalendar.h	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//inc/gcalendar.h	2011-02-23 13:23:52.000000000 +0900
***************
*** 41,46 ****
--- 41,50 ----
  
  #include "gcal.h"
  
+ #ifdef  __cplusplus
+ extern "C" {
+ #endif
+ 
  /** Since user cannot create an static instance of it, it entitles itself
   * to be a completely abstract data type. See \ref gcal_event.
   */
***************
*** 104,110 ****
   *
   * @return 0 on success, -1 otherwise.
   */
! int gcal_get_events(gcal_t gcalobj, struct gcal_event_array *events_array);
  
  
  /** Use this function to cleanup an array of calendar events.
--- 108,114 ----
   *
   * @return 0 on success, -1 otherwise.
   */
! int gcal_get_events(gcal_t gcalobj, struct gcal_event_array *events_array,const char *user);
  
  
  /** Use this function to cleanup an array of calendar events.
***************
*** 126,132 ****
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_add_event(gcal_t gcal_obj, gcal_event_t event);
  
  /** Updates an already existant event.
   *
--- 130,136 ----
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_add_event(gcal_t gcal_obj, gcal_event_t event,const char *user);
  
  /** Updates an already existant event.
   *
***************
*** 143,149 ****
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_update_event(gcal_t gcal_obj, gcal_event_t event);
  
  /** Deletes an event (pay attention that google server will mark this
   * event as 'cancelled').
--- 147,153 ----
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_update_event(gcal_t gcal_obj, gcal_event_t event,const char *user);
  
  /** Deletes an event (pay attention that google server will mark this
   * event as 'cancelled').
***************
*** 160,166 ****
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_erase_event(gcal_t gcal_obj, gcal_event_t event);
  
  /** Query for updated events (added/edited/deleted).
   *
--- 164,170 ----
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_erase_event(gcal_t gcal_obj, gcal_event_t event,const char *user);
  
  /** Query for updated events (added/edited/deleted).
   *
***************
*** 255,261 ****
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_add_xmlentry(gcal_t gcal_obj, char *xml_entry, char **xml_updated);
  
  
  /** Updates an entry (event or contact) using raw xml.
--- 259,265 ----
   *
   * @return 0 on sucess, -1 otherwise.
   */
! int gcal_add_xmlentry(gcal_t gcal_obj, char *xml_entry, char **xml_updated,const char *gcal_edit_url);
  
  
  /** Updates an entry (event or contact) using raw xml.
***************
*** 632,637 ****
  int gcal_event_set_etag(gcal_event_t event, const char *field);
  
  
! 
  
  #endif
--- 636,643 ----
  int gcal_event_set_etag(gcal_event_t event, const char *field);
  
  
! #ifdef  __cplusplus
! }
! #endif
  
  #endif
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//inc/gcontact.h libgcal-0.9.6//inc/gcontact.h
*** libgcal-0.9.6.org//inc/gcontact.h	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//inc/gcontact.h	2011-02-18 13:50:30.000000000 +0900
***************
*** 42,47 ****
--- 42,51 ----
  #include "gcal.h"
  #include "gcont.h"
  
+ #ifdef  __cplusplus
+ extern "C" {
+ #endif
+ 
  /** Since user cannot create an static instance of it, it entitles itself
   * to be a completely abstract data type. See \ref gcal_contact.
   */
***************
*** 142,148 ****
   *
   * @return 0 on success, -1 otherwise.
   */
! int gcal_get_contacts(gcal_t gcalobj, struct gcal_contact_array *contact_array);
  
  /** Use this function to cleanup an array of contacts.
   *
--- 146,152 ----
   *
   * @return 0 on success, -1 otherwise.
   */
! int gcal_get_contacts(gcal_t gcalobj, struct gcal_contact_array *contact_array,const char *user);
  
  /** Use this function to cleanup an array of contacts.
   *
***************
*** 969,973 ****
--- 973,980 ----
  int gcal_contact_set_photo(gcal_contact_t contact, const char *field,
  			   int length);
  
+ #ifdef  __cplusplus
+ }
+ #endif
  
  #endif
Only in libgcal-0.9.6/: libgcal-uninstalled.pc
Only in libgcal-0.9.6/: libgcal.pc
Only in libgcal-0.9.6/: libtool
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/atom_parser.c libgcal-0.9.6//src/atom_parser.c
*** libgcal-0.9.6.org//src/atom_parser.c	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/atom_parser.c	2011-02-22 15:49:59.000000000 +0900
***************
*** 42,47 ****
--- 42,48 ----
  #include "atom_parser.h"
  #include "xml_aux.h"
  #include "internal_gcal.h"
+ #include "msvc_hacks.h"
  #include <string.h>
  
  
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/gcal.c libgcal-0.9.6//src/gcal.c
*** libgcal-0.9.6.org//src/gcal.c	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/gcal.c	2011-10-03 14:44:45.000000000 +0900
***************
*** 70,75 ****
--- 70,90 ----
  #include "curl_debug_gcal.h"
  #endif
  
+ char *gen_edit_uri(char *url,size_t url_size,const char *edit_uri,const char *user)
+ {
+ 	strcpy(url,edit_uri);
+ 	if(user){
+ 		static const char user_sig[]="/default/";
+ 		char *p=strstr(url,user_sig);
+ 		if(p){
+ 			size_t index=p-url;
+ 			strcpy(p+1,user);
+ 			strcat(url,edit_uri+index+sizeof(user_sig)-2);
+ 		}
+ 	}
+ 	return url;
+ }
+ 
  static void reset_buffer(struct gcal_resource *ptr)
  {
  	if (ptr->buffer)
***************
*** 95,100 ****
--- 110,118 ----
  	ptr->buffer = NULL;
  	reset_buffer(ptr);
  	ptr->curl = curl_easy_init();
+ #ifdef _WIN32
+ 	curl_easy_setopt(ptr->curl,CURLOPT_SSL_VERIFYPEER,FALSE);
+ #endif
  	ptr->http_code = 0;
  	ptr->curl_msg = NULL;
  	ptr->http_code = 0;
***************
*** 228,234 ****
  	curl_easy_getinfo(curl_ctx, CURLINFO_HTTP_CODE,
  			  &(gcalobj->http_code));
  	if (code || (gcalobj->http_code != expected_answer)) {
- 
  		if (gcalobj->curl_msg)
  			free(gcalobj->curl_msg);
  
--- 246,251 ----
***************
*** 432,438 ****
  			   "Content-Type: application/x-www-form-urlencoded",
  			   NULL, NULL, NULL, post, strlen(post),
  			   GCAL_DEFAULT_ANSWER,
! 			   "GData-Version: 2");
  
  	if ((tmp = strstr(user, "@"))) {
  		if (!(buffer = strdup(user)))
--- 449,455 ----
  			   "Content-Type: application/x-www-form-urlencoded",
  			   NULL, NULL, NULL, post, strlen(post),
  			   GCAL_DEFAULT_ANSWER,
! 			   GDATA_VERSION_2);
  
  	if ((tmp = strstr(user, "@"))) {
  		if (!(buffer = strdup(user)))
***************
*** 583,640 ****
  }
  
  
! static char *mount_query_url(struct gcal_resource *gcalobj,
! 			     const char *parameters, ...)
  {
  	va_list ap;
  	char *result = NULL, *query_param = NULL, *ptr_tmp = NULL;
  	int length;
  	char query_separator[] = "&";
  	char query_init[] = "?";
  	/* By default, google contacts are not ordered */
  	char contact_order[] = "&orderby=lastmodified";
  	if (!gcalobj)
  		goto exit;
! 
! 	if ((!gcalobj->user))
  		goto exit;
  
  	/* TODO: put the google service type string in an array. */
  	if (!(strcmp(gcalobj->service, "cl"))) {
  		if (gcalobj->max_results)
  			length = sizeof(GCAL_EVENT_START) +
-                                 sizeof(GCAL_DELIMITER) +
-                                 strlen(gcalobj->domain) +
  				sizeof(GCAL_EVENT_END) +
  				sizeof(query_init) +
  				strlen(gcalobj->max_results) +
! 				strlen(gcalobj->user) + 1;
  		else
  			length = sizeof(GCAL_EVENT_START) +
-                                 sizeof(GCAL_DELIMITER) +
-                                 strlen(gcalobj->domain) +
  				sizeof(GCAL_EVENT_END) +
  				sizeof(query_init) +
! 				strlen(gcalobj->user) + 1;
  
  	}
  	else if (!(strcmp(gcalobj->service, "cp"))) {
  		if (gcalobj->max_results)
  			length = sizeof(GCONTACT_START) +
-                                 sizeof(GCAL_DELIMITER) +
-                                 strlen(gcalobj->domain) +
  				sizeof(GCONTACT_END) +
  				sizeof(query_init) +
  				strlen(gcalobj->max_results) +
! 				strlen(gcalobj->user) +
  				sizeof(contact_order) + 1;
  		else
  			length = sizeof(GCONTACT_START) +
-                                 sizeof(GCAL_DELIMITER) +
-                                 strlen(gcalobj->domain) +
  				sizeof(GCONTACT_END) +
  				sizeof(query_init) +
! 				strlen(gcalobj->user) + 1;
  
  	} else
  		goto exit;
--- 600,652 ----
  }
  
  
! static char *mount_query_url(struct gcal_resource *gcalobj,const char *user,const char *parameters, ...)
  {
  	va_list ap;
  	char *result = NULL, *query_param = NULL, *ptr_tmp = NULL;
  	int length;
  	char query_separator[] = "&";
  	char query_init[] = "?";
+ 	char default_user[256];
  	/* By default, google contacts are not ordered */
  	char contact_order[] = "&orderby=lastmodified";
  	if (!gcalobj)
  		goto exit;
! 	if(!user){
! 		sprintf(default_user,"%s%s%s",gcalobj->user,GCAL_DELIMITER,gcalobj->domain);
! 		user=default_user;
! 	}
! 	if ((!user))
  		goto exit;
  
  	/* TODO: put the google service type string in an array. */
  	if (!(strcmp(gcalobj->service, "cl"))) {
  		if (gcalobj->max_results)
  			length = sizeof(GCAL_EVENT_START) +
  				sizeof(GCAL_EVENT_END) +
  				sizeof(query_init) +
  				strlen(gcalobj->max_results) +
! 				strlen(user) + 1;
  		else
  			length = sizeof(GCAL_EVENT_START) +
  				sizeof(GCAL_EVENT_END) +
  				sizeof(query_init) +
! 				strlen(user) + 1;
  
  	}
  	else if (!(strcmp(gcalobj->service, "cp"))) {
  		if (gcalobj->max_results)
  			length = sizeof(GCONTACT_START) +
  				sizeof(GCONTACT_END) +
  				sizeof(query_init) +
  				strlen(gcalobj->max_results) +
! 				strlen(user) +
  				sizeof(contact_order) + 1;
  		else
  			length = sizeof(GCONTACT_START) +
  				sizeof(GCONTACT_END) +
  				sizeof(query_init) +
! 				strlen(user) + 1;
  
  	} else
  		goto exit;
***************
*** 648,676 ****
  		 * address plus the number of max-results returned.
  		 */
  		if (gcalobj->max_results)
! 			snprintf(result, length - 1, "%s%s%s%s%s%s%s",
! 				 GCAL_EVENT_START, gcalobj->user,
!                                  GCAL_DELIMITER, gcalobj->domain,
  				 GCAL_EVENT_END, query_init,
  				 gcalobj->max_results);
  		else
! 			snprintf(result, length - 1, "%s%s%s%s%s%s",
! 				 GCAL_EVENT_START, gcalobj->user,
!                                  GCAL_DELIMITER, gcalobj->domain,
  				 GCAL_EVENT_END, query_init);
  
  	} else if (!(strcmp(gcalobj->service, "cp"))) {
  		if (gcalobj->max_results)
! 			snprintf(result, length - 1, "%s%s%s%s%s%s%s%s",
! 				 GCONTACT_START, gcalobj->user,
!                                  GCAL_DELIMITER, gcalobj->domain,
  				 GCONTACT_END, query_init,
  				 gcalobj->max_results,
  				 contact_order);
  		else
! 			snprintf(result, length - 1, "%s%s%s%s%s%s",
! 				 GCONTACT_START, gcalobj->user,
!                                  GCAL_DELIMITER, gcalobj->domain,
  				 GCONTACT_END, query_init);
  	}
  
--- 660,684 ----
  		 * address plus the number of max-results returned.
  		 */
  		if (gcalobj->max_results)
! 			snprintf(result, length - 1, "%s%s%s%s%s",
! 				 GCAL_EVENT_START, user,
  				 GCAL_EVENT_END, query_init,
  				 gcalobj->max_results);
  		else
! 			snprintf(result, length - 1, "%s%s%s%s",
! 				 GCAL_EVENT_START, user,
  				 GCAL_EVENT_END, query_init);
  
  	} else if (!(strcmp(gcalobj->service, "cp"))) {
  		if (gcalobj->max_results)
! 			snprintf(result, length - 1, "%s%s%s%s%s%s",
! 				 GCONTACT_START, user,
  				 GCONTACT_END, query_init,
  				 gcalobj->max_results,
  				 contact_order);
  		else
! 			snprintf(result, length - 1, "%s%s%s%s",
! 				 GCONTACT_START, user,
  				 GCONTACT_END, query_init);
  	}
  
***************
*** 711,717 ****
  	return result;
  }
  
! int gcal_dump(struct gcal_resource *gcalobj, const char *gdata_version)
  {
  	int result = -1;
  	char *buffer = NULL;
--- 719,725 ----
  	return result;
  }
  
! int gcal_dump(struct gcal_resource *gcalobj, const char *gdata_version,const char *user)
  {
  	int result = -1;
  	char *buffer = NULL;
***************
*** 722,728 ****
  	if (!gcalobj->auth)
  		goto exit;
  
! 	buffer = mount_query_url(gcalobj, NULL);
  	if (!buffer)
  		goto exit;
  
--- 730,736 ----
  	if (!gcalobj->auth)
  		goto exit;
  
! 	buffer = mount_query_url(gcalobj, user,NULL);
  	if (!buffer)
  		goto exit;
  
***************
*** 741,747 ****
  {
  	int result;
  	result =  get_follow_redirection(gcalobj, GCAL_LIST, NULL,
! 			"GData-Version: 2");
  	/* TODO: parse the Atom feed */
  
  	return result;
--- 749,755 ----
  {
  	int result;
  	result =  get_follow_redirection(gcalobj, GCAL_LIST, NULL,
! 			GDATA_VERSION_2);
  	/* TODO: parse the Atom feed */
  
  	return result;
***************
*** 942,948 ****
  				     etag,
  				     data2post, m_length,
  				     expected_code,
! 				     "GData-Version: 3.0");
  		if (!result) {
  
  			result = 0;
--- 950,956 ----
  				     etag,
  				     data2post, m_length,
  				     expected_code,
! 				     GCAL_GDATA_VERSION_3);
  		if (!result) {
  
  			result = 0;
***************
*** 957,963 ****
  				     etag,
  				     data2post, m_length,
  				     GCAL_REDIRECT_ANSWER,
! 				     "GData-Version: 2");
  		if (result == -1) {
  			/* XXX: there is one report where google server
  			 * doesn't always return redirection.
--- 965,971 ----
  				     etag,
  				     data2post, m_length,
  				     GCAL_REDIRECT_ANSWER,
! 				     GDATA_VERSION_2);
  		if (result == -1) {
  			/* XXX: there is one report where google server
  			 * doesn't always return redirection.
***************
*** 990,996 ****
  				etag,
  				data2post, m_length,
  				expected_code,
! 				"GData-Version: 3.0");
  	} else if (!(strcmp(gcalobj->service, "cl"))) {
  		result = up_callback(gcalobj, gcalobj->url,
  				"Content-Type: application/atom+xml",
--- 998,1004 ----
  				etag,
  				data2post, m_length,
  				expected_code,
! 				GCAL_GDATA_VERSION_3);
  	} else if (!(strcmp(gcalobj->service, "cl"))) {
  		result = up_callback(gcalobj, gcalobj->url,
  				"Content-Type: application/atom+xml",
***************
*** 999,1005 ****
  				etag,
  				data2post, m_length,
  				expected_code,
! 				"GData-Version: 2");
  	} else
  		goto cleanup;
  
--- 1007,1013 ----
  				etag,
  				data2post, m_length,
  				expected_code,
! 				GDATA_VERSION_2);
  	} else
  		goto cleanup;
  
***************
*** 1029,1038 ****
  
  int gcal_create_event(struct gcal_resource *gcalobj,
  		      struct gcal_event *entries,
! 		      struct gcal_event *updated)
  {
  	int result = -1, length;
  	char *xml_entry = NULL;
  
  	if ((!entries) || (!gcalobj))
  		return result;
--- 1037,1048 ----
  
  int gcal_create_event(struct gcal_resource *gcalobj,
  		      struct gcal_event *entries,
! 		      struct gcal_event *updated,
! 		      const char *user)
  {
  	int result = -1, length;
  	char *xml_entry = NULL;
+ 	char url[256];
  
  	if ((!entries) || (!gcalobj))
  		return result;
***************
*** 1042,1048 ****
  		goto exit;
  
  	result = up_entry(xml_entry, strlen(xml_entry),
! 			  gcalobj, GCAL_EDIT_URL, NULL,
  			  POST, NULL, GCAL_EDIT_ANSWER);
  	if (result)
  		goto cleanup;
--- 1052,1058 ----
  		goto exit;
  
  	result = up_entry(xml_entry, strlen(xml_entry),
! 			  gcalobj, gen_edit_uri(url,sizeof(url),GCAL_EDIT_URL,user), NULL,
  			  POST, NULL, GCAL_EDIT_ANSWER);
  	if (result)
  		goto cleanup;
***************
*** 1083,1092 ****
  }
  
  int gcal_delete_event(struct gcal_resource *gcalobj,
! 		      struct gcal_event *entry)
  {
  	int result = -1, length;
  	char *h_auth;
  
  	if ((!entry) || (!gcalobj) || (!gcalobj->auth))
  		goto exit;
--- 1093,1103 ----
  }
  
  int gcal_delete_event(struct gcal_resource *gcalobj,
! 		      struct gcal_event *entry,const char *user)
  {
  	int result = -1, length;
  	char *h_auth;
+ 	char url[256];
  
  	if ((!entry) || (!gcalobj) || (!gcalobj->auth))
  		goto exit;
***************
*** 1101,1113 ****
  	snprintf(h_auth, length - 1, "%s%s", HEADER_GET, gcalobj->auth);
  
  	curl_easy_setopt(gcalobj->curl, CURLOPT_CUSTOMREQUEST, "DELETE");
! 	result = http_post(gcalobj, entry->common.edit_uri,
  			   "Content-Type: application/atom+xml",
  			   /* Google Data API 2.0 requires ETag */
  			   "If-Match: *",
  			   h_auth,
  			   NULL, NULL, 0, GCAL_REDIRECT_ANSWER,
! 			   "GData-Version: 2");
  
  	if (result == -1) {
  		/* XXX: there is one report where google server
--- 1112,1124 ----
  	snprintf(h_auth, length - 1, "%s%s", HEADER_GET, gcalobj->auth);
  
  	curl_easy_setopt(gcalobj->curl, CURLOPT_CUSTOMREQUEST, "DELETE");
! 	result = http_post(gcalobj,gen_edit_uri(url,sizeof(url),entry->common.edit_uri,user) ,
  			   "Content-Type: application/atom+xml",
  			   /* Google Data API 2.0 requires ETag */
  			   "If-Match: *",
  			   h_auth,
  			   NULL, NULL, 0, GCAL_REDIRECT_ANSWER,
! 			   GDATA_VERSION_2);
  
  	if (result == -1) {
  		/* XXX: there is one report where google server
***************
*** 1134,1140 ****
  			   "If-Match: *",
  			   h_auth,
  			   NULL, NULL, 0, GCAL_DEFAULT_ANSWER,
! 			   "GData-Version: 2");
  
  cleanup:
  	/* Restores curl context to previous standard mode */
--- 1145,1151 ----
  			   "If-Match: *",
  			   h_auth,
  			   NULL, NULL, 0, GCAL_DEFAULT_ANSWER,
! 			   GDATA_VERSION_2);
  
  cleanup:
  	/* Restores curl context to previous standard mode */
***************
*** 1151,1161 ****
  
  int gcal_edit_event(struct gcal_resource *gcalobj,
  		    struct gcal_event *entry,
! 		    struct gcal_event *updated)
  {
  
  	int result = -1, length;
  	char *xml_entry = NULL;
  
  	if ((!entry) || (!gcalobj))
  		goto exit;
--- 1162,1173 ----
  
  int gcal_edit_event(struct gcal_resource *gcalobj,
  		    struct gcal_event *entry,
! 		    struct gcal_event *updated,const char *user)
  {
  
  	int result = -1, length;
  	char *xml_entry = NULL;
+ 	char edit_uri[256];
  
  	if ((!entry) || (!gcalobj))
  		goto exit;
***************
*** 1164,1171 ****
  	if (result == -1)
  		goto exit;
  
  	result = up_entry(xml_entry, strlen(xml_entry),
! 			  gcalobj, entry->common.edit_uri,
  			  /* Google Data API 2.0 requires ETag */
  			  "If-Match: *",
  			  PUT, NULL, GCAL_DEFAULT_ANSWER);
--- 1176,1184 ----
  	if (result == -1)
  		goto exit;
  
+ 	gen_edit_uri(edit_uri,sizeof(edit_uri),entry->common.edit_uri,user);
  	result = up_entry(xml_entry, strlen(xml_entry),
! 			  gcalobj, edit_uri,
  			  /* Google Data API 2.0 requires ETag */
  			  "If-Match: *",
  			  PUT, NULL, GCAL_DEFAULT_ANSWER);
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/gcal_parser.c libgcal-0.9.6//src/gcal_parser.c
*** libgcal-0.9.6.org//src/gcal_parser.c	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/gcal_parser.c	2011-02-22 21:18:07.000000000 +0900
***************
*** 41,46 ****
--- 41,47 ----
  #include "gcal_parser.h"
  #include "atom_parser.h"
  #include "xml_aux.h"
+ #include "msvc_hacks.h"
  
  #include <libxml/tree.h>
  #include <string.h>
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/gcal_status.c libgcal-0.9.6//src/gcal_status.c
*** libgcal-0.9.6.org//src/gcal_status.c	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/gcal_status.c	2011-02-23 13:52:15.000000000 +0900
***************
*** 38,43 ****
--- 38,44 ----
  
  #include "gcal_status.h"
  #include "internal_gcal.h"
+ #include "msvc_hacks.h"
  
  int gcal_status_httpcode(struct gcal_resource *ptr_gcal)
  {
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/gcalendar.c libgcal-0.9.6//src/gcalendar.c
*** libgcal-0.9.6.org//src/gcalendar.c	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/gcalendar.c	2011-02-23 13:15:50.000000000 +0900
***************
*** 126,132 ****
  
  }
  
! int gcal_add_xmlentry(gcal_t gcal_obj, char *xml_entry, char **xml_updated)
  {
  	int result = -1, length = 0;
  	char *buffer = NULL;
--- 126,132 ----
  
  }
  
! int gcal_add_xmlentry(gcal_t gcal_obj, char *xml_entry, char **xml_updated,const char *gcal_edit_url)
  {
  	int result = -1, length = 0;
  	char *buffer = NULL;
***************
*** 136,142 ****
  
  	if (!(strcmp(gcal_obj->service, "cl")))
  		result = up_entry(xml_entry, strlen(xml_entry), gcal_obj,
! 				  GCAL_EDIT_URL, NULL,
  				  POST, NULL, GCAL_EDIT_ANSWER);
  
  	else {
--- 136,142 ----
  
  	if (!(strcmp(gcal_obj->service, "cl")))
  		result = up_entry(xml_entry, strlen(xml_entry), gcal_obj,
! 				  gcal_edit_url, NULL,
  				  POST, NULL, GCAL_EDIT_ANSWER);
  
  	else {
***************
*** 199,205 ****
  	}
  
  	/* Mounts costum HTTP header using ETag */
! 	snprintf(buffer, sizeof(buffer) - 1, "%s\%s",
  		 if_match, etag);
  
  	result = up_entry(xml_entry, strlen(xml_entry), gcal_obj, url, buffer,
--- 199,205 ----
  	}
  
  	/* Mounts costum HTTP header using ETag */
! 	snprintf(buffer, sizeof(buffer) - 1, "%s=%s",
  		 if_match, etag);
  
  	result = up_entry(xml_entry, strlen(xml_entry), gcal_obj, url, buffer,
***************
*** 241,247 ****
  	contact.common.edit_uri = edit_url;
  
  	if (!(strcmp(gcal_obj->service, "cl")))
! 		result = gcal_delete_event(gcal_obj, &event);
  
  	else
  		result = gcal_delete_contact(gcal_obj, &contact);
--- 241,247 ----
  	contact.common.edit_uri = edit_url;
  
  	if (!(strcmp(gcal_obj->service, "cl")))
! 		result = gcal_delete_event(gcal_obj, &event,NULL);
  
  	else
  		result = gcal_delete_contact(gcal_obj, &contact);
***************
*** 254,260 ****
  }
  
  
! int gcal_add_event(gcal_t gcal_obj, gcal_event_t event)
  {
  	int result = -1;
  	struct gcal_event updated;
--- 254,260 ----
  }
  
  
! int gcal_add_event(gcal_t gcal_obj, gcal_event_t event,const char *user)
  {
  	int result = -1;
  	struct gcal_event updated;
***************
*** 263,269 ****
  	if ((!gcal_obj) || (!event))
  		goto exit;
  
! 	result = gcal_create_event(gcal_obj, event, &updated);
  	if (result)
  		goto exit;
  
--- 263,269 ----
  	if ((!gcal_obj) || (!event))
  		goto exit;
  
! 	result = gcal_create_event(gcal_obj, event, &updated,user);
  	if (result)
  		goto exit;
  
***************
*** 294,300 ****
  	return result;
  }
  
! int gcal_update_event(gcal_t gcal_obj, gcal_event_t event)
  {
  	int result = -1;
  	struct gcal_event updated;
--- 294,300 ----
  	return result;
  }
  
! int gcal_update_event(gcal_t gcal_obj, gcal_event_t event,const char *user)
  {
  	int result = -1;
  	struct gcal_event updated;
***************
*** 302,308 ****
  	if ((!gcal_obj) || (!event))
  		goto exit;
  
! 	result = gcal_edit_event(gcal_obj, event, &updated);
  	if (result)
  		goto exit;
  
--- 302,308 ----
  	if ((!gcal_obj) || (!event))
  		goto exit;
  
! 	result = gcal_edit_event(gcal_obj, event, &updated,user);
  	if (result)
  		goto exit;
  
***************
*** 329,341 ****
  
  }
  
! int gcal_erase_event(gcal_t gcal_obj, gcal_event_t event)
  {
  	int result = -1;
  	if ((!gcal_obj) || (!event))
  		goto exit;
  
! 	result = gcal_delete_event(gcal_obj, event);
  exit:
  	return result;
  }
--- 329,341 ----
  
  }
  
! int gcal_erase_event(gcal_t gcal_obj, gcal_event_t event,const char *user)
  {
  	int result = -1;
  	if ((!gcal_obj) || (!event))
  		goto exit;
  
! 	result = gcal_delete_event(gcal_obj, event,user);
  exit:
  	return result;
  }
***************
*** 350,356 ****
  	if ((!gcal_obj) || (!events))
  		return result;
  
! 	result = gcal_query_updated(gcal_obj, timestamp, "GData-Version: 2");
  	if (result) {
  		events->entries = NULL;
  		events->length = 0;
--- 350,356 ----
  	if ((!gcal_obj) || (!events))
  		return result;
  
! 	result = gcal_query_updated(gcal_obj, timestamp, GDATA_VERSION_2);
  	if (result) {
  		events->entries = NULL;
  		events->length = 0;
***************
*** 364,370 ****
  	return result;
  }
  
! int gcal_get_events(gcal_t gcalobj, struct gcal_event_array *events_array)
  {
  	int result = -1;
  	if (events_array)
--- 364,370 ----
  	return result;
  }
  
! int gcal_get_events(gcal_t gcalobj, struct gcal_event_array *events_array,const char *user)
  {
  	int result = -1;
  	if (events_array)
***************
*** 373,379 ****
  	if ((!gcalobj) || (!events_array))
  		goto exit;
  
! 	result = gcal_dump(gcalobj, "GData-Version: 2");
  	if (result == -1) {
  		events_array->entries = NULL;
  		events_array->length = 0;
--- 373,379 ----
  	if ((!gcalobj) || (!events_array))
  		goto exit;
  
! 	result = gcal_dump(gcalobj, GDATA_VERSION_2,user);
  	if (result == -1) {
  		events_array->entries = NULL;
  		events_array->length = 0;
***************
*** 606,611 ****
--- 606,635 ----
  	return result;
  }
  
+ int gcal_event_modify_url_user(gcal_event_t event, const char *field)
+ {
+ 	int result = -1;
+ 	char url[1024];
+ 	const char *edit_uri=gcal_event_get_url(event);
+ 	if((!edit_uri))
+ 		return result;
+ 
+ 	if ((!event) || (!field))
+ 		return result;
+ 
+ 	strcpy(url,edit_uri);
+ 	if(field){
+ 		static const char user_sig[]="/default/";
+ 		char *p=strstr(url,user_sig);
+ 		if(p){
+ 			size_t index=p-url;
+ 			strcpy(p+1,field);
+ 			strcat(url,edit_uri+index+sizeof(user_sig)-2);
+ 			return gcal_event_set_url(event,url);
+ 		}
+ 	}
+ 	return result;
+ }
  
  int gcal_event_set_id(gcal_event_t event, const char *field)
  {
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/gcont.c libgcal-0.9.6//src/gcont.c
*** libgcal-0.9.6.org//src/gcont.c	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/gcont.c	2011-02-23 12:00:07.000000000 +0900
***************
*** 125,131 ****
   			result = get_follow_redirection(gcalobj,
   							ptr_res[i].photo,
  							write_cb_binary,
! 							"GData-Version: 3.0");
  			ptr_res[i].photo_data = malloc(sizeof(char) *
  						       gcalobj->length);
  			if (!ptr_res[i].photo_data)
--- 125,131 ----
   			result = get_follow_redirection(gcalobj,
   							ptr_res[i].photo,
  							write_cb_binary,
! 							GCAL_GDATA_VERSION_3);
  			ptr_res[i].photo_data = malloc(sizeof(char) *
  						       gcalobj->length);
  			if (!ptr_res[i].photo_data)
***************
*** 400,406 ****
  			   "If-Match: *",
  			   h_auth,
  			   NULL, NULL, 0, GCAL_DEFAULT_ANSWER,
! 			   "GData-Version: 3.0");
  
  	/* Restores curl context to previous standard mode */
  	curl_easy_setopt(gcalobj->curl, CURLOPT_CUSTOMREQUEST, NULL);
--- 400,406 ----
  			   "If-Match: *",
  			   h_auth,
  			   NULL, NULL, 0, GCAL_DEFAULT_ANSWER,
! 			   GCAL_GDATA_VERSION_3);
  
  	/* Restores curl context to previous standard mode */
  	curl_easy_setopt(gcalobj->curl, CURLOPT_CUSTOMREQUEST, NULL);
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/gcontact.c libgcal-0.9.6//src/gcontact.c
*** libgcal-0.9.6.org//src/gcontact.c	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/gcontact.c	2011-02-23 12:00:07.000000000 +0900
***************
*** 47,52 ****
--- 47,53 ----
  #include "gcontact.h"
  #include "gcal_parser.h"
  #include "internal_gcal.h"
+ #include "msvc_hacks.h"
  
  
  /** Strings associated with phone number types */
***************
*** 136,142 ****
  
  }
  
! int gcal_get_contacts(gcal_t gcalobj, struct gcal_contact_array *contact_array)
  {
  	int result = -1;
  	if (contact_array)
--- 137,143 ----
  
  }
  
! int gcal_get_contacts(gcal_t gcalobj, struct gcal_contact_array *contact_array,const char *user)
  {
  	int result = -1;
  	if (contact_array)
***************
*** 145,151 ****
  	if ((!gcalobj) || (!contact_array))
  		return result;
  
! 	result = gcal_dump(gcalobj, "GData-Version: 3.0");
  	if (result == -1) {
  		contact_array->entries = NULL;
  		contact_array->length = 0;
--- 146,152 ----
  	if ((!gcalobj) || (!contact_array))
  		return result;
  
! 	result = gcal_dump(gcalobj, GCAL_GDATA_VERSION_3,user);
  	if (result == -1) {
  		contact_array->entries = NULL;
  		contact_array->length = 0;
***************
*** 286,292 ****
  	if ((!gcal_obj) || (!contacts))
  		return result;
  
! 	result = gcal_query_updated(gcal_obj, timestamp, "GData-Version: 3.0");
  	if (result) {
  		contacts->entries = NULL;
  		contacts->length = 0;
--- 287,293 ----
  	if ((!gcal_obj) || (!contacts))
  		return result;
  
! 	result = gcal_query_updated(gcal_obj, timestamp, GCAL_GDATA_VERSION_3);
  	if (result) {
  		contacts->entries = NULL;
  		contacts->length = 0;
***************
*** 479,488 ****
  
  char *gcal_contact_get_phone(gcal_contact_t contact)
  {
  	if ((!contact))
  		return NULL;
  
- 	char *res;
  	/* The prefered phone is *always* the first */
  	res = gcal_contact_get_phone_number(contact, 0);
  	return res;
--- 480,489 ----
  
  char *gcal_contact_get_phone(gcal_contact_t contact)
  {
+ 	char *res;
  	if ((!contact))
  		return NULL;
  
  	/* The prefered phone is *always* the first */
  	res = gcal_contact_get_phone_number(contact, 0);
  	return res;
***************
*** 505,517 ****
  
  char *gcal_contact_get_im(gcal_contact_t contact)
  {
  	if ((!contact))
  		return NULL;
  	if (!(contact->im_address))
  		return NULL;
  
- 	char *res;
- 	int pref_im;
  	pref_im = gcal_contact_get_pref_im(contact);
  	if(pref_im == -1)
  		pref_im = 0;
--- 506,518 ----
  
  char *gcal_contact_get_im(gcal_contact_t contact)
  {
+ 	char *res;
+ 	int pref_im;
  	if ((!contact))
  		return NULL;
  	if (!(contact->im_address))
  		return NULL;
  
  	pref_im = gcal_contact_get_pref_im(contact);
  	if(pref_im == -1)
  		pref_im = 0;
diff -r --strip-trailing-cr --context libgcal-0.9.6.org//src/msvc_hacks.h libgcal-0.9.6//src/msvc_hacks.h
*** libgcal-0.9.6.org//src/msvc_hacks.h	2010-09-08 08:09:00.000000000 +0900
--- libgcal-0.9.6//src/msvc_hacks.h	2011-02-23 13:51:57.000000000 +0900
***************
*** 48,53 ****
--- 48,69 ----
  /* MSVC doesn't define sprintf, redefine to their version. */
  #define snprintf sprintf_s
  
+ #if _MSC_VER==1400	// VC++2005
+ 	#pragma warning(disable :4996)
+ 	#pragma warning(disable :4267)
+ 	#define _CRT_SECURE_NO_WARNINGS
+ #endif
+ 
+ #ifdef  __cplusplus
+ extern "C" {
+ #endif
+ 
+ int gettimeofday(struct timeval *tv, struct timezone *tz);
+ 
+ #ifdef  __cplusplus
+ }
+ #endif
+ 
  #endif
  
  #endif
Only in libgcal-0.9.6//src: timeofdate.c
Only in libgcal-0.9.6/: stamp-h1
