diff options
author | Not Zed <NotZed@HelixCode.com> | 2000-09-28 19:31:29 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2000-09-28 19:31:29 +0800 |
commit | e71de4c02186efe577412709346154df96e35054 (patch) | |
tree | 125ad7e9d02cf42bf8acebefed08c39b8df675e5 /camel/camel-internet-address.c | |
parent | 18579aa7e01b4d313d2cf05f355aa4698b99cf7d (diff) | |
download | gsoc2013-evolution-e71de4c02186efe577412709346154df96e35054.tar.gz gsoc2013-evolution-e71de4c02186efe577412709346154df96e35054.tar.zst gsoc2013-evolution-e71de4c02186efe577412709346154df96e35054.zip |
New function to fold headers.
2000-09-28 Not Zed <NotZed@HelixCode.com>
* camel-mime-utils.c (header_fold): New function to fold headers.
2000-09-27 Not Zed <NotZed@HelixCode.com>
* camel-mime-parser.c (folder_scan_header): If we had an empty
header, then it must be end of the headers too.
(folder_scan_init): No we dont need to init the outbuf with a nul
terminator.
* camel-folder-summary.c (camel_folder_summary_set_uid): New
function to reset the uid to a higher value.
* providers/mbox/camel-mbox-summary.c (camel_mbox_summary_sync):
"something failed (yo!)" what sort of crap is this? Fixed all the
indenting again, what wanker keeps running stuff through indent?
(message_info_new): Check the uid we loaded off the disk, if it
existed already, assign a new one. If it didn't then make sure
the nextuid is higher.
* camel-charset-map.c: New file, used to build a large unicode
decoding mapping table, and use it to determine what is the
lowest charset a given word can be encoded with. Uses tables from
libunicode's source.
* camel-internet-address.c (internet_encode): Use
header_phrase_encode to properly encode the fullname, as required.
refixed indenting. Who keeps doing that?
(camel_internet_address_find_address): Changed fatal return/warnings
into assertions.
* camel-mime-utils.c (header_raw_append_parse): Check : explicitly
(removed from is_fieldname() macro).
(camel_mime_special_table): Changed to short, so we can represent
more bit types.
(quoted_encode): Take a mask of the safe chars for this encoding.
(header_address_decode): Removed a #warning that makes no sense
anymore.
(header_decode_date): Fixed the 'broken date' parser code, if it
ever decoded it it just threw away the result.
(header_encode_string): Use better charset matching for encoding
strings as well.
2000-08-31 Not Zed <NotZed@HelixCode.com>
* providers/mh/camel-mh-summary.c (camel_mh_summary_sync): Save
the index if we do a sync.
(camel_mh_summary_check): Save the index here too. Probably.
svn path=/trunk/; revision=5615
Diffstat (limited to 'camel/camel-internet-address.c')
-rw-r--r-- | camel/camel-internet-address.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c index 712b611741..fe5729280e 100644 --- a/camel/camel-internet-address.c +++ b/camel/camel-internet-address.c @@ -36,11 +36,11 @@ struct _address { }; static void -camel_internet_address_class_init (CamelInternetAddressClass *klass) +camel_internet_address_class_init(CamelInternetAddressClass *klass) { CamelAddressClass *address = (CamelAddressClass *) klass; - camel_internet_address_parent = CAMEL_ADDRESS_CLASS (camel_type_get_global_classfuncs (camel_address_get_type ())); + camel_internet_address_parent = CAMEL_ADDRESS_CLASS(camel_type_get_global_classfuncs(camel_address_get_type())); address->decode = internet_decode; address->encode = internet_encode; @@ -48,23 +48,23 @@ camel_internet_address_class_init (CamelInternetAddressClass *klass) } static void -camel_internet_address_init (CamelInternetAddress *obj) +camel_internet_address_init(CamelInternetAddress *obj) { } CamelType -camel_internet_address_get_type (void) +camel_internet_address_get_type(void) { static CamelType type = CAMEL_INVALID_TYPE; if (type == CAMEL_INVALID_TYPE) { - type = camel_type_register (camel_address_get_type (), "CamelInternetAddress", - sizeof (CamelInternetAddress), - sizeof (CamelInternetAddressClass), - (CamelObjectClassInitFunc) camel_internet_address_class_init, - NULL, - (CamelObjectInitFunc) camel_internet_address_init, - NULL); + type = camel_type_register(camel_address_get_type(), "CamelInternetAddress", + sizeof (CamelInternetAddress), + sizeof (CamelInternetAddressClass), + (CamelObjectClassInitFunc) camel_internet_address_class_init, + NULL, + (CamelObjectInitFunc) camel_internet_address_init, + NULL); } return type; @@ -76,24 +76,24 @@ internet_decode (CamelAddress *a, const char *raw) struct _header_address *ha, *n; /* Should probably use its own decoder or something */ - ha = header_address_decode (raw); + ha = header_address_decode(raw); if (ha) { n = ha; while (n) { if (n->type == HEADER_ADDRESS_NAME) { - camel_internet_address_add ((CamelInternetAddress *)a, n->name, n->v.addr); + camel_internet_address_add((CamelInternetAddress *)a, n->name, n->v.addr); } else if (n->type == HEADER_ADDRESS_GROUP) { struct _header_address *g = n->v.members; while (g) { if (g->type == HEADER_ADDRESS_NAME) - camel_internet_address_add ((CamelInternetAddress *)a, g->name, g->v.addr); + camel_internet_address_add((CamelInternetAddress *)a, g->name, g->v.addr); /* otherwise, its an error, infact */ g = g->next; } } n = n->next; } - header_address_list_clear (&ha); + header_address_list_clear(&ha); } return 0; @@ -109,27 +109,27 @@ internet_encode (CamelAddress *a) if (a->addresses->len == 0) return NULL; - out = g_string_new (""); + out = g_string_new(""); for (i = 0;i < a->addresses->len; i++) { - struct _address *addr = g_ptr_array_index (a->addresses, i); - char *name = header_encode_string (addr->name); + struct _address *addr = g_ptr_array_index(a->addresses, i); + char *name = header_encode_phrase(addr->name); if (i != 0) - g_string_append (out, ", "); + g_string_append(out, ", "); if (name) { - if (*name) - g_string_sprintfa (out, "\"%s\" <%s>", name, addr->address); - else if (addr->address) - g_string_sprintfa (out, "%s", addr->address); - g_free (name); + if (*name) { + g_string_sprintfa(out, "%s <%s>", name, addr->address); + } else if (addr->address) + g_string_sprintfa(out, "%s", addr->address); + g_free(name); } else - g_string_sprintfa (out, "%s", addr->address); + g_string_sprintfa(out, "%s", addr->address); } ret = out->str; - g_string_free (out, FALSE); + g_string_free(out, FALSE); return ret; } @@ -142,11 +142,11 @@ internet_remove (CamelAddress *a, int index) if (index < 0 || index >= a->addresses->len) return; - addr = g_ptr_array_index (a->addresses, index); - g_free (addr->name); - g_free (addr->address); - g_free (addr); - g_ptr_array_remove_index (a->addresses, index); + addr = g_ptr_array_index(a->addresses, index); + g_free(addr->name); + g_free(addr->address); + g_free(addr); + g_ptr_array_remove_index(a->addresses, index); } /** @@ -159,7 +159,7 @@ internet_remove (CamelAddress *a, int index) CamelInternetAddress * camel_internet_address_new (void) { - CamelInternetAddress *new = CAMEL_INTERNET_ADDRESS (camel_object_new (camel_internet_address_get_type ())); + CamelInternetAddress *new = CAMEL_INTERNET_ADDRESS(camel_object_new(camel_internet_address_get_type())); return new; } @@ -179,7 +179,7 @@ camel_internet_address_add (CamelInternetAddress *a, const char *name, const cha struct _address *new; int index; - g_return_val_if_fail(IS_CAMEL_INTERNET_ADDRESS(a), -1); + g_assert(IS_CAMEL_INTERNET_ADDRESS(a)); new = g_malloc(sizeof(*new)); new->name = g_strdup(name); @@ -206,7 +206,7 @@ camel_internet_address_get (const CamelInternetAddress *a, int index, const char { struct _address *addr; - g_return_val_if_fail(IS_CAMEL_INTERNET_ADDRESS(a), -1); + g_assert(IS_CAMEL_INTERNET_ADDRESS(a)); g_return_val_if_fail(index >= 0, -1); if (index >= ((CamelAddress *)a)->addresses->len) @@ -237,7 +237,7 @@ camel_internet_address_find_name(CamelInternetAddress *a, const char *name, cons struct _address *addr; int i, len; - g_return_val_if_fail(IS_CAMEL_INTERNET_ADDRESS(a), -1); + g_assert(IS_CAMEL_INTERNET_ADDRESS(a)); len = ((CamelAddress *)a)->addresses->len; for (i=0;i<len;i++) { @@ -267,7 +267,7 @@ camel_internet_address_find_address(CamelInternetAddress *a, const char *address struct _address *addr; int i, len; - g_return_val_if_fail(IS_CAMEL_INTERNET_ADDRESS(a), -1); + g_assert(IS_CAMEL_INTERNET_ADDRESS(a)); len = ((CamelAddress *)a)->addresses->len; for (i=0;i<len;i++) { |