sync with sylpheed 0.6.3cvs9
authorPaul Mangan <paul@claws-mail.org>
Sat, 20 Oct 2001 07:04:54 +0000 (07:04 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 20 Oct 2001 07:04:54 +0000 (07:04 +0000)
14 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/addressbook.c
src/addrindex.h
src/folder.c
src/foldersel.c
src/jpilot.c
src/jpilot.h
src/ldif.c
src/ldif.h
src/syldap.c
src/syldap.h

index ef24cfbf5f8996ac3c7e07d0410000b35ea8ab92..202ada029b188dc3c5016258e0a126a7c3945421 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,14 @@
        * src/smtp.[ch]: smtp_from(): abort if auth failed.
        * changed C++-style comments into C-style in some files, and
          removed unnecessary commented out codes.
        * src/smtp.[ch]: smtp_from(): abort if auth failed.
        * changed C++-style comments into C-style in some files, and
          removed unnecessary commented out codes.
+       * src/addrcache.[ch]
+         src/addressbook.c
+         src/addrindex.[ch]
+         src/jpilot.[ch]
+         src/syldap.[ch]: updated the addressbook code, and fixed the
+         thread bug of LDAP.
+       * src/ldif.[ch]
+         src/importldif.[ch]: new.
 
 2001-10-18
 
 
 2001-10-18
 
index 609c9e7f29b3ac26164db6203ff86d105536767a..83bd39e5efffb6ec0c733ad5163459c577ba9126 100644 (file)
@@ -1,6 +1,13 @@
+2001-10-20 [paul]      0.6.3claws28
+
+       * sync with sylpheed 0.6.3cvs9
+               see ChangeLog entry 2001-10-19
+
+       * correct Alfons' last ChangeLog.claws entry
+
 2001-10-19 [alfons]
 
 2001-10-19 [alfons]
 
-       * src/gpgtext.[ch]
+       * src/pgptext.[ch]
                fix compilation problems (part of bug #472895)
 
 2001-10-18 [hoa]        0.6.3claws27
                fix compilation problems (part of bug #472895)
 
 2001-10-18 [hoa]        0.6.3claws27
index 50c98ad219e7b8676e6e0ab2b8bb6d1fbd564dbe..b1a69b890da5c95796be344c3b407e87147b56c2 100644 (file)
@@ -3,6 +3,14 @@
        * src/smtp.[ch]: smtp_from(): Ç§¾Ú¤Ë¼ºÇÔ¤·¤¿¾ì¹çÃæÃǤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
        * C++ ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤ò C ¥¹¥¿¥¤¥ë¤ËÊѹ¹¤·¡¢ÉÔÍפʥ³¥á¥ó¥È¥¢¥¦¥È
          ¤µ¤ì¤¿¥³¡¼¥É¤òºï½ü¡£
        * src/smtp.[ch]: smtp_from(): Ç§¾Ú¤Ë¼ºÇÔ¤·¤¿¾ì¹çÃæÃǤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
        * C++ ¥¹¥¿¥¤¥ë¤Î¥³¥á¥ó¥È¤ò C ¥¹¥¿¥¤¥ë¤ËÊѹ¹¤·¡¢ÉÔÍפʥ³¥á¥ó¥È¥¢¥¦¥È
          ¤µ¤ì¤¿¥³¡¼¥É¤òºï½ü¡£
+       * src/addrcache.[ch]
+         src/addressbook.c
+         src/addrindex.[ch]
+         src/jpilot.[ch]
+         src/syldap.[ch]: ¥¢¥É¥ì¥¹Ä¢¤Î¥³¡¼¥É¤ò¹¹¿·¤·¡¢ LDAP ¤Î¥¹¥ì¥Ã¥É
+         ¤Î¥Ð¥°¤ò½¤Àµ¡£
+       * src/ldif.[ch]
+         src/importldif.[ch]: ¿·µ¬¡£
 
 2001-10-18
 
 
 2001-10-18
 
index c0df2f9f5f40f87458de99467fb3efa592a7d953..ef8b8ef477498b03906e2dfa5f7e40d4c04eb759 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws27
+EXTRA_VERSION=claws28
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index bab65e97c45ffd9960cd1d6474a528307356b13e..88ccdc142f4043369dc0843f9f971fe05d24bac7 100644 (file)
@@ -337,7 +337,7 @@ static void addressbook_list_select_clear   (void);
 static void addressbook_list_select_add                (AddressObject *obj);
 static void addressbook_list_select_remove     (AddressObject *obj);
 
 static void addressbook_list_select_add                (AddressObject *obj);
 static void addressbook_list_select_remove     (AddressObject *obj);
 
-static void addressbook_import_ldif_cb         ();
+static void addressbook_import_ldif_cb         (void);
 
 static GtkItemFactoryEntry addressbook_entries[] =
 {
 
 static GtkItemFactoryEntry addressbook_entries[] =
 {
@@ -363,8 +363,8 @@ static GtkItemFactoryEntry addressbook_entries[] =
        {N_("/_Address/---"),           NULL,           NULL, 0, "<Separator>"},
        {N_("/_Address/_Edit"),         "<alt>Return",  addressbook_edit_address_cb,    0, NULL},
        {N_("/_Address/_Delete"),       NULL,           addressbook_delete_address_cb,  0, NULL},
        {N_("/_Address/---"),           NULL,           NULL, 0, "<Separator>"},
        {N_("/_Address/_Edit"),         "<alt>Return",  addressbook_edit_address_cb,    0, NULL},
        {N_("/_Address/_Delete"),       NULL,           addressbook_delete_address_cb,  0, NULL},
-       {N_("/_Tools/---"),             NULL,           NULL, 0, "<Separator>"},
-       {N_("/_Tools/Import _LDIF"),    NULL,           addressbook_import_ldif_cb,     0, NULL},
+       {N_("/_Tools"),                 NULL,           NULL, 0, "<Branch>"},
+       {N_("/_Tools/Import _LDIF file"), NULL,         addressbook_import_ldif_cb,     0, NULL},
        {N_("/_Help"),                  NULL,           NULL, 0, "<LastBranch>"},
        {N_("/_Help/_About"),           NULL,           about_show, 0, NULL}
 };
        {N_("/_Help"),                  NULL,           NULL, 0, "<LastBranch>"},
        {N_("/_Help/_About"),           NULL,           about_show, 0, NULL}
 };
@@ -377,10 +377,9 @@ static GtkItemFactoryEntry addressbook_entries[] =
        {N_("/_Edit/_Paste"),           "<ctl>V",       NULL,                           0, NULL},
        {N_("/_Tools"),                 NULL,           NULL, 0, "<Branch>"},
        {N_("/_Tools/Import _Mozilla"), NULL,           NULL,                           0, NULL},
        {N_("/_Edit/_Paste"),           "<ctl>V",       NULL,                           0, NULL},
        {N_("/_Tools"),                 NULL,           NULL, 0, "<Branch>"},
        {N_("/_Tools/Import _Mozilla"), NULL,           NULL,                           0, NULL},
-       {N_("/_Tools/Import _LDIF"),    NULL,           NULL,                           0, NULL},
        {N_("/_Tools/Import _vCard"),   NULL,           NULL,                           0, NULL},
        {N_("/_Tools/---"),             NULL,           NULL, 0, "<Separator>"},
        {N_("/_Tools/Import _vCard"),   NULL,           NULL,                           0, NULL},
        {N_("/_Tools/---"),             NULL,           NULL, 0, "<Separator>"},
-       {N_("/_Tools/Export _LDIF"),    NULL,           NULL,                           0, NULL},
+       {N_("/_Tools/Export _LDIF file"), NULL,         NULL,                           0, NULL},
        {N_("/_Tools/Export v_Card"),   NULL,           NULL,                           0, NULL},
 */
 
        {N_("/_Tools/Export v_Card"),   NULL,           NULL,                           0, NULL},
 */
 
@@ -3466,28 +3465,24 @@ static void addressbook_import_ldif_cb() {
        GtkCTreeNode *newNode;
 
        adapter = addrbookctl_find_interface( ADDR_IF_BOOK );
        GtkCTreeNode *newNode;
 
        adapter = addrbookctl_find_interface( ADDR_IF_BOOK );
-       if( adapter ) {
-               if( adapter->treeNode ) {
-                       abf = addressbook_imp_ldif( _addressIndex_ );
-                       if( abf ) {
-                               ds = addrindex_index_add_datasource( _addressIndex_, ADDR_IF_BOOK, abf );
-                               ads = addressbook_create_ds_adapter( ds, ADDR_BOOK, NULL );
-                               addressbook_ads_set_name( ads, abf->name );
-                               newNode = addressbook_add_object( adapter->treeNode, ADDRESS_OBJECT(ads) );
-                               if( newNode ) {
-                                       gtk_ctree_select( GTK_CTREE(addrbook.ctree), newNode );
-                                       addrbook.treeSelected = newNode;
-                               }
+       if ( !adapter || !adapter->treeNode ) return;
 
 
-                               /* Notify address completion */
-                               invalidate_address_completion();
-                       }
-               }
+       abf = addressbook_imp_ldif( _addressIndex_ );
+       if ( !abf ) return;
+
+       ds = addrindex_index_add_datasource( _addressIndex_, ADDR_IF_BOOK, abf );
+       ads = addressbook_create_ds_adapter( ds, ADDR_BOOK, NULL );
+       addressbook_ads_set_name( ads, abf->name );
+       newNode = addressbook_add_object( adapter->treeNode, ADDRESS_OBJECT(ads) );
+       if ( newNode ) {
+               gtk_ctree_select( GTK_CTREE(addrbook.ctree), newNode );
+               addrbook.treeSelected = newNode;
        }
 
        }
 
+       /* Notify address completion */
+       invalidate_address_completion();
 }
 
 /*
 * End of Source.
 */
 }
 
 /*
 * End of Source.
 */
-
index 64a402e0cefdb78239c3c0669da920afd509715b..a31ed8e45ad48f5239c78fb0589577919748192c 100644 (file)
@@ -78,7 +78,7 @@ struct _AddressInterface {
        GList *(*getListPerson)( void * );
        GList *(*getAllPersons)( void * );
        GList *(*getAllGroups)( void * );
        GList *(*getListPerson)( void * );
        GList *(*getAllPersons)( void * );
        GList *(*getAllGroups)( void * );
-       gchar *(*getName) ( void * );
+       gchar *(*getName)( void * );
        void (*setAccessFlag)( void *, void * );
 };
 
        void (*setAccessFlag)( void *, void * );
 };
 
index a3202ee343600b1781b05558bdb547b61431f50d..993de0e7e0e2bed7e0eb7d2873f247a7f3176b78 100644 (file)
@@ -1297,7 +1297,7 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
                if (item->ret_rcpt)
                        fputs(" reqretrcpt=\"1\"", fp);
                fprintf(fp,
                if (item->ret_rcpt)
                        fputs(" reqretrcpt=\"1\"", fp);
                fprintf(fp,
-                       " mtime=\"%ld\" new=\"%d\" unread=\"%d\" total=\"%d\"",
+                       " mtime=\"%lu\" new=\"%d\" unread=\"%d\" total=\"%d\"",
                        item->mtime, item->new, item->unread, item->total);
        }
 
                        item->mtime, item->new, item->unread, item->total);
        }
 
index 39e1700eaa1c95a2318263edfe18f46a8162204e..23d14763b40848d8d69074ddf238aea4d8a2b4e0 100644 (file)
@@ -163,12 +163,10 @@ static void foldersel_create(void)
        gtk_ctree_set_indent(GTK_CTREE(ctree), CTREE_INDENT);
        GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(ctree)->column[0].button,
                               GTK_CAN_FOCUS);
        gtk_ctree_set_indent(GTK_CTREE(ctree), CTREE_INDENT);
        GTK_WIDGET_UNSET_FLAGS(GTK_CLIST(ctree)->column[0].button,
                               GTK_CAN_FOCUS);
-       /*                             
-       gtk_signal_connect(GTK_OBJECT(ctree), "tree_select_row",
-                          GTK_SIGNAL_FUNC(foldersel_selected), NULL);
+       /* gtk_signal_connect(GTK_OBJECT(ctree), "tree_select_row",
+                          GTK_SIGNAL_FUNC(foldersel_selected), NULL); */
        gtk_signal_connect(GTK_OBJECT(ctree), "select_row",
                           GTK_SIGNAL_FUNC(foldersel_selected), NULL);
        gtk_signal_connect(GTK_OBJECT(ctree), "select_row",
                           GTK_SIGNAL_FUNC(foldersel_selected), NULL);
-       */
 
        entry = gtk_entry_new();
        gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
 
        entry = gtk_entry_new();
        gtk_box_pack_start(GTK_BOX(vbox), entry, FALSE, FALSE, 0);
index 78108a6a39fd19933c253540cc9b9baa26bea549..ee328c0de2f0848981b12120a6c839e8a9929380 100644 (file)
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <dlfcn.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <dlfcn.h>
+#include <netinet/in.h>
 
 #ifdef HAVE_LIBPISOCK_PI_ARGS_H
 #  include <libpisock/pi-args.h>
 
 #ifdef HAVE_LIBPISOCK_PI_ARGS_H
 #  include <libpisock/pi-args.h>
@@ -138,12 +139,12 @@ typedef struct {
 
 /* Shamelessly copied from JPilot (libplugin.h) */
 typedef struct {
 
 /* Shamelessly copied from JPilot (libplugin.h) */
 typedef struct {
-   unsigned long header_len;
-   unsigned long header_version;
-   unsigned long rec_len;
-   unsigned long unique_id;
-   unsigned long rt; /* Record Type */
-   unsigned char attrib;
+       unsigned long header_len;
+       unsigned long header_version;
+       unsigned long rec_len;
+       unsigned long unique_id;
+       unsigned long rt; /* Record Type */
+       unsigned char attrib;
 } PC3RecordHeader;
 
 /*
 } PC3RecordHeader;
 
 /*
@@ -281,9 +282,9 @@ GList *jpilot_get_custom_labels( JPilotFile *pilotFile ) {
 }
 
 /*
 }
 
 /*
- * Return filespec of PC3 file corresponding to JPilot PDB file.
- * Note: Filespec should be g_free() when done.
- */
+* Return filespec of PC3 file corresponding to JPilot PDB file.
+* Note: Filespec should be g_free() when done.
+*/
 static gchar *jpilot_get_pc3_file( JPilotFile *pilotFile ) {
        gchar *fileSpec, *r;
        gint i, len, pos;
 static gchar *jpilot_get_pc3_file( JPilotFile *pilotFile ) {
        gchar *fileSpec, *r;
        gint i, len, pos;
@@ -349,7 +350,8 @@ static gboolean jpilot_check_files( JPilotFile *pilotFile ) {
        gchar *pcFile;
 
        /* Check main file */
        gchar *pcFile;
 
        /* Check main file */
-       if( addrcache_check_file( pilotFile->addressCache, pilotFile->path ) ) return TRUE;
+       if( addrcache_check_file( pilotFile->addressCache, pilotFile->path ) )
+               return TRUE;
 
        /* Test PC3 file */
        if( ! pilotFile->havePC3 ) return FALSE;
 
        /* Test PC3 file */
        if( ! pilotFile->havePC3 ) return FALSE;
@@ -436,7 +438,7 @@ void jpilot_print_file( JPilotFile *pilotFile, FILE *stream ) {
        addrcache_print( pilotFile->addressCache, stream );
        fprintf( stream, "  ret val: %d\n", pilotFile->retVal );
        fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" );
        addrcache_print( pilotFile->addressCache, stream );
        fprintf( stream, "  ret val: %d\n", pilotFile->retVal );
        fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" );
-       fprintf( stream, " pc3 time: %d\n", pilotFile->pc3ModifyTime );
+       fprintf( stream, " pc3 time: %lu\n", pilotFile->pc3ModifyTime );
        addritem_print_item_folder( pilotFile->addressCache->rootFolder, stream );
 }
 
        addritem_print_item_folder( pilotFile->addressCache->rootFolder, stream );
 }
 
@@ -464,7 +466,7 @@ void jpilot_print_short( JPilotFile *pilotFile, FILE *stream ) {
        }
        addrcache_print( pilotFile->addressCache, stream );
        fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" );
        }
        addrcache_print( pilotFile->addressCache, stream );
        fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" );
-       fprintf( stream, " pc3 time: %d\n", pilotFile->pc3ModifyTime );
+       fprintf( stream, " pc3 time: %lu\n", pilotFile->pc3ModifyTime );
 }
 
 /* Shamelessly copied from JPilot (libplugin.c) */
 }
 
 /* Shamelessly copied from JPilot (libplugin.c) */
@@ -724,7 +726,7 @@ static int read_header(FILE *pc_in, PC3RecordHeader *header) {
        num = fread(&l, sizeof(l), 1, pc_in);
        if (feof(pc_in)) {
                return -1;
        num = fread(&l, sizeof(l), 1, pc_in);
        if (feof(pc_in)) {
                return -1;
-       }      
+       }
        if (num!=1) {
                return num;
        }
        if (num!=1) {
                return num;
        }
@@ -736,7 +738,7 @@ static int read_header(FILE *pc_in, PC3RecordHeader *header) {
        num = fread(packed_header+sizeof(l), len-sizeof(l), 1, pc_in);
        if (feof(pc_in)) {
                return -1;
        num = fread(packed_header+sizeof(l), len-sizeof(l), 1, pc_in);
        if (feof(pc_in)) {
                return -1;
-       }      
+       }
        if (num!=1) {
                return num;
        }
        if (num!=1) {
                return num;
        }
@@ -750,17 +752,17 @@ static gint jpilot_read_next_pc( FILE *in, buf_rec *br ) {
        PC3RecordHeader header;
        int rec_len, num;
        char *record;
        PC3RecordHeader header;
        int rec_len, num;
        char *record;
-   
+
        if(feof(in)) {
        if(feof(in)) {
-               return MGU_EOF;
+               return MGU_EOF;
        }
        num = read_header(in, &header);
        if (num < 1) {
                if (ferror(in)) {
        }
        num = read_header(in, &header);
        if (num < 1) {
                if (ferror(in)) {
-                       return MGU_ERROR_READ;
+                       return MGU_ERROR_READ;
                }
                if (feof(in)) {
                }
                if (feof(in)) {
-                       return MGU_EOF;
+                       return MGU_EOF;
                }
        }
        rec_len = header.rec_len;
                }
        }
        rec_len = header.rec_len;
@@ -772,7 +774,7 @@ static gint jpilot_read_next_pc( FILE *in, buf_rec *br ) {
        if (num != 1) {
                if (ferror(in)) {
                        free(record);
        if (num != 1) {
                if (ferror(in)) {
                        free(record);
-                       return MGU_ERROR_READ;
+                       return MGU_ERROR_READ;
                }
        }
        br->rt = header.rt;
                }
        }
        br->rt = header.rt;
@@ -810,12 +812,12 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        recs_returned = 0;
 
        if( pilotFile->path == NULL ) {
        recs_returned = 0;
 
        if( pilotFile->path == NULL ) {
-               return MGU_BAD_ARGS;
+               return MGU_BAD_ARGS;
        }
        }
-       
+
        in = fopen( pilotFile->path, "r" );
        if (!in) {
        in = fopen( pilotFile->path, "r" );
        if (!in) {
-               return MGU_OPEN_FILE;
+               return MGU_OPEN_FILE;
        }
 
        /* Read the database header */
        }
 
        /* Read the database header */
@@ -835,8 +837,8 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        num_records = dbh.number_of_records;
        out_of_order = 0;
        prev_offset = 0;
        num_records = dbh.number_of_records;
        out_of_order = 0;
        prev_offset = 0;
-   
-       for (i=1; i<num_records+1; i++) {
+
+       for (i = 1; i < num_records + 1; i++) {
                num = fread(&rh, sizeof(record_header), 1, in);
                if (num != 1) {
                        if (ferror(in)) {
                num = fread(&rh, sizeof(record_header), 1, in);
                if (num != 1) {
                        if (ferror(in)) {
@@ -920,7 +922,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
                        temp_br->size = rec_size;
 
                        *records = g_list_append(*records, temp_br);
                        temp_br->size = rec_size;
 
                        *records = g_list_append(*records, temp_br);
-        
+
                        recs_returned++;
                }
        }
                        recs_returned++;
                }
        }
@@ -933,7 +935,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        pc_in = fopen( pcFile, "r");
        g_free( pcFile );
 
        pc_in = fopen( pcFile, "r");
        g_free( pcFile );
 
-       if( pc_in==NULL ) {
+       if( pc_in == NULL ) {
                return MGU_SUCCESS;
        }
 
                return MGU_SUCCESS;
        }
 
@@ -973,8 +975,8 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
        return MGU_SUCCESS;
 }
 
        return MGU_SUCCESS;
 }
 
-#define        FULLNAME_BUFSIZE   256
-#define        EMAIL_BUFSIZE      256
+#define FULLNAME_BUFSIZE       256
+#define EMAIL_BUFSIZE          256
 /*
  * Unpack address, building new data inside cache.
  */
 /*
  * Unpack address, building new data inside cache.
  */
@@ -1001,7 +1003,7 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                addrEnt = addr.entry;
                attrib = buf->attrib;
                unique_id = buf->unique_id;
                addrEnt = addr.entry;
                attrib = buf->attrib;
                unique_id = buf->unique_id;
-               cat_id = attrib & 0x0F;
+               cat_id = attrib & 0x0F;
 
                *fullName = *bufEMail = '\0';
                if( addrEnt[ IND_LABEL_FIRSTNAME ] ) {
 
                *fullName = *bufEMail = '\0';
                if( addrEnt[ IND_LABEL_FIRSTNAME ] ) {
@@ -1048,8 +1050,8 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                                        email = addritem_create_item_email();
                                        addritem_email_set_address( email, bufEMail );
                                        addrcache_id_email( pilotFile->addressCache, email );
                                        email = addritem_create_item_email();
                                        addritem_email_set_address( email, bufEMail );
                                        addrcache_id_email( pilotFile->addressCache, email );
-                                       addrcache_person_add_email(
-                                               pilotFile->addressCache, person, email );
+                                       addrcache_person_add_email
+                                               pilotFile->addressCache, person, email );
                                }
                        }
                }
                                }
                        }
                }
@@ -1074,10 +1076,9 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                                        addritem_email_set_address( email, bufEMail );
                                        addritem_email_set_remarks( email, ai->labels[ind] );
                                        addrcache_id_email( pilotFile->addressCache, email );
                                        addritem_email_set_address( email, bufEMail );
                                        addritem_email_set_remarks( email, ai->labels[ind] );
                                        addrcache_id_email( pilotFile->addressCache, email );
-                                       addrcache_person_add_email(
-                                               pilotFile->addressCache, person, email );
+                                       addrcache_person_add_email
+                                               pilotFile->addressCache, person, email );
                                }
                                }
-
                        }
 
                        node = g_list_next( node );
                        }
 
                        node = g_list_next( node );
@@ -1086,15 +1087,13 @@ static void jpilot_load_address( JPilotFile *pilotFile, buf_rec *buf, ItemFolder
                if( person->listEMail ) {
                        if( cat_id > -1 && cat_id < JPILOT_NUM_CATEG ) {
                                /* Add to specified category */
                if( person->listEMail ) {
                        if( cat_id > -1 && cat_id < JPILOT_NUM_CATEG ) {
                                /* Add to specified category */
-                               addrcache_folder_add_person(
-                                       pilotFile->addressCache, folderInd[cat_id], person );
-                       }
-                       else {
+                               addrcache_folder_add_person
+                                       ( pilotFile->addressCache, folderInd[cat_id], person );
+                       } else {
                                /* Add to root folder */
                                addrcache_add_person( pilotFile->addressCache, person );
                        }
                                /* Add to root folder */
                                addrcache_add_person( pilotFile->addressCache, person );
                        }
-               }
-               else {
+               } else {
                        addritem_free_item_person( person );
                        person = NULL;
                }
                        addritem_free_item_person( person );
                        person = NULL;
                }
@@ -1195,9 +1194,6 @@ static gint jpilot_read_metadata( JPilotFile *pilotFile ) {
                free(buf);
        }
        if( num <= 0 ) {
                free(buf);
        }
        if( num <= 0 ) {
-               /*
-               fprintf( stderr, "error reading '%s'\n", pilotFile->path );
-               */
                pilotFile->retVal = MGU_ERROR_READ;
                return pilotFile->retVal;
        }
                pilotFile->retVal = MGU_ERROR_READ;
                return pilotFile->retVal;
        }
index a6829d2b42ad500c82800cc59e610150282995e3..e1a9faed6d1e41800581a13275ecee094b8e5af4 100644 (file)
@@ -63,11 +63,12 @@ struct _JPilotFile {
 
 /* Limits */
 #define JPILOT_NUM_LABELS      22      /* Number of labels */
 
 /* Limits */
 #define JPILOT_NUM_LABELS      22      /* Number of labels */
-#define JPILOT_NUM_PHONELABELS  8      /* Number of phone number labels */
+#define JPILOT_NUM_PHONELABELS       /* Number of phone number labels */
 #define JPILOT_NUM_CATEG       16      /* Number of categories */
 #define JPILOT_LEN_LABEL       15      /* Max length of label */
 #define JPILOT_LEN_CATEG       15      /* Max length of category */
 #define JPILOT_NUM_CATEG       16      /* Number of categories */
 #define JPILOT_LEN_LABEL       15      /* Max length of label */
 #define JPILOT_LEN_CATEG       15      /* Max length of category */
-#define JPILOT_NUM_ADDR_PHONE   5      /* Number of phone entries a person can have */
+#define JPILOT_NUM_ADDR_PHONE  5       /* Number of phone entries a person
+                                          can have */
 
 /* Function prototypes */
 JPilotFile *jpilot_create              ( void );
 
 /* Function prototypes */
 JPilotFile *jpilot_create              ( void );
@@ -113,4 +114,3 @@ gint jpilot_read_modified           ( JPilotFile *pilotFile );
 #endif /* USE_JPILOT */
 
 #endif /* __JPILOT_H__ */
 #endif /* USE_JPILOT */
 
 #endif /* __JPILOT_H__ */
-
index 69cb709afe8003966cde862e2457363e58920b09..056159f251f239a35e1f0d3885c8f7d2c78aa094 100644 (file)
@@ -347,6 +347,7 @@ static void ldif_clear_rec( Ldif_ParsedRec *rec ) {
        rec->listID = NULL;
 }
 
        rec->listID = NULL;
 }
 
+#if 0
 static void ldif_print_record( Ldif_ParsedRec *rec, FILE *stream ) {
        fprintf( stdout, "LDIF Parsed Record:\n" );
        fprintf( stdout, "common name:" );
 static void ldif_print_record( Ldif_ParsedRec *rec, FILE *stream ) {
        fprintf( stdout, "LDIF Parsed Record:\n" );
        fprintf( stdout, "common name:" );
@@ -368,6 +369,7 @@ static void ldif_print_record( Ldif_ParsedRec *rec, FILE *stream ) {
        mgu_print_list( rec->listID, stdout );
        if( ! rec->listID ) fprintf( stdout, "\n" );
 }
        mgu_print_list( rec->listID, stdout );
        if( ! rec->listID ) fprintf( stdout, "\n" );
 }
+#endif
 
 /*
 * Read file data into address cache.
 
 /*
 * Read file data into address cache.
@@ -454,14 +456,14 @@ static void ldif_read_file( LdifFile *ldifFile, AddressCache *cache ) {
 
 }
 
 
 }
 
-// ============================================================================================
 /*
 /*
+* ============================================================================================
 * Read file into list. Main entry point
 * Enter:  ldifFile LDIF control data.
 *         cache    Address cache to load.
 * Return: Status code.
 * Read file into list. Main entry point
 * Enter:  ldifFile LDIF control data.
 *         cache    Address cache to load.
 * Return: Status code.
+* ============================================================================================
 */
 */
-// ============================================================================================
 gint ldif_import_data( LdifFile *ldifFile, AddressCache *cache ) {
        g_return_val_if_fail( ldifFile != NULL, MGU_BAD_ARGS );
        ldifFile->retVal = MGU_SUCCESS;
 gint ldif_import_data( LdifFile *ldifFile, AddressCache *cache ) {
        g_return_val_if_fail( ldifFile != NULL, MGU_BAD_ARGS );
        ldifFile->retVal = MGU_SUCCESS;
index 5325dbe3aed86a870f488b68cb476f6f08086fcd..71c1350ff6eadfeadeef711e40cb810ff3cfaea7 100644 (file)
@@ -79,7 +79,7 @@ struct _LdifFile {
        gchar        *path;
        gchar        *bufptr;
        gchar        buffer[ LDIFBUFSIZE ];
        gchar        *path;
        gchar        *bufptr;
        gchar        buffer[ LDIFBUFSIZE ];
-       // AddressCache *addressCache;
+       /* AddressCache *addressCache; */
        gint         retVal;
 };
 
        gint         retVal;
 };
 
index 2c496a6af52940dcc6021719d81ff04a2e828f9b..c8f7a8be95089371cf5ccb3c3a82ec2c8d1d3dc0 100644 (file)
@@ -28,6 +28,8 @@
 #ifdef USE_LDAP
 
 #include <glib.h>
 #ifdef USE_LDAP
 
 #include <glib.h>
+#include <gdk/gdk.h>
+#include <gtk/gtkmain.h>
 #include <sys/time.h>
 #include <string.h>
 #include <ldap.h>
 #include <sys/time.h>
 #include <string.h>
 #include <ldap.h>
@@ -234,6 +236,7 @@ void syldap_free( SyldapServer *ldapServer ) {
        g_free( ldapServer->bindPass );
        g_free( ldapServer->searchCriteria );
        g_free( ldapServer->searchValue );
        g_free( ldapServer->bindPass );
        g_free( ldapServer->searchCriteria );
        g_free( ldapServer->searchValue );
+       g_free( ldapServer->thread );
 
        ldapServer->port = 0;
        ldapServer->entriesRead = 0;
 
        ldapServer->port = 0;
        ldapServer->entriesRead = 0;
@@ -253,7 +256,6 @@ void syldap_free( SyldapServer *ldapServer ) {
        ldapServer->searchCriteria = NULL;
        ldapServer->searchValue = NULL;
        ldapServer->addressCache = NULL;
        ldapServer->searchCriteria = NULL;
        ldapServer->searchValue = NULL;
        ldapServer->addressCache = NULL;
-       g_free(ldapServer->thread);
        ldapServer->thread = NULL;
        ldapServer->busyFlag = FALSE;
        ldapServer->retVal = MGU_SUCCESS;
        ldapServer->thread = NULL;
        ldapServer->busyFlag = FALSE;
        ldapServer->retVal = MGU_SUCCESS;
@@ -635,11 +637,11 @@ gint syldap_search( SyldapServer *ldapServer ) {
  * main thread (the thread running the GTK event loop). */
 static gint syldap_display_search_results(SyldapServer *ldapServer)
 {
  * main thread (the thread running the GTK event loop). */
 static gint syldap_display_search_results(SyldapServer *ldapServer)
 {
-       /* NOTE: when this function is called the accompanying thread should 
+       /* NOTE: when this function is called the accompanying thread should
         * already be terminated. */
        gtk_idle_remove(ldapServer->idleId);
        ldapServer->callBack(ldapServer);
         * already be terminated. */
        gtk_idle_remove(ldapServer->idleId);
        ldapServer->callBack(ldapServer);
-       /* FIXME:  match should know whether to free this SyldapServer stuff.  */
+       /* FIXME:  match should know whether to free this SyldapServer stuff. */
        g_free(ldapServer->thread);
        ldapServer->thread = NULL;
        return TRUE;
        g_free(ldapServer->thread);
        ldapServer->thread = NULL;
        return TRUE;
@@ -675,7 +677,6 @@ gint syldap_read_data( SyldapServer *ldapServer ) {
                gdk_threads_enter();
                ldapServer->idleId = gtk_idle_add(syldap_display_search_results, ldapServer);
                gdk_threads_leave();
                gdk_threads_enter();
                ldapServer->idleId = gtk_idle_add(syldap_display_search_results, ldapServer);
                gdk_threads_leave();
-       
        }
 
        return ldapServer->retVal;
        }
 
        return ldapServer->retVal;
@@ -712,7 +713,7 @@ gint syldap_read_data_th( SyldapServer *ldapServer ) {
        ldapServer->busyFlag = FALSE;
        syldap_check_search( ldapServer );
        if( ldapServer->retVal == MGU_SUCCESS ) {
        ldapServer->busyFlag = FALSE;
        syldap_check_search( ldapServer );
        if( ldapServer->retVal == MGU_SUCCESS ) {
-//             debug_print("Staring LDAP read thread\n");
+               /* debug_print("Staring LDAP read thread\n"); */
 
                ldapServer->busyFlag = TRUE;
                ldapServer->thread = g_new0(pthread_t, 1);
 
                ldapServer->busyFlag = TRUE;
                ldapServer->thread = g_new0(pthread_t, 1);
index c6e9d49a72e86370b10183e860daebfd8cd9ae7d..a4c58ebf702f907df8bb9c44cff0bb1a288a68d3 100644 (file)
@@ -65,7 +65,7 @@ struct _SyldapServer {
        pthread_t    *thread;
        gboolean     busyFlag;
        void         (*callBack)( void * );
        pthread_t    *thread;
        gboolean     busyFlag;
        void         (*callBack)( void * );
-       guint        idleId;
+       guint        idleId;
 };
 
 /* Function prototypes */
 };
 
 /* Function prototypes */
@@ -109,4 +109,3 @@ gboolean syldap_test_ldap_lib       ( void );
 #endif /* USE_LDAP */
 
 #endif /* __SYLDAP_H__ */
 #endif /* USE_LDAP */
 
 #endif /* __SYLDAP_H__ */
-