projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added SILC Server library.
[silc.git]
/
lib
/
silcclient
/
client_attrs.c
diff --git
a/lib/silcclient/client_attrs.c
b/lib/silcclient/client_attrs.c
index 65a8b03e9e86c26a61796f892aac2507032d8f1f..f29d91f495a3b8f7cfb082085c88ec24450098e0 100644
(file)
--- a/
lib/silcclient/client_attrs.c
+++ b/
lib/silcclient/client_attrs.c
@@
-1,10
+1,10
@@
/*
/*
- client_attrs.c
+ client_attrs.c
Author: Pekka Riikonen <priikone@silcnet.org>
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2002 Pekka Riikonen
+ Copyright (C) 2002
- 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
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
@@
-18,7
+18,7
@@
*/
/* $Id$ */
*/
/* $Id$ */
-#include "silc
includes
.h"
+#include "silc.h"
#include "silcclient.h"
#include "client_internal.h"
#include "silcclient.h"
#include "client_internal.h"
@@
-31,7
+31,7
@@
typedef struct {
static void silc_client_attributes_process_foreach(void *key, void *context,
void *user_context)
{
static void silc_client_attributes_process_foreach(void *key, void *context,
void *user_context)
{
- SilcAttribute attribute = (SilcAttribute)
(SilcUInt32)key
;
+ SilcAttribute attribute = (SilcAttribute)
SILC_PTR_TO_32(key)
;
SilcAttributePayload attr = context;
SilcAttrForeach *f = user_context;
const unsigned char *data;
SilcAttributePayload attr = context;
SilcAttrForeach *f = user_context;
const unsigned char *data;
@@
-54,6
+54,7
@@
static void silc_client_attributes_process_foreach(void *key, void *context,
SILC_LOG_DEBUG(("Attribute %d found", attribute));
data = silc_attribute_get_data(attr, &data_len);
SILC_LOG_DEBUG(("Attribute %d found", attribute));
data = silc_attribute_get_data(attr, &data_len);
+#if 0
/* We replace the TIMEZONE with valid value here */
if (attribute == SILC_ATTRIBUTE_TIMEZONE) {
data = (const unsigned char *)silc_get_time(0);
/* We replace the TIMEZONE with valid value here */
if (attribute == SILC_ATTRIBUTE_TIMEZONE) {
data = (const unsigned char *)silc_get_time(0);
@@
-63,6
+64,7
@@
static void silc_client_attributes_process_foreach(void *key, void *context,
(void *)data, data_len);
return;
}
(void *)data, data_len);
return;
}
+#endif
f->buffer = silc_attribute_payload_encode_data(f->buffer, attribute,
SILC_ATTRIBUTE_FLAG_VALID,
f->buffer = silc_attribute_payload_encode_data(f->buffer, attribute,
SILC_ATTRIBUTE_FLAG_VALID,
@@
-113,7
+115,7
@@
SilcBuffer silc_client_attributes_process(SilcClient client,
continue;
silc_hash_table_find_foreach(conn->internal->attrs,
continue;
silc_hash_table_find_foreach(conn->internal->attrs,
-
(void *)(SilcUInt32)attribute
,
+
SILC_32_TO_PTR(attribute)
,
silc_client_attributes_process_foreach,
&f);
}
silc_client_attributes_process_foreach,
&f);
}
@@
-163,7
+165,7
@@
SilcAttributePayload silc_client_attribute_add(SilcClient client,
NULL, silc_client_attribute_destruct,
NULL, TRUE);
silc_hash_table_add(conn->internal->attrs,
NULL, silc_client_attribute_destruct,
NULL, TRUE);
silc_hash_table_add(conn->internal->attrs,
-
(void *)(SilcUInt32)attribute
, attr);
+
SILC_32_TO_PTR(attribute)
, attr);
return attr;
}
return attr;
}
@@
-177,17
+179,17
@@
static void silc_client_attribute_del_foreach(void *key, void *context,
return;
attribute = silc_attribute_get_attribute(attr);
silc_hash_table_del_by_context(conn->internal->attrs,
return;
attribute = silc_attribute_get_attribute(attr);
silc_hash_table_del_by_context(conn->internal->attrs,
-
(void *)(SilcUInt32)attribute
, attr);
+
SILC_32_TO_PTR(attribute)
, attr);
}
/* Delete one attribute */
}
/* Delete one attribute */
-
b
ool silc_client_attribute_del(SilcClient client,
+
SilcB
ool silc_client_attribute_del(SilcClient client,
SilcClientConnection conn,
SilcAttribute attribute,
SilcAttributePayload attr)
{
SilcClientConnection conn,
SilcAttribute attribute,
SilcAttributePayload attr)
{
-
b
ool ret;
+
SilcB
ool ret;
if (!conn->internal->attrs)
return FALSE;
if (!conn->internal->attrs)
return FALSE;
@@
-195,10
+197,10
@@
bool silc_client_attribute_del(SilcClient client,
if (attr) {
attribute = silc_attribute_get_attribute(attr);
ret = silc_hash_table_del_by_context(conn->internal->attrs,
if (attr) {
attribute = silc_attribute_get_attribute(attr);
ret = silc_hash_table_del_by_context(conn->internal->attrs,
-
(void *)(SilcUInt32)attribute
, attr);
+
SILC_32_TO_PTR(attribute)
, attr);
} else if (attribute) {
silc_hash_table_find_foreach(conn->internal->attrs,
} else if (attribute) {
silc_hash_table_find_foreach(conn->internal->attrs,
-
(void *)(SilcUInt32)attribute
,
+
SILC_32_TO_PTR(attribute)
,
silc_client_attribute_del_foreach, conn);
ret = TRUE;
} else{
silc_client_attribute_del_foreach, conn);
ret = TRUE;
} else{
@@
-216,10
+218,10
@@
bool silc_client_attribute_del(SilcClient client,
/* Return all attributes */
/* Return all attributes */
-
const
SilcHashTable silc_client_attributes_get(SilcClient client,
-
SilcClientConnection conn)
+SilcHashTable silc_client_attributes_get(SilcClient client,
+ SilcClientConnection conn)
{
{
- return
(const SilcHashTable)
conn->internal->attrs;
+ return conn->internal->attrs;
}
/* Construct a Requested Attributes buffer. If the `attribute' is zero (0)
}
/* Construct a Requested Attributes buffer. If the `attribute' is zero (0)