/* * Copyright (C) 2000 Ximian Inc. * * Authors: Michael Zucchi * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #include "camel-address.h" static void camel_address_class_init (CamelAddressClass *klass); static void camel_address_init (CamelAddress *obj); static void camel_address_finalize (CamelObject *obj); static CamelObjectClass *camel_address_parent; static void camel_address_class_init (CamelAddressClass *klass) { camel_address_parent = camel_type_get_global_classfuncs (camel_object_get_type ()); } static void camel_address_init (CamelAddress *obj) { obj->addresses = g_ptr_array_new(); } static void camel_address_finalize (CamelObject *obj) { camel_address_remove((CamelAddress *)obj, -1); g_ptr_array_free(((CamelAddress *)obj)->addresses, TRUE); } CamelType camel_address_get_type (void) { static CamelType type = CAMEL_INVALID_TYPE; if (type == CAMEL_INVALID_TYPE) { type = camel_type_register (camel_object_get_type (), "CamelAddress", sizeof (CamelAddress), sizeof (CamelAddressClass), (CamelObjectClassInitFunc) camel_address_class_init, NULL, (CamelObjectInitFunc) camel_address_init, (CamelObjectFinalizeFunc) camel_address_finalize); } return type; } /** * camel_address_new: * * Create a new CamelAddress object. * * Return value: A new CamelAddress widget. **/ CamelAddress * camel_address_new (void) { CamelAddress *new = CAMEL_ADDRESS(camel_object_new(camel_address_get_type())); return new; } /** * camel_address_new_clone: * @in: * * Clone an existing address type. * * Return value: **/ CamelAddress * camel_address_new_clone(const CamelAddress *in) { CamelAddress *new = CAMEL_ADDRESS(camel_object_new(CAMEL_OBJECT_GET_TYPE(in))); camel_address_cat(new, in); return new; } /** * camel_address_length: * @a: * * Return the number of addresses stored in the address @a. * * Return value: **/ int camel_address_length(CamelAddress *a) { return a->addresses->len; } /** * camel_address_decode: * @a: An address. * @raw: Raw address description. * * Construct a new address from a raw address field. * * Return value: Returns the number of addresses found, * or -1 if the addresses could not be parsed fully. **/ int camel_address_decode (CamelAddress *a, const char *raw) { g_return_val_if_fail(CAMEL_IS_ADDRESS(a), -1); return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->decode(a, raw); } /** * camel_address_encode: * @a: * * Encode an address in a format suitable for a raw header. * * Return value: The encoded address. **/ char * camel_address_encode (CamelAddress *a) { g_return_val_if_fail(CAMEL_IS_ADDRESS(a), NULL); return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->encode(a); } /** * camel_address_unformat: * @a: * @raw: * * Attempt to convert a previously formatted and/or edited * address back into internal form. * * Return value: -1 if it could not be parsed, or the number * of valid addresses found. **/ int camel_address_unformat(CamelAddress *a, const char *raw) { g_return_val_if_fail(CAMEL_IS_ADDRESS(a), -1); return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->unformat(a, raw); } /** * camel_address_format: * @a: * * Format an address in a format suitable for display. * * Return value: The formatted address. **/ char * camel_address_format (CamelAddress *a) { if (a == NULL) return NULL; g_return_val_if_fail(CAMEL_IS_ADDRESS(a), NULL); return CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->format(a); } /** * camel_address_cat: * @dest: * @source: * * Concatenate one address onto another. The addresses must * be of the same type. * * Return value: **/ int camel_address_cat (CamelAddress *dest, const CamelAddress *source) { g_return_val_if_fail(CAMEL_IS_ADDRESS(dest), -1); g_return_val_if_fail(CAMEL_IS_ADDRESS(source), -1); return CAMEL_ADDRESS_CLASS(CAMEL_OBJECT_GET_CLASS(dest))->cat(dest, source); } /** * camel_address_copy: * @dest: * @source: * * Copy an address contents. * * Return value: **/ int camel_address_copy (CamelAddress *dest, const CamelAddress *source) { g_return_val_if_fail(CAMEL_IS_ADDRESS(dest), -1); g_return_val_if_fail(CAMEL_IS_ADDRESS(source), -1); camel_address_remove(dest, -1); return camel_address_cat(dest, source); } /** * camel_address_remove: * @a: * @index: The address to remove, use -1 to remove all address. * * Remove an address by index, or all addresses. **/ void camel_address_remove (CamelAddress *a, int index) { g_return_if_fail(CAMEL_IS_ADDRESS(a)); if (index == -1) { for (index=a->addresses->len; index>-1; index--) CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->remove(a, index); } else { CAMEL_ADDRESS_CLASS (CAMEL_OBJECT_GET_CLASS (a))->remove(a, index); } } devel/electron4/files/lodash-4.17.19&id=530706893f31269bbfa303e069f2e76cbbe2fce7'>refslogtreecommitdiffstats
path: root/sysutils/synergy
Commit message (Expand)AuthorAgeFilesLines
* Update to 1.3.8kevlo2011-11-293-11/+12
* - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-241-1/+1
* Update to 1.3.6kevlo2011-03-112-12/+17
* Update to 1.3.4kevlo2010-11-018-172/+6
* Register CONFLICTSehaupt2009-10-231-1/+3
* - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-221-2/+1
* Install documentation.kevlo2008-10-312-1/+28
* Back out my previous change - it broke the server partkevlo2008-10-172-59/+1
* - Fix intermittent delayskevlo2008-10-142-1/+59
* - Fix synergy crashing on copy and paste from Fedorakevlo2008-10-133-1/+64
* Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-211-1/+0
* - Remove USE_XLIB/USE_X_PREFIX/USE_XPM in favor of USE_XORGmiwi2008-03-241-2/+2
* Fix a bug when a Windows XP client sends an invalid mouse position tokevlo2007-07-253-1/+59
* - Remove -Werror to fix build on currentsat2007-06-071-1/+4
* - Welcome X.org 7.2 \o/.flz2007-05-201-0/+1
* Respect PTHREAD_LIBSkevlo2006-12-111-0/+2
* Update to 1.3.1kevlo2006-05-184-32/+13
* Fix checksum mismatch. The author regenerated m4 and configure files,kevlo2005-12-021-3/+3
* Update to 1.2.6kevlo2005-11-172-3/+4
* Update to 1.2.5kevlo2005-10-193-13/+3
* Update to 1.2.2kevlo2005-06-172-3/+3
* At Kris's request, back out the MACHINE_ARCH spelling correction untilobrien2005-04-121-1/+1
* Assist getting more ports working on AMD64 by obeying theobrien2005-04-111-1/+1
* Update to 1.2.1kevlo2005-01-192-3/+3
* Update to 1.1.8kevlo2004-09-01