}
}
-/* This function checks whether the `client' nickname and/or 'client'
- public key is being watched by someone, and notifies the watcher of the
+/* This function checks whether the `client' nickname and/or 'client'
+ public key is being watched by someone, and notifies the watcher of the
notify change of notify type indicated by `notify'. */
bool silc_server_check_watcher_list(SilcServer server,
if (client->data.public_key)
silc_hash_table_find_foreach(server->watcher_list_pk,
client->data.public_key,
- silc_server_check_watcher_list_foreach,
+ silc_server_check_watcher_list_foreach,
&n);
return TRUE;
if (len) {
if (tmp[len - 1] == ',')
tmp[len - 1] = '\0';
- silc_buffer_strformat(tmp2, tmp, SILC_STR_END);
- silc_buffer_strformat(tmp2, ",", SILC_STR_END);
+ silc_buffer_strformat(tmp2, tmp, SILC_STRFMT_END);
+ silc_buffer_strformat(tmp2, ",", SILC_STRFMT_END);
}
} else {
/* Announced list. Check each entry in the list */
/* Save the part that we didn't already have. */
if (strlen(rtmp) > 1) {
- silc_buffer_strformat(tmp2, rtmp, SILC_STR_END);
- silc_buffer_strformat(tmp2, ",", SILC_STR_END);
+ silc_buffer_strformat(tmp2, rtmp, SILC_STRFMT_END);
+ silc_buffer_strformat(tmp2, ",", SILC_STRFMT_END);
}
silc_free(rtmp);
}
/*
- silcbuffmt.h
+ silcbuffmt.h
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2003 Pekka Riikonen
+ Copyright (C) 1997 - 2004 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*
* Formats a buffer from variable argument list of strings. Each
* string must be NULL-terminated and the variable argument list must
- * be end with SILC_STR_END argument. This allows that a string in
+ * be end with SILC_STRFMT_END argument. This allows that a string in
* the list can be NULL, in which case it is skipped. This automatically
* allocates the space for the buffer data but `dst' must be already
* allocated by the caller.
*
* EXAMPLE
*
- * ret = silc_buffer_strformat(buffer, "foo", "bar", SILC_STR_END);
+ * ret = silc_buffer_strformat(buffer, "foo", "bar", SILC_STRFMT_END);
* if (ret < 0)
* error;
*
* automatically.
*
* Example:
- *
+ *
* Formatting: ..., SILC_STR_UI_INT(strlen(string)),
* SILC_STR_UI32_STRING(string), ...
* Unformatting: ..., SILC_STR_UI32_STRING(&string), ...
***/
#define SILC_STR_END SILC_BUFFER_PARAM_END
+/****d* silcutil/SilcBufferFormatAPI/SILC_STRFMT_END
+ *
+ * NAME
+ *
+ * #define SILC_STRFMT_END ...
+ *
+ * DESCRIPTION
+ *
+ * Marks end of the argument list in silc_buffer_strformat function.
+ * This must be at the end of the argument list or error will occur.
+ *
+ ***/
+#define SILC_STRFMT_END (void *)SILC_STR_END
+
#endif /* !SILCBUFFMT_H */
/*
- silcvcard.c
+ silcvcard.c
Author: Pekka Riikonen <priikone@silcnet.org>
"FN:", vcard->full_name, "\n",
"N:", vcard->family_name, ";", vcard->first_name, ";",
vcard->middle_names, ";", vcard->prefix, ";", vcard->suffix, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->nickname)
silc_buffer_strformat(&buffer,
"NICKNAME:", vcard->nickname, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->bday)
silc_buffer_strformat(&buffer,
"BDAY:", vcard->bday, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->title)
silc_buffer_strformat(&buffer,
"TITLE:", vcard->title, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->role)
silc_buffer_strformat(&buffer,
"ROLE:", vcard->role, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->org_name)
silc_buffer_strformat(&buffer,
"ORG:", vcard->org_name, ";", vcard->org_unit, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->categories)
silc_buffer_strformat(&buffer,
"CATEGORIES:", vcard->categories, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->catclass)
silc_buffer_strformat(&buffer,
"CLASS:", vcard->catclass, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->url)
silc_buffer_strformat(&buffer,
"URL:", vcard->url, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->label)
silc_buffer_strformat(&buffer,
"LABEL;", vcard->url, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
for (i = 0; i < vcard->num_addrs; i++) {
silc_buffer_strformat(&buffer,
"ADR;TYPE=",
vcard->addrs[i].state, ";",
vcard->addrs[i].code, ";",
vcard->addrs[i].country, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
}
for (i = 0; i < vcard->num_tels; i++) {
silc_buffer_strformat(&buffer,
"TEL;TYPE=",
vcard->tels[i].type, ":",
vcard->tels[i].telnum, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
}
for (i = 0; i < vcard->num_emails; i++) {
silc_buffer_strformat(&buffer,
"EMAIL;TYPE=",
vcard->emails[i].type, ":",
vcard->emails[i].address, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
}
if (vcard->note)
silc_buffer_strformat(&buffer,
"NOTE:", vcard->note, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
if (vcard->rev)
silc_buffer_strformat(&buffer,
"REV:", vcard->rev, "\n",
- SILC_STR_END);
+ SILC_STRFMT_END);
- silc_buffer_strformat(&buffer, VCARD_FOOTER, SILC_STR_END);
+ silc_buffer_strformat(&buffer, VCARD_FOOTER, SILC_STRFMT_END);
if (vcard_len)
*vcard_len = buffer.truelen;
unsigned char *val;
bool has_begin = FALSE, has_end = FALSE;
int len, i, off = 0;
-
+
val = (unsigned char *)data;
while (val) {
len = 0;