"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libplugin.c" between
jpilot-1.8.2.tar.gz and jpilot-2_0_1.tar.gz

About: J-Pilot is a desktop organizer application for Palm Pilot (PalmOS) devices. Ported to GTK3.

libplugin.c  (jpilot-1.8.2):libplugin.c  (jpilot-2_0_1)
skipping to change at line 321 skipping to change at line 321
/* /*
* if buf_rec->unique_id==0 then the palm assigns an ID, else * if buf_rec->unique_id==0 then the palm assigns an ID, else
* use buf_rec->unique_id. * use buf_rec->unique_id.
*/ */
int jp_pc_write(const char *DB_name, buf_rec *br) int jp_pc_write(const char *DB_name, buf_rec *br)
{ {
PC3RecordHeader header; PC3RecordHeader header;
FILE *out; FILE *out;
unsigned int next_unique_id; unsigned int next_unique_id;
unsigned char packed_header[256]; unsigned char packed_header[256];
int len;
char PC_name[FILENAME_MAX]; char PC_name[FILENAME_MAX];
g_snprintf(PC_name, sizeof(PC_name), "%s.pc3", DB_name); g_snprintf(PC_name, sizeof(PC_name), "%s.pc3", DB_name);
if (br->unique_id==0) { if (br->unique_id==0) {
get_next_unique_pc_id(&next_unique_id); get_next_unique_pc_id(&next_unique_id);
header.unique_id=next_unique_id; header.unique_id=next_unique_id;
br->unique_id=next_unique_id; br->unique_id=next_unique_id;
} else { } else {
header.unique_id=br->unique_id; header.unique_id=br->unique_id;
} }
skipping to change at line 346 skipping to change at line 345
out = jp_open_home_file(PC_name, "a"); out = jp_open_home_file(PC_name, "a");
if (!out) { if (!out) {
jp_logf(JP_LOG_WARN, _("Error opening file: %s\n"), PC_name); jp_logf(JP_LOG_WARN, _("Error opening file: %s\n"), PC_name);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
header.rec_len=br->size; header.rec_len=br->size;
header.rt=br->rt; header.rt=br->rt;
header.attrib=br->attrib; header.attrib=br->attrib;
len = pack_header(&header, packed_header); pack_header(&header, packed_header);
write_header(out, &header); write_header(out, &header);
fwrite(br->buf, header.rec_len, 1, out); fwrite(br->buf, header.rec_len, 1, out);
jp_close_home_file(out); jp_close_home_file(out);
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
int jp_pdb_file_write_app_block(const char *DB_name, void *bufp, int size_in) int jp_pdb_file_write_app_block(const char *DB_name, void *bufp, int size_in)
{ {
skipping to change at line 759 skipping to change at line 758
} }
static void jp_unpack_ntohl(unsigned long *l, unsigned char *src) static void jp_unpack_ntohl(unsigned long *l, unsigned char *src)
{ {
*l=src[0]<<24 | src[1]<<16 | src[2]<<8 | src[3]; *l=src[0]<<24 | src[1]<<16 | src[2]<<8 | src[3];
} }
static int pack_header(PC3RecordHeader *header, unsigned char *packed_header) static int pack_header(PC3RecordHeader *header, unsigned char *packed_header)
{ {
unsigned char *p; unsigned char *p;
unsigned long l;
l=0;
p=packed_header; p=packed_header;
/* /*
* Header structure: * Header structure:
* unsigned long header_len; * unsigned long header_len;
* unsigned long header_version; * unsigned long header_version;
* unsigned long rec_len; * unsigned long rec_len;
* unsigned long unique_id; * unsigned long unique_id;
* unsigned long rt; * unsigned long rt;
* unsigned char attrib; * unsigned char attrib;
*/ */
 End of changes. 4 change blocks. 
4 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)