Attachment 'gnome-pilot-2.0.12-p1.txt'

Download

   1 --- gnome-pilot-2.0.12/gpilotd/manager.c.port-to-pilot-link-0.12	2004-09-03 12:18:35.000000000 -0400
   2 +++ gnome-pilot-2.0.12/gpilotd/manager.c	2005-03-16 18:34:33.000000000 -0500
   3 @@ -294,25 +294,29 @@
   4  	GPilotPilot *pilot_info;
   5  	int error = 0;
   6  	int index = 0;
   7 -       
   8 +
   9  	pilot_info = gpilot_find_pilot_by_id (pu->userID, context->pilots);
  10  
  11  	orbed_notify_daemon_message (pilot_info->name, NULL, _("Collecting synchronization info..."));
  12  
  13 -	while (1) {
  14 -		GnomePilotDBInfo *dbinfo;
  15 +	{
  16 +		int i;
  17 +		pi_buffer_t *pi_buf;
  18 +		int result;
  19 +
  20 +		pi_buf = pi_buffer_new (0xffff);       
  21 +		result = dlp_ReadDBList (pfd, 0, dlpDBListRAM, index, pi_buf);
  22 +
  23 +		for (i=0;i<result;i++) {
  24 +			GnomePilotDBInfo *dbinfo;
  25  		
  26 -		dbinfo = g_new0 (GnomePilotDBInfo, 1);
  27 -		/* load next dbinfo block */
  28 -		if (dlp_ReadDBList (pfd, 0, dlpDBListRAM, index, PI_DBINFO (dbinfo)) < 0) {
  29 -			/* is <0, there are no more databases, break
  30 -                           out so we can save the list */
  31 -			break;
  32 +			dbinfo = g_new0 (GnomePilotDBInfo, 1);
  33 +			memcpy (dbinfo, pi_buf->data + (sizeof(struct DBInfo)*i), sizeof(struct DBInfo));
  34 +			index = PI_DBINFO (dbinfo)->index + 1;
  35 +			dbs = g_list_append (dbs, dbinfo);
  36  		}
  37  
  38 -		index = PI_DBINFO (dbinfo)->index + 1;
  39 -
  40 -		dbs = g_list_append (dbs, dbinfo);
  41 +		pi_buffer_free (pi_buf);
  42  	}
  43  
  44  	index = 1;
  45 --- gnome-pilot-2.0.12/gpilotd/gnome-pilot-conduit-standard-abs.c.port-to-pilot-link-0.12	2004-08-26 22:02:48.000000000 -0400
  46 +++ gnome-pilot-2.0.12/gpilotd/gnome-pilot-conduit-standard-abs.c	2005-03-16 18:34:33.000000000 -0500
  47 @@ -31,6 +31,73 @@
  48  #include "gpmarshal.h"
  49  #include "manager.h"
  50  
  51 +
  52 +/* Compatibility routines for old API in pilot-link-0.11 */
  53 +extern int
  54 +gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordById (int sd, int fHandle, recordid_t id, void *buffer,
  55 +							    int *index, int *size, int *attr, int *category);
  56 +
  57 +extern int
  58 +gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordByIndex (int sd, int fHandle, int index, void *buffer,
  59 +							       recordid_t * id, int *size, int *attr,
  60 +							       int *category);
  61 +extern int
  62 +gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadNextModifiedRec (int sd, int fHandle, void *buffer, recordid_t * id,
  63 +								 int *index, int *size, int *attr, int *category);
  64 +
  65 +
  66 +int
  67 +gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordById (int sd, int fHandle, recordid_t id, void *buffer,
  68 +							    int *index, int *size, int *attr, int *category)
  69 +{
  70 +	pi_buffer_t *pi_buf = pi_buffer_new (0xffff);
  71 +	int result = dlp_ReadRecordById (sd, fHandle, id, 
  72 +					 pi_buf,
  73 +					 index, attr, category);
  74 +	memcpy (buffer, pi_buf->data, pi_buf->used);
  75 +	if (NULL==size) {
  76 +		*size = pi_buf->used;
  77 +	}
  78 +	pi_buffer_free (pi_buf);
  79 +
  80 +	return result;
  81 +}
  82 +
  83 +int
  84 +gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordByIndex (int sd, int fHandle, int index, void *buffer,
  85 +							       recordid_t * id, int *size, int *attr,
  86 +							       int *category)
  87 +{
  88 +	pi_buffer_t *pi_buf = pi_buffer_new (0xffff);
  89 +	int result = dlp_ReadRecordByIndex (sd, fHandle, index, 
  90 +					    pi_buf,
  91 +					    id, attr, category);
  92 +	memcpy (buffer, pi_buf->data, pi_buf->used);
  93 +	if (NULL==size) {
  94 +		*size = pi_buf->used;
  95 +	}
  96 +	pi_buffer_free (pi_buf);
  97 +
  98 +	return result;
  99 +}
 100 +
 101 +int
 102 +gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadNextModifiedRec (int sd, int fHandle, void *buffer, recordid_t * id,
 103 +								 int *index, int *size, int *attr, int *category)
 104 +{
 105 +	pi_buffer_t *pi_buf = pi_buffer_new (0xffff);
 106 +	int result = dlp_ReadNextModifiedRec (sd, fHandle, 
 107 +					      pi_buf, 
 108 +					      id, index, attr, category);
 109 +	memcpy (buffer, pi_buf->data, pi_buf->used);
 110 +	if (NULL==size) {
 111 +		*size = pi_buf->used;
 112 +	}
 113 +	pi_buffer_free (pi_buf);
 114 +
 115 +	return result;
 116 +}
 117 +
 118  enum {
 119  	MATCH_RECORD,
 120  	FREE_MATCH,
 121 @@ -433,7 +500,7 @@
 122  		}
 123  		
 124  		/* copy all records */
 125 -		while (dlp_ReadRecordByIndex (dbinfo->pilot_socket,
 126 +		while (gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordByIndex (dbinfo->pilot_socket,
 127  					      dbinfo->db_handle,
 128  					      index,
 129  					      remote.record,
 130 @@ -1081,7 +1148,7 @@
 131  		g_message("gpilotd: retrieve %ld from pilot",local->ID);
 132  		remote = g_new0(PilotRecord,1);
 133  		remote->record = malloc(0xffff);
 134 -		dlp_ReadRecordById(handle,db,
 135 +		gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordById(handle,db,
 136  				   local->ID,
 137  				   remote->record,
 138  				   &index,
 139 @@ -1438,7 +1505,7 @@
 140  	retval = 0;
 141  	remote.record = buffer;
 142  
 143 -	while (dlp_ReadRecordByIndex(handle,db,
 144 +	while (gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordByIndex(handle,db,
 145  				     index,
 146  				     remote.record,
 147  				     &remote.ID,
 148 @@ -1477,7 +1544,7 @@
 149  
 150  	g_message("Performing Slow Synchronization");
 151  
 152 -	while (dlp_ReadRecordByIndex(handle,db,
 153 +	while (gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadRecordByIndex(handle,db,
 154  				     index,
 155  				     remote.record,
 156  				     &remote.ID,
 157 @@ -1517,7 +1584,7 @@
 158  
 159  	g_message("Performing Fast Synchronization");
 160  
 161 -	while (dlp_ReadNextModifiedRec (handle, db,
 162 +	while (gnome_pilot_compat_with_pilot_link_0_11_dlp_ReadNextModifiedRec (handle, db,
 163  					remote.record,
 164  					&remote.ID,
 165  					&index,
 166 --- gnome-pilot-2.0.12/gpilotd/gpilotd.c.port-to-pilot-link-0.12	2004-09-03 12:18:35.000000000 -0400
 167 +++ gnome-pilot-2.0.12/gpilotd/gpilotd.c	2005-03-16 18:34:33.000000000 -0500
 168 @@ -122,7 +122,6 @@
 169  static int 
 170  pilot_connect (GPilotDevice *device,int *error) 
 171  {
 172 -	struct pi_sockaddr addr;
 173  	int sd, listen_sd, pf;
 174  	int ret;
 175      
 176 @@ -154,8 +153,6 @@
 177  		return -1;
 178  	}
 179  	
 180 -	addr.pi_family = PI_AF_PILOT;
 181 -
 182  /*
 183  	Most important for networking
 184  	. resolves inside libpisock as network
 185 @@ -166,9 +163,7 @@
 186  		device->port = "net:any";
 187  	}
 188  
 189 -	strcpy (addr.pi_device,device->port);
 190 -
 191 -	ret = pi_bind (listen_sd, (struct sockaddr*)&addr, sizeof (addr));
 192 +	ret = pi_bind (listen_sd, device->port);
 193  	if (ret == -1) {
 194  		g_warning (_("Unable to bind to pilot"));
 195  		if (error)
 196 --- gnome-pilot-2.0.12/utils/make-password.c.port-to-pilot-link-0.12	2005-03-16 19:23:11.000000000 -0500
 197 +++ gnome-pilot-2.0.12/utils/make-password.c	2005-03-16 19:23:31.000000000 -0500
 198 @@ -28,7 +28,6 @@
 199  
 200  
 201  int main(int argc,char *argv[]) {
 202 -  struct pi_sockaddr addr;
 203    int sd,ret;
 204    struct PilotUser U;
 205    char salt[3];
 206 @@ -42,10 +41,7 @@
 207      exit(1);
 208    }
 209      
 210 -  addr.pi_family = PI_AF_PILOT;
 211 -  strcpy(addr.pi_device,argv[1]);
 212 -  
 213 -  ret = pi_bind(sd, (struct sockaddr*)&addr, sizeof(addr));
 214 +  ret = pi_bind(sd, argv[1]);
 215    if(ret == -1) {
 216      perror("pi_bind");
 217      exit(1);

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2021-02-25 09:59:34, 6.4 KB) [[attachment:gnome-pilot-2.0.12-p1.txt]]
  • [get | view] (2021-02-25 09:59:34, 17.1 KB) [[attachment:gnome-pilot-conduits-2.0.12-p1.txt]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.