+2007-01-23 [colin] 2.7.1cvs52
+
+ * src/toolbar.c
+ Translate toolbar items text if
+ they're translatable (default)
+ * src/addrcache.c
+ * src/addrcache.h
+ * src/addritem.c
+ * src/addritem.h
+ * src/codeconv.c
+ * src/codeconv.h
+ * src/jpilot.c
+ * src/jpilot.h
+ * src/ldapctrl.c
+ * src/ldapctrl.h
+ * src/ldapquery.h
+ * src/ldif.c
+ * src/ldif.h
+ * src/etpan/etpan-thread-manager.c
+ * src/etpan/etpan-thread-manager.h
+ * src/gtk/gtkutils.c
+ * src/gtk/gtkutils.h
+ More static functions
+
2007-01-22 [fabien] 2.7.1cvs51
* src/gtk/gtkutils.c
( cvs diff -u -r 1.3.2.14 -r 1.3.2.15 src/ldapquery.c; cvs diff -u -r 1.4.2.8 -r 1.4.2.9 src/ldapquery.h; ) > 2.7.1cvs49.patchset
( cvs diff -u -r 1.150.2.89 -r 1.150.2.90 src/procmsg.c; cvs diff -u -r 1.60.2.39 -r 1.60.2.40 src/procmsg.h; cvs diff -u -r 1.1.2.24 -r 1.1.2.25 src/plugins/bogofilter/bogofilter.c; cvs diff -u -r 1.1.2.16 -r 1.1.2.17 src/plugins/bogofilter/bogofilter_gtk.c; cvs diff -u -r 1.18.2.46 -r 1.18.2.47 src/plugins/spamassassin/spamassassin.c; cvs diff -u -r 1.23.2.35 -r 1.23.2.36 src/plugins/spamassassin/spamassassin_gtk.c; ) > 2.7.1cvs50.patchset
( cvs diff -u -r 1.5.2.49 -r 1.5.2.50 src/gtk/gtkutils.c; ) > 2.7.1cvs51.patchset
+( cvs diff -u -r 1.15.2.11 -r 1.15.2.12 src/addrcache.c; cvs diff -u -r 1.9.2.6 -r 1.9.2.7 src/addrcache.h; cvs diff -u -r 1.13.2.9 -r 1.13.2.10 src/addritem.c; cvs diff -u -r 1.12.2.7 -r 1.12.2.8 src/addritem.h; cvs diff -u -r 1.65.2.54 -r 1.65.2.55 src/codeconv.c; cvs diff -u -r 1.15.2.18 -r 1.15.2.19 src/codeconv.h; cvs diff -u -r 1.18.2.23 -r 1.18.2.24 src/jpilot.c; cvs diff -u -r 1.10.2.4 -r 1.10.2.5 src/jpilot.h; cvs diff -u -r 1.2.2.7 -r 1.2.2.8 src/ldapctrl.c; cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/ldapctrl.h; cvs diff -u -r 1.4.2.9 -r 1.4.2.10 src/ldapquery.h; cvs diff -u -r 1.12.2.11 -r 1.12.2.12 src/ldif.c; cvs diff -u -r 1.5.2.4 -r 1.5.2.5 src/ldif.h; cvs diff -u -r 1.43.2.60 -r 1.43.2.61 src/toolbar.c; cvs diff -u -r 1.1.4.5 -r 1.1.4.6 src/etpan/etpan-thread-manager.c; cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/etpan/etpan-thread-manager.h; cvs diff -u -r 1.5.2.50 -r 1.5.2.51 src/gtk/gtkutils.c; cvs diff -u -r 1.4.2.30 -r 1.4.2.31 src/gtk/gtkutils.h; ) > 2.7.1cvs52.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=51
+EXTRA_VERSION=52
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
return found;
}
-/*
-* Move email address in address cache to new person. If member of group, address
-* remains in group.
-* param: cache Cache.
-* email EMail to remove.
-* target Target person.
-* return: EMail object, or NULL if not found. Note that object should still be freed.
-*/
-void addrcache_person_move_email(
- AddressCache *cache, ItemEMail *email, ItemPerson *target )
-{
- ItemPerson *person;
-
- g_return_if_fail( cache != NULL );
-
- if( email == NULL ) return;
- if( target == NULL ) return;
-
- person = ( ItemPerson * ) ADDRITEM_PARENT(email);
- if( person ) {
- ItemEMail *found;
- found = addritem_person_remove_email( person, email );
- if( found ) {
- /*
- if( person->listEMail ) {
- person->listEMail = g_list_remove( person->listEMail, found );
- addritem_person_add_email( target, found );
- cache->dirtyFlag = TRUE;
- }
- */
- addritem_person_add_email( target, found );
- cache->dirtyFlag = TRUE;
- }
- }
-}
-
/*
* Group visitor function.
*/
ItemEMail *addrcache_person_remove_email( AddressCache *cache,
ItemPerson *person,
ItemEMail *email );
-void addrcache_person_move_email ( AddressCache *cache,
- ItemEMail *email,
- ItemPerson *target );
-
GList *addrcache_get_group_for_person ( AddressCache *cache, ItemPerson *person );
person->isOpened = value;
}
-/**
- * Test whether person's data is empty.
- * \param person Person to test.
- * \return <i>TRUE</i> if empty.
- */
-gboolean addritem_person_empty( ItemPerson *person ) {
- gchar *t;
-
- if( person == NULL ) return FALSE;
-
- t = ADDRITEM_NAME(person);
- if( t != NULL && strlen( t ) > 0 ) return FALSE;
-
- t = person->firstName;
- if( t != NULL && strlen( t ) > 0 ) return FALSE;
-
- t = person->lastName;
- if( t != NULL && strlen( t ) > 0 ) return FALSE;
-
- t = person->nickName;
- if( t != NULL && strlen( t ) > 0 ) return FALSE;
-
- if( person->listEMail != NULL ) return FALSE;
- if( person->listAttrib != NULL ) return FALSE;
-
- return TRUE;
-}
-
/**
* Free linked list of item addresses; both addresses and the list are freed.
* It is assumed that addresses are *NOT* contained within some other
person->listAttrib = g_list_append( person->listAttrib, attrib );
}
-/**
- * Remove attribute with specified ID from person.
- * \param person Person object.
- * \param aid Attribute ID to remove.
- * \return UserAttribute object, or <i>NULL</i> if not found. Note that
- * attribute object should still be freed after calling this method.
- */
-UserAttribute *addritem_person_remove_attrib_id(
- ItemPerson *person, const gchar *aid )
-{
- UserAttribute *attrib = NULL;
- GList *node;
-
- g_return_val_if_fail( person != NULL, NULL );
- if( aid == NULL || *aid == '\0' ) return NULL;
-
- /* Look for attribute */
- node = person->listAttrib;
- while( node ) {
- UserAttribute *attr = node->data;
- gchar *ida = attr->uid;
- if( ida ) {
- if( strcmp( ida, aid ) == 0 ) {
- attrib = attr;
- }
- }
- node = g_list_next( node );
- }
-
- /* Remove email from person's address list */
- if( person->listAttrib ) {
- person->listAttrib = g_list_remove( person->listAttrib, attrib );
- }
- return attrib;
-}
-
-/**
- * Remove attribute from person.
- * \param person Person.
- * \param attrib Attribute to remove.
- * \return UserAttribute object to remove. Note that attribute object should
- * still be freed.
- */
-UserAttribute *addritem_person_remove_attribute(
- ItemPerson *person, UserAttribute *attrib )
-{
- gboolean found = FALSE;
- GList *node;
-
- g_return_val_if_fail( person != NULL, NULL );
- if( attrib == NULL ) return NULL;
-
- /* Look for attribute */
- node = person->listAttrib;
- while( node ) {
- if( node-> data == attrib ) {
- found = TRUE;
- break;
- }
- node = g_list_next( node );
- }
-
- if( found ) {
- /* Remove attribute */
- if( person->listAttrib ) {
- person->listAttrib = g_list_remove( person->listAttrib, attrib );
- }
- }
- return attrib;
-}
-
/**
* Create new address book group object.
* \return Initialized group object.
return list;
}
-/**
- * Move person's email item.
- * \param person Person.
- * \param itemMove Item to move.
- * \param itemTarget Target item before which to move item.
- * \return Reference to item that was moved, or <i>NULL</i> if null arguments
- * supplied.
- */
-
-ItemEMail *addritem_move_email_before(
- ItemPerson *person, ItemEMail *itemMove, ItemEMail *itemTarget )
-{
- gint posT, posM;
-
- g_return_val_if_fail( person != NULL, NULL );
-
- if( itemTarget == NULL ) return NULL;
- if( itemMove == NULL ) return NULL;
- if( itemMove == itemTarget ) return itemMove;
-
- posT = g_list_index( person->listEMail, itemTarget );
- if( posT < 0 ) return NULL;
- posM = g_list_index( person->listEMail, itemMove );
- if( posM < 0 ) return NULL;
- person->listEMail = g_list_remove( person->listEMail, itemMove );
- person->listEMail = g_list_insert( person->listEMail, itemMove, posT );
- return itemMove;
-}
-
-/**
- * Move person's email item.
- * \param person Person.
- * \param itemMove Item to move.
- * \param itemTarget Target item after which to move item.
- * \return Reference to item that was moved, or <i>NULL</i> if null arguments
- * supplied.
- */
-ItemEMail *addritem_move_email_after(
- ItemPerson *person, ItemEMail *itemMove, ItemEMail *itemTarget )
-{
- gint posT, posM;
-
- g_return_val_if_fail( person != NULL, NULL );
-
- if( itemTarget == NULL ) return NULL;
- if( itemMove == NULL ) return NULL;
- if( itemMove == itemTarget ) return itemMove;
-
- posT = g_list_index( person->listEMail, itemTarget );
- if( posT < 0 ) return NULL;
- posM = g_list_index( person->listEMail, itemMove );
- if( posM < 0 ) return NULL;
- person->listEMail = g_list_remove( person->listEMail, itemMove );
- person->listEMail = g_list_insert( person->listEMail, itemMove, 1+posT );
- return itemMove;
-}
-
/**
* Parse first and last names for person from common name.
* \param person Person to process.
void addritem_person_set_external_id ( ItemPerson *person, const gchar *value );
void addritem_person_set_opened ( ItemPerson *person, const gboolean value );
void addritem_free_item_person ( ItemPerson *person );
-gboolean addritem_person_empty ( ItemPerson *person );
void addritem_free_list_email ( GList *list );
void addritem_free_list_attribute ( GList *list );
ItemEMail *addritem_person_remove_email ( ItemPerson *person, ItemEMail *email );
void addritem_person_add_attribute ( ItemPerson *person, UserAttribute *attrib );
-UserAttribute *addritem_person_remove_attrib_id ( ItemPerson *person, const gchar *aid );
-UserAttribute *addritem_person_remove_attribute ( ItemPerson *person, UserAttribute *attrib );
ItemFolder *addritem_create_item_folder ( void );
ItemFolder *addritem_copy_item_folder ( ItemFolder *item );
GList *addritem_folder_get_person_list ( ItemFolder *folder );
GList *addritem_folder_get_group_list ( ItemFolder *folder );
-ItemEMail *addritem_move_email_before ( ItemPerson *person,
- ItemEMail *itemMove,
- ItemEMail *itemTarget );
-ItemEMail *addritem_move_email_after ( ItemPerson *person,
- ItemEMail *itemMove,
- ItemEMail *itemTarget );
-
void addritem_parse_first_last ( ItemPerson *person );
GList *addritem_folder_path ( const ItemFolder *folder,
const gboolean seq );
static CodeConvFunc conv_get_code_conv_func (const gchar *src_charset_str,
const gchar *dest_charset_str);
+static gchar *conv_iconv_strdup_with_cd (const gchar *inbuf,
+ iconv_t cd);
+
static CharSet conv_get_locale_charset (void);
static CharSet conv_get_outgoing_charset (void);
static CharSet conv_guess_ja_encoding(const gchar *str);
gchar *conv_iconv_strdup (const gchar *inbuf,
const gchar *src_code,
const gchar *dest_code);
-gchar *conv_iconv_strdup_with_cd (const gchar *inbuf,
- iconv_t cd);
const gchar *conv_get_charset_str (CharSet charset);
CharSet conv_get_charset_from_str (const gchar *charset);
#define POOL_INIT_SIZE 8
#define OP_INIT_SIZE 8
+static int etpan_thread_start(struct etpan_thread * thread);
static void etpan_thread_free(struct etpan_thread * thread);
static unsigned int etpan_thread_get_load(struct etpan_thread * thread);
static int etpan_thread_is_bound(struct etpan_thread * thread);
return NULL;
}
-int etpan_thread_start(struct etpan_thread * thread)
+static int etpan_thread_start(struct etpan_thread * thread)
{
int r;
/* this thread will be joined in the manager loop */
}
-int etpan_thread_is_stopped(struct etpan_thread * thread)
+static int etpan_thread_is_stopped(struct etpan_thread * thread)
{
int stopped;
/* ** thread creation ** */
-int etpan_thread_start(struct etpan_thread * thread);
-
-int etpan_thread_is_stopped(struct etpan_thread * thread);
-
struct etpan_thread *
etpan_thread_manager_get_thread(struct etpan_thread_manager * manager);
}
#if HAVE_LIBCOMPFACE
-gint create_xpm_from_xface(gchar *xpm[], const gchar *xface)
+static gint create_xpm_from_xface(gchar *xpm[], const gchar *xface)
{
static gchar *bit_pattern[] = {
"....",
GtkWidget *gtkut_get_replace_btn(const gchar *label);
GtkWidget *gtkut_get_options_frame(GtkWidget *box, GtkWidget **frame, const gchar *frame_label);
#if HAVE_LIBCOMPFACE
-gint create_xpm_from_xface(gchar *xpm[], const gchar *xface);
GtkWidget *xface_get_from_header(const gchar *o_xface, GdkColor *background,
GdkWindow *window);
#endif
pilotFile->addressCache->modified = jpilot_check_files( pilotFile );
return pilotFile->addressCache->modified;
}
-void jpilot_set_modified( JPilotFile *pilotFile, const gboolean value ) {
- g_return_if_fail( pilotFile != NULL );
- pilotFile->addressCache->modified = value;
-}
gboolean jpilot_get_accessed( JPilotFile *pilotFile ) {
g_return_val_if_fail( pilotFile != NULL, FALSE );
return pilotFile->addressCache->accessFlag;
g_free( pilotFile );
}
-/*
-* Refresh internal variables to force a file read.
-*/
-void jpilot_force_refresh( JPilotFile *pilotFile ) {
- addrcache_refresh( pilotFile->addressCache );
-}
-
-/*
-* Print object to specified stream.
-*/
-void jpilot_print_file( JPilotFile *pilotFile, FILE *stream ) {
- GList *node;
-
- g_return_if_fail( pilotFile != NULL );
-
- fprintf( stream, "JPilotFile:\n" );
- fprintf( stream, "file spec: '%s'\n", pilotFile->path );
- fprintf( stream, " metadata: %s\n", pilotFile->readMetadata ? "yes" : "no" );
- fprintf( stream, " ret val: %d\n", pilotFile->retVal );
-
- node = pilotFile->customLabels;
- while( node ) {
- fprintf( stream, " c label: %s\n", (gchar *)node->data );
- node = g_list_next( node );
- }
-
- node = pilotFile->labelInd;
- while( node ) {
- fprintf( stream, " labelind: %d\n", GPOINTER_TO_INT(node->data) );
- node = g_list_next( node );
- }
-
- 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: %lu\n", pilotFile->pc3ModifyTime );
- addritem_print_item_folder( pilotFile->addressCache->rootFolder, stream );
-}
-
-/*
-* Print summary of object to specified stream.
-*/
-void jpilot_print_short( JPilotFile *pilotFile, FILE *stream ) {
- GList *node;
- g_return_if_fail( pilotFile != NULL );
- fprintf( stream, "JPilotFile:\n" );
- fprintf( stream, "file spec: '%s'\n", pilotFile->path );
- fprintf( stream, " metadata: %s\n", pilotFile->readMetadata ? "yes" : "no" );
- fprintf( stream, " ret val: %d\n", pilotFile->retVal );
-
- node = pilotFile->customLabels;
- while( node ) {
- fprintf( stream, " c label: %s\n", (gchar *)node->data );
- node = g_list_next( node );
- }
-
- node = pilotFile->labelInd;
- while( node ) {
- fprintf( stream, " labelind: %d\n", GPOINTER_TO_INT(node->data) );
- node = g_list_next( node );
- }
- addrcache_print( pilotFile->addressCache, stream );
- fprintf( stream, " have pc3: %s\n", pilotFile->havePC3 ? "yes" : "no" );
- fprintf( stream, " pc3 time: %lu\n", pilotFile->pc3ModifyTime );
-}
-
/* Shamelessly copied from JPilot (libplugin.c) */
static unsigned int bytes_to_bin(unsigned char *bytes, unsigned int num_bytes) {
unsigned int i, n;
return retVal;
}
-/**
- * Load list with character strings of label names.
- * \param pilotFile JPilot control data.
- * \param labelList List of label names to load.
- * \return List of label names loaded.
- */
-GList *jpilot_load_label( JPilotFile *pilotFile, GList *labelList ) {
- int i;
-
- g_return_val_if_fail( pilotFile != NULL, NULL );
-
- if( pilotFile->readMetadata ) {
- struct AddressAppInfo *ai = & pilotFile->addrInfo;
- for( i = 0; i < JPILOT_NUM_LABELS; i++ ) {
- gchar *labelName = ai->labels[i];
-
- if( labelName ) {
- if( convert_charcode ) {
- gchar *convertBuff = NULL;
- convertBuff = conv_codeset_strdup( labelName,
- jpilot_get_charset(),
- CS_INTERNAL );
- if (convertBuff) {
- labelName = convertBuff;
- }
- }
- else {
- labelName = g_strdup( labelName );
- }
- labelList = g_list_append( labelList, labelName );
- }
- else {
- labelList = g_list_append(
- labelList, g_strdup( "" ) );
- }
- }
- }
- return labelList;
-}
-
-/**
- * Return category name for specified category ID.
- * \param pilotFile JPilot control data.
- * \param catID Category ID.
- * \return Category name, or empty string if not invalid ID. Name should be
- * <code>g_free()</code> when done.
- */
-gchar *jpilot_get_category_name( JPilotFile *pilotFile, gint catID ) {
- gchar *catName = NULL;
-
- g_return_val_if_fail( pilotFile != NULL, NULL );
-
- if( pilotFile->readMetadata ) {
- struct AddressAppInfo *ai = & pilotFile->addrInfo;
- struct CategoryAppInfo *cat = & ai->category;
- if( catID < 0 || catID > JPILOT_NUM_CATEG ) {
- }
- else {
- catName = g_strdup( cat->name[catID] );
- }
- }
- if( ! catName ) catName = g_strdup( "" );
- return catName;
-}
-
-/**
- * Load list with character strings of phone label names.
- * \param pilotFile JPilot control data.
- * \param labelList List of label names to load.
- * \return List of label names loaded.
- */
-GList *jpilot_load_phone_label( JPilotFile *pilotFile, GList *labelList ) {
- gint i;
-
- g_return_val_if_fail( pilotFile != NULL, NULL );
-
- if( pilotFile->readMetadata ) {
- struct AddressAppInfo *ai = & pilotFile->addrInfo;
- for( i = 0; i < JPILOT_NUM_PHONELABELS; i++ ) {
- gchar *labelName = ai->phoneLabels[i];
- if( labelName ) {
- labelList = g_list_append(
- labelList, g_strdup( labelName ) );
- }
- else {
- labelList = g_list_append(
- labelList, g_strdup( "" ) );
- }
- }
- }
- return labelList;
-}
-
/**
* Load list with character strings of custom label names. Only none blank
* names are loaded.
return labelList;
}
-/**
- * Load list with character strings of category names.
- * \param pilotFile JPilot control data.
- * \return List of label names loaded. Should be freed when done.
- */
-GList *jpilot_get_category_list( JPilotFile *pilotFile ) {
- GList *catList = NULL;
- gint i;
-
- g_return_val_if_fail( pilotFile != NULL, NULL );
-
- if( pilotFile->readMetadata ) {
- struct AddressAppInfo *ai = & pilotFile->addrInfo;
- struct CategoryAppInfo *cat = & ai->category;
- for( i = 0; i < JPILOT_NUM_CATEG; i++ ) {
- gchar *catName = cat->name[i];
- if( catName ) {
- catList = g_list_append(
- catList, g_strdup( catName ) );
- }
- else {
- catList = g_list_append(
- catList, g_strdup( "" ) );
- }
- }
- }
- return catList;
-}
-
/**
* Build folder in address book for each category.
* \param pilotFile JPilot control data.
return addrcache_get_all_persons( pilotFile->addressCache );
}
-/**
- * Validate that all parameters specified.
- * \param pilotFile JPilot control data.
- * \return <i>TRUE</i> if data is good.
- */
-gboolean jpilot_validate( JPilotFile *pilotFile ) {
- gboolean retVal;
- gchar *name;
-
- g_return_val_if_fail( pilotFile != NULL, FALSE );
-
- retVal = TRUE;
- if( pilotFile->path ) {
- if( strlen( pilotFile->path ) < 1 ) retVal = FALSE;
- }
- else {
- retVal = FALSE;
- }
- name = jpilot_get_name( pilotFile );
- if( name ) {
- if( strlen( name ) < 1 ) retVal = FALSE;
- }
- else {
- retVal = FALSE;
- }
- return retVal;
-}
-
#define WORK_BUFLEN 1024
/**
return g_strdup( str );
}
-/**
- * Attempt to read file, testing for valid JPilot format.
- * \param fileSpec File specification to read.
- * \return <i>TRUE<i> if file appears to be valid format.
- */
-gint jpilot_test_read_file( const gchar *fileSpec ) {
- JPilotFile *pilotFile;
- gint retVal;
-
- if( fileSpec ) {
- pilotFile = jpilot_create_path( fileSpec );
- retVal = jpilot_read_metadata( pilotFile );
- jpilot_free( pilotFile );
- pilotFile = NULL;
- }
- else {
- retVal = MGU_NO_FILE;
- }
- return retVal;
-}
-
/**
* Check whether label is in list of custom labels.
* \param pilotFile JPilot control data.
void jpilot_free ( JPilotFile *pilotFile );
gint jpilot_get_status ( JPilotFile *pilotFile );
gboolean jpilot_get_modified ( JPilotFile *pilotFile );
-void jpilot_set_modified ( JPilotFile *pilotFile, const gboolean value );
gboolean jpilot_get_accessed ( JPilotFile *pilotFile );
void jpilot_set_accessed ( JPilotFile *pilotFile, const gboolean value );
gboolean jpilot_get_read_flag ( JPilotFile *pilotFile );
ItemFolder *jpilot_get_root_folder ( JPilotFile *pilotFile );
gchar *jpilot_get_name ( JPilotFile *pilotFile );
-void jpilot_force_refresh ( JPilotFile *pilotFile );
-void jpilot_print_file ( JPilotFile *jpilotFile, FILE *stream );
-void jpilot_print_short ( JPilotFile *pilotFile, FILE *stream );
gint jpilot_read_data ( JPilotFile *pilotFile );
GList *jpilot_get_list_person ( JPilotFile *pilotFile );
GList *jpilot_get_list_folder ( JPilotFile *pilotFile );
GList *jpilot_get_all_persons ( JPilotFile *pilotFile );
-GList *jpilot_load_label ( JPilotFile *pilotFile, GList *labelList );
-GList *jpilot_get_category_list ( JPilotFile *pilotFile );
-gchar *jpilot_get_category_name ( JPilotFile *pilotFile, gint catID );
-GList *jpilot_load_phone_label ( JPilotFile *pilotFile, GList *labelList );
GList *jpilot_load_custom_label ( JPilotFile *pilotFile, GList *labelList );
-gboolean jpilot_validate ( JPilotFile *pilotFile );
gchar *jpilot_find_pilotdb ( void );
-gint jpilot_test_read_file ( const gchar *fileSpec );
void jpilot_clear_custom_labels ( JPilotFile *pilotFile );
void jpilot_add_custom_label ( JPilotFile *pilotFile, const gchar *labelName );
ctl->enableSSL = value;
}
-/**
- * Specify search criteria list to be used.
- * \param ctl Control data object.
- * \param value Linked list of LDAP attribute names to use for search.
- */
-void ldapctl_set_criteria_list( LdapControl* ctl, GList *value ) {
- g_return_if_fail( ctl != NULL );
- mgu_free_dlist( ctl->listCriteria );
- ctl->listCriteria = value;
-}
-
/**
* Return search criteria list.
* \param ctl Control data object.
}
}
-/**
- * Build criteria list using default attributes.
- * \param ctl Control object to process.
- */
-void ldapctl_default_attributes( LdapControl *ctl ) {
- g_return_if_fail( ctl != NULL );
-
- ldapctl_criteria_list_clear( ctl );
- ldapctl_criteria_list_add( ctl, LDAPCTL_ATTR_COMMONNAME );
- ldapctl_criteria_list_add( ctl, LDAPCTL_ATTR_GIVENNAME );
- ldapctl_criteria_list_add( ctl, LDAPCTL_ATTR_SURNAME );
- ldapctl_criteria_list_add( ctl, LDAPCTL_ATTR_EMAIL );
-}
-
/**
* Clear LDAP server member variables.
* \param ctl Control object to clear.
*/
-void ldapctl_clear( LdapControl *ctl ) {
+static void ldapctl_clear( LdapControl *ctl ) {
g_return_if_fail( ctl != NULL );
/* Free internal stuff */
g_free( ctl );
}
-/**
- * Setup default (empty) values for specified object.
- * \param ctl Control object to process.
- */
-void ldapctl_default_values( LdapControl *ctl ) {
- g_return_if_fail( ctl != NULL );
-
- /* Clear our destination */
- ldapctl_clear( ctl );
-
- /* Copy strings */
- ctl->hostName = g_strdup( "" );
- ctl->baseDN = g_strdup( "" );
- ctl->bindDN = g_strdup( "" );
- ctl->bindPass = g_strdup( "" );
- ctl->port = LDAPCTL_DFL_PORT;
- ctl->maxEntries = LDAPCTL_MAX_ENTRIES;
- ctl->timeOut = LDAPCTL_DFL_TIMEOUT;
- ctl->maxQueryAge = LDAPCTL_DFL_QUERY_AGE;
- ctl->matchingOption = LDAPCTL_MATCH_BEGINWITH;
- ctl->version = 0;
- ctl->enableTLS = FALSE;
- ctl->enableSSL = FALSE;
-
- ldapctl_default_attributes( ctl );
-}
-
/**
* Display object to specified stream.
* \param ctl Control object to process.
void ldapctl_set_matching_option( LdapControl* ctl, const gint value );
void ldapctl_set_tls ( LdapControl* ctl, const gboolean value );
void ldapctl_set_ssl ( LdapControl* ctl, const gboolean value );
-void ldapctl_set_criteria_list ( LdapControl* ctl, GList *value );
GList *ldapctl_get_criteria_list( const LdapControl* ctl );
void ldapctl_criteria_list_clear( LdapControl *ctl );
void ldapctl_criteria_list_add ( LdapControl *ctl, gchar *attr );
-void ldapctl_default_attributes ( LdapControl *ctl );
-void ldapctl_clear ( LdapControl *ctl );
void ldapctl_free ( LdapControl *ctl );
-void ldapctl_default_values ( LdapControl *ctl );
void ldapctl_print ( const LdapControl *ctl, FILE *stream );
void ldapctl_copy ( const LdapControl *ctlFrom,
LdapControl *ctlTo );
#include "addrquery.h"
#include "ldapctrl.h"
-#include "ldapserver.h"
#include "addritem.h"
#include "addrcache.h"
+#include "ldapserver.h"
typedef struct _LdapQuery LdapQuery;
struct _LdapQuery {
ldifFile->accessFlag = value;
}
-/**
- * Register a progress indicator callback function.
- *
- * \param ldifFile LDIF import control object.
- * \param func Function to be called. When called, the function will be
- * passed the following arguments:
- *
- * <ul>
- * <li>LdifFile object,</li>
- * <li>File size (long),</li>
- * <li>Current position (long)</li>
- * </ul>
- */
-void ldif_set_callback( LdifFile *ldifFile, void *func ) {
- ldifFile->cbProgress = func;
-}
-
/**
* Create field record object.
* \return Initialized LDIF field object.
g_free( ldifFile );
}
-/**
- * Display field record.
- * \param rec LDIF field object.
- * \param stream File output stream.
- */
-void ldif_print_fieldrec( Ldif_FieldRec *rec, FILE *stream ) {
- fprintf( stream, "\ttag:\t%s", rec->reserved ? "yes" : "no" );
- fprintf( stream, "\t%s", rec->selected ? "yes" : "no" );
- fprintf( stream, "\t:%s:\t:%s:\n", rec->userName, rec->tagName );
-}
-
-/**
- * Display field record.
- * \param key Key.
- * \param value Value (the LDIF field record).
- * \param data User data (file output stream).
- *
- */
-static void ldif_print_file_vis( gpointer key, gpointer value, gpointer data ) {
- Ldif_FieldRec *rec = value;
- FILE *stream = data;
- ldif_print_fieldrec( rec, stream );
-}
-
-/**
- * Display object to specified stream.
- * \param ldifFile LDIF import control object.
- * \param stream File output stream.
- */
-void ldif_print_file( LdifFile *ldifFile, FILE *stream ) {
- g_return_if_fail( ldifFile != NULL );
- fprintf( stream, "LDIF File:\n" );
- fprintf( stream, "file spec: '%s'\n", ldifFile->path );
- fprintf( stream, " ret val: %d\n", ldifFile->retVal );
- fprintf( stream, " fields: {\n" );
- g_hash_table_foreach( ldifFile->hashFields, ldif_print_file_vis, stream );
- fprintf( stream, "} ---\n" );
-}
-
/**
* Open file for read.
* \param ldifFile LDIF import control object.
LdifFile *ldif_create ( void );
void ldif_set_file ( LdifFile* ldifFile, const gchar *value );
void ldif_set_accessed ( LdifFile* ldifFile, const gboolean value );
-void ldif_set_callback ( LdifFile *ldifFile, void *func );
void ldif_field_set_name ( Ldif_FieldRec *rec, const gchar *value );
void ldif_field_set_selected ( Ldif_FieldRec *rec, const gboolean value );
void ldif_field_toggle ( Ldif_FieldRec *rec );
void ldif_free ( LdifFile *ldifFile );
-void ldif_print_fieldrec ( Ldif_FieldRec *rec, FILE *stream );
void ldif_print_file ( LdifFile *ldifFile, FILE *stream );
gint ldif_import_data ( LdifFile *ldifFile, AddressCache *cache );
gint ldif_read_tags ( LdifFile *ldifFile );
if (g_utf8_collate(name, TOOLBAR_ICON_FILE) == 0)
item->file = g_strdup (value);
else if (g_utf8_collate(name, TOOLBAR_ICON_TEXT) == 0)
- item->text = g_strdup (value);
+ item->text = g_strdup (gettext(value));
else if (g_utf8_collate(name, TOOLBAR_ICON_ACTION) == 0)
item->index = toolbar_ret_val_from_text(value);
if (item->index == -1 && !strcmp(value, "A_DELETE")) {
GTK_RELIEF_NONE);
gtk_toolbar_append_widget(GTK_TOOLBAR(toolbar),
GTK_WIDGET_PTR(ham_combo),
- _("Learn as..."), "Learn");
+ _("Learn as..."), _("Learn"));
toolbar_data->ham_combo = ham_combo;
break;
case A_REPLY_MESSAGE: