docs from all kinds of filenames. Affected files are
util/robodoc/Source/generator.c, scripts/silcdoc/silcdoc
+ * ROBOdoc documented lib/silcutil/silcmemory.h.
+ Added also new function silc_memdup.
+
+ * Removed lib/silcutil/silcbufutil.h and moved those routines
+ to the lib/silcutil/silcbuffer.h.
+
Sun Feb 17 15:52:30 EET 2002 Pekka Riikonen <priikone@silcnet.org>
* Added `user_count' to the SilcChannelEntry which now tells the
if (channel->mode & SILC_CHANNEL_MODE_PASSPHRASE) {
/* Get passphrase */
tmp = silc_argument_get_arg_type(cmd->args, 3, &tmp_len);
- if (tmp) {
- passphrase = silc_calloc(tmp_len, sizeof(*passphrase));
- memcpy(passphrase, tmp, tmp_len);
- }
+ if (tmp)
+ passphrase = silc_memdup(tmp, tmp_len);
if (!passphrase || !channel->passphrase ||
memcmp(passphrase, channel->passphrase, strlen(channel->passphrase))) {
if (channel->founder_method == SILC_AUTH_PASSWORD) {
tmp = silc_auth_get_data(auth, &tmp_len);
- channel->founder_passwd =
- silc_calloc(tmp_len + 1, sizeof(*channel->founder_passwd));
- memcpy(channel->founder_passwd, tmp, tmp_len);
+ channel->founder_passwd = silc_memdup(tmp, tmp_len);
channel->founder_passwd_len = tmp_len;
} else {
/* Verify the payload before setting the mode */
tmp = silc_argument_get_arg_type(cmd->args, 8, &len);
if (tmp) {
silc_free(entry->ban_list);
- entry->ban_list = silc_calloc(len, sizeof(*entry->ban_list));
- memcpy(entry->ban_list, tmp, len);
+ entry->ban_list = silc_memdup(tmp, len);
}
/* Get the invite list */
tmp = silc_argument_get_arg_type(cmd->args, 9, &len);
if (tmp) {
silc_free(entry->invite_list);
- entry->invite_list = silc_calloc(len, sizeof(*entry->invite_list));
- memcpy(entry->invite_list, tmp, len);
+ entry->invite_list = silc_memdup(tmp, len);
}
/* Get the topic */
int tlen = strcspn(username, "@");
char *phostname = NULL;
- hostname = silc_calloc((strlen(username) - tlen) + 1, sizeof(char));
- memcpy(hostname, username + tlen + 1, strlen(username) - tlen - 1);
+ hostname = silc_memdup(username + tlen + 1, strlen(username) - tlen - 1);
if (strcmp(sock->hostname, sock->ip) &&
strcmp(sock->hostname, hostname)) {
/* If private key mode is not set then decrypt the packet
and re-encrypt it */
if (!(channel->mode & SILC_CHANNEL_MODE_PRIVKEY)) {
- unsigned char *tmp = silc_calloc(data_len, sizeof(*data));
- memcpy(tmp, data, data_len);
+ unsigned char *tmp = silc_memdup(data, data_len);
/* Decrypt the channel message (we don't check the MAC) */
if (channel->channel_key &&
}
idata->rekey = silc_calloc(1, sizeof(*idata->rekey));
- idata->rekey->send_enc_key =
- silc_calloc(keymat->enc_key_len / 8,
- sizeof(*idata->rekey->send_enc_key));
- memcpy(idata->rekey->send_enc_key,
- keymat->send_enc_key, keymat->enc_key_len / 8);
+ idata->rekey->send_enc_key = silc_memdup(keymat->send_enc_key,
+ keymat->enc_key_len / 8);
idata->rekey->enc_key_len = keymat->enc_key_len / 8;
if (ske->prop->flags & SILC_SKE_SP_FLAG_PFS)
if (!send) {
memset(idata->rekey->send_enc_key, 0, idata->rekey->enc_key_len);
silc_free(idata->rekey->send_enc_key);
- idata->rekey->send_enc_key =
- silc_calloc(keymat->enc_key_len / 8,
- sizeof(*idata->rekey->send_enc_key));
- memcpy(idata->rekey->send_enc_key, keymat->send_enc_key,
- keymat->enc_key_len / 8);
+ idata->rekey->send_enc_key = silc_memdup(keymat->send_enc_key,
+ keymat->enc_key_len / 8);
idata->rekey->enc_key_len = keymat->enc_key_len / 8;
}
}
/* Save the key */
channel->key_len = len * 8;
- channel->key = silc_calloc(len, sizeof(*channel->key));
- memcpy(channel->key, channel_key, len);
+ channel->key = silc_memdup(channel_key, len);
memset(channel_key, 0, sizeof(channel_key));
/* Generate HMAC key from the channel key data and set it */
/* Save the key */
channel->key_len = tmp_len * 8;
- channel->key = silc_calloc(tmp_len, sizeof(unsigned char));
- memcpy(channel->key, tmp, tmp_len);
+ channel->key = silc_memdup(tmp, tmp_len);
silc_cipher_set_key(channel->channel_key, tmp, channel->key_len);
/* Generate HMAC key from the channel key data and set it */
#include "silclist.h"
#include "silcdlist.h"
#include "silcbuffer.h"
-#include "silcbufutil.h"
#include "silcbuffmt.h"
#include "silcnet.h"
#include "silcfileutil.h"
proto_ctx->auth_meth = auth_meth;
if (auth_data && auth_data_len) {
- proto_ctx->auth_data = silc_calloc(auth_data_len, sizeof(*auth_data));
- memcpy(proto_ctx->auth_data, auth_data, auth_data_len);
+ proto_ctx->auth_data = silc_memdup(auth_data, auth_data_len);
proto_ctx->auth_data_len = auth_data_len;
}
SILC_LOG_DEBUG(("Server disconnected us, sock %d", sock->sock));
- msg = silc_calloc(message->len + 1, sizeof(char));
- memcpy(msg, message->data, message->len);
+ msg = silc_memdup(message->data, message->len);
client->internal->ops->say(client, sock->user_data,
SILC_CLIENT_MESSAGE_AUDIT, msg);
silc_free(msg);
{
char *msg;
- msg = silc_calloc(message->len + 1, sizeof(char));
- memcpy(msg, message->data, message->len);
+ msg = silc_memdup(message->data, message->len);
client->internal->ops->say(client, sock->user_data,
SILC_CLIENT_MESSAGE_AUDIT, msg);
silc_free(msg);
key = silc_channel_key_get_key(payload, &tmp_len);
cipher = silc_channel_key_get_cipher(payload, NULL);
channel->key_len = tmp_len * 8;
- channel->key = silc_calloc(tmp_len, sizeof(*channel->key));
- memcpy(channel->key, key, tmp_len);
+ channel->key = silc_memdup(key, tmp_len);
if (!silc_cipher_alloc(cipher, &channel->channel_key)) {
client->internal->ops->say(
/* Save the key */
entry = silc_calloc(1, sizeof(*entry));
- entry->key = silc_calloc(keymat->enc_key_len / 8, sizeof(*entry->key));
- memcpy(entry->key, keymat->send_enc_key, keymat->enc_key_len / 8);
+ entry->key = silc_memdup(keymat->send_enc_key, keymat->enc_key_len / 8);
entry->key_len = keymat->enc_key_len / 8;
/* Allocate the cipher and set the key*/
}
/* Save the key */
- client_entry->key = silc_calloc(key_len, sizeof(*client_entry->key));
- memcpy(client_entry->key, key, key_len);
+ client_entry->key = silc_memdup(key, key_len);
client_entry->key_len = key_len;
/* Produce the key material as the protocol defines */
}
if (fingerprint && !client_entry->fingerprint) {
- client_entry->fingerprint =
- silc_calloc(fingerprint_len,
- sizeof(*client_entry->fingerprint));
- memcpy(client_entry->fingerprint, fingerprint, fingerprint_len);
+ client_entry->fingerprint = silc_memdup(fingerprint, fingerprint_len);
client_entry->fingerprint_len = fingerprint_len;
}
/* Rekey stuff */
conn->rekey = silc_calloc(1, sizeof(*conn->rekey));
- conn->rekey->send_enc_key =
- silc_calloc(keymat->enc_key_len / 8,
- sizeof(*conn->rekey->send_enc_key));
- memcpy(conn->rekey->send_enc_key,
- keymat->send_enc_key, keymat->enc_key_len / 8);
+ conn->rekey->send_enc_key = silc_memdup(keymat->send_enc_key,
+ keymat->enc_key_len / 8);
conn->rekey->enc_key_len = keymat->enc_key_len / 8;
if (ske->start_payload->flags & SILC_SKE_SP_FLAG_PFS)
if (!send) {
memset(conn->rekey->send_enc_key, 0, conn->rekey->enc_key_len);
silc_free(conn->rekey->send_enc_key);
- conn->rekey->send_enc_key =
- silc_calloc(keymat->enc_key_len / 8,
- sizeof(*conn->rekey->send_enc_key));
- memcpy(conn->rekey->send_enc_key, keymat->send_enc_key,
- keymat->enc_key_len / 8);
+ conn->rekey->send_enc_key = silc_memdup(keymat->send_enc_key,
+ keymat->enc_key_len / 8);
conn->rekey->enc_key_len = keymat->enc_key_len / 8;
}
}
SILC_STR_UI_XNSTRING(pk, pk_len),
SILC_STR_END);
- ret = silc_calloc(buf->len + 1, sizeof(*ret));
- memcpy(ret, buf->data, buf->len);
+ ret = silc_memdup(buf->data, buf->len);
if (ret_len)
*ret_len = buf->len;
if (!x_type || !x || !x_len)
continue;
- argv[k] = silc_calloc(x_len + 1, sizeof(unsigned char));
- memcpy(argv[k], x, x_len);
+ argv[k] = silc_memdup(x, x_len);
argv_lens[k] = x_len;
argv_types[k] = x_type;
k++;
argv_types = silc_calloc(argc, sizeof(uint32));
SILC_PUT16_MSB(status, status_data);
- argv[0] = silc_calloc(sizeof(status_data) + 1, sizeof(unsigned char));
- memcpy(argv[0], status_data, sizeof(status_data));
+ argv[0] = silc_memdup(status_data, sizeof(status_data));
argv_lens[0] = sizeof(status_data);
argv_types[0] = 1;
if (!x_type || !x || !x_len)
continue;
- argv[k] = silc_calloc(x_len + 1, sizeof(unsigned char));
- memcpy(argv[k], x, x_len);
+ argv[k] = silc_memdup(x, x_len);
argv_lens[k] = x_len;
argv_types[k] = x_type;
k++;
unsigned char *silc_id_payload_get_data(SilcIDPayload payload)
{
- unsigned char *ret;
-
if (!payload)
return NULL;
- ret = silc_calloc(payload->len, sizeof(*ret));
- memcpy(ret, payload->id, payload->len);
- return ret;
+ return silc_memdup(payload->id, payload->len);
}
/* Get length of ID */
switch(type) {
case SILC_ID_SERVER:
{
- SilcServerID *server_id = (SilcServerID *)id, *new;
- new = silc_calloc(1, sizeof(*server_id));
- memcpy(new, server_id, sizeof(*server_id));
- return new;
+ SilcServerID *server_id = (SilcServerID *)id;
+ return silc_memdup(server_id, sizeof(*server_id));
}
break;
case SILC_ID_CLIENT:
{
- SilcClientID *client_id = (SilcClientID *)id, *new;
- new = silc_calloc(1, sizeof(*client_id));
- memcpy(new, client_id, sizeof(*client_id));
- return new;
+ SilcClientID *client_id = (SilcClientID *)id;
+ return silc_memdup(client_id, sizeof(*client_id));
}
break;
case SILC_ID_CHANNEL:
{
- SilcChannelID *channel_id = (SilcChannelID *)id, *new;
- new = silc_calloc(1, sizeof(*channel_id));
- memcpy(new, channel_id, sizeof(*channel_id));
- return new;
+ SilcChannelID *channel_id = (SilcChannelID *)id;
+ return silc_memdup(channel_id, sizeof(*channel_id));
}
break;
}
if (!x || !x_len)
continue;
- argv[k] = silc_calloc(x_len + 1, sizeof(unsigned char));
- memcpy(argv[k], x, x_len);
+ argv[k] = silc_memdup(x, x_len);
argv_lens[k] = x_len;
argv_types[k] = i + 1;
k++;
@FILENAME=silcutillib.html
@LINK=silcbuffer.html:SILC Buffer Interface
@LINK=silcbuffmt.html:SILC Buffer Format Interface
-@LINK=silcbufutil.html:SILC Buffer Utility Interface
@LINK=silchashtable.html:SILC Hash Table Interface
@LINK=silclog.html:SILC Logging Interface
@LINK=silcmemory.html:SILC Memory Interface
include_HEADERS = \
silcbuffer.h \
silcbuffmt.h \
- silcbufutil.h \
silcconfig.h \
silchashtable.h \
silclog.h \
/*
- silcbuffer.h
+ silcbuffer.h
- Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
+ Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1998 - 2000 Pekka Riikonen
+ Copyright (C) 1998 - 2002 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
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; version 2 of the License.
+
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
return (unsigned char *)memcpy(sb->tail, data, len);
}
+/* Clears and initialiazes the buffer to the state as if it was just
+ allocated by silc_buffer_alloc. */
+
+static inline
+void silc_buffer_clear(SilcBuffer sb)
+{
+ memset(sb->head, 0, sb->truelen);
+ sb->data = sb->head;
+ sb->tail = sb->head;
+ sb->len = 0;
+}
+
+/* Generates copy of a SilcBuffer. This copies everything inside the
+ currently valid data area, nothing more. Use silc_buffer_clone to
+ copy entire buffer. */
+
+static inline
+SilcBuffer silc_buffer_copy(SilcBuffer sb)
+{
+ SilcBuffer sb_new;
+
+ sb_new = silc_buffer_alloc(sb->len);
+ silc_buffer_pull_tail(sb_new, SILC_BUFFER_END(sb_new));
+ silc_buffer_put(sb_new, sb->data, sb->len);
+
+ return sb_new;
+}
+
+/* Clones SilcBuffer. This generates new SilcBuffer and copies
+ everything from the source buffer. The result is exact clone of
+ the original buffer. */
+
+static inline
+SilcBuffer silc_buffer_clone(SilcBuffer sb)
+{
+ SilcBuffer sb_new;
+
+ sb_new = silc_buffer_alloc(sb->truelen);
+ silc_buffer_pull_tail(sb_new, SILC_BUFFER_END(sb_new));
+ silc_buffer_put(sb_new, sb->head, sb->truelen);
+ sb_new->data = sb_new->head + (sb->data - sb->head);
+ sb_new->tail = sb_new->data + sb->len;
+ sb_new->len = sb->len;
+
+ return sb_new;
+}
+
+/* Reallocates buffer. Old data is saved into the new buffer. Returns
+ new SilcBuffer pointer. The buffer is exact clone of the old one
+ except that there is now more space at the end of buffer. */
+
+static inline
+SilcBuffer silc_buffer_realloc(SilcBuffer sb, uint32 newsize)
+{
+ SilcBuffer sb_new;
+
+ if (!sb)
+ return silc_buffer_alloc(newsize);
+
+ if (newsize <= sb->truelen)
+ return sb;
+
+ sb_new = silc_buffer_alloc(newsize);
+ silc_buffer_pull_tail(sb_new, SILC_BUFFER_END(sb_new));
+ silc_buffer_put(sb_new, sb->head, sb->truelen);
+ sb_new->data = sb_new->head + (sb->data - sb->head);
+ sb_new->tail = sb_new->data + sb->len;
+ sb_new->len = sb->len;
+
+ silc_buffer_free(sb);
+
+ return sb_new;
+}
+
#endif
+++ /dev/null
-/*
-
- silcbufutil.h
-
- Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
-
- Copyright (C) 1997 - 2000 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
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- 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.
-
-*/
-
-#ifndef SILCBUFUTIL_H
-#define SILCBUFUTIL_H
-
-#include "silcbuffer.h"
-
-/* Clears and initialiazes the buffer to the state as if it was just
- allocated by silc_buffer_alloc. */
-
-static inline
-void silc_buffer_clear(SilcBuffer sb)
-{
- memset(sb->head, 0, sb->truelen);
- sb->data = sb->head;
- sb->tail = sb->head;
- sb->len = 0;
-}
-
-/* Generates copy of a SilcBuffer. This copies everything inside the
- currently valid data area, nothing more. Use silc_buffer_clone to
- copy entire buffer. */
-
-static inline
-SilcBuffer silc_buffer_copy(SilcBuffer sb)
-{
- SilcBuffer sb_new;
-
- sb_new = silc_buffer_alloc(sb->len);
- silc_buffer_pull_tail(sb_new, SILC_BUFFER_END(sb_new));
- silc_buffer_put(sb_new, sb->data, sb->len);
-
- return sb_new;
-}
-
-/* Clones SilcBuffer. This generates new SilcBuffer and copies
- everything from the source buffer. The result is exact clone of
- the original buffer. */
-
-static inline
-SilcBuffer silc_buffer_clone(SilcBuffer sb)
-{
- SilcBuffer sb_new;
-
- sb_new = silc_buffer_alloc(sb->truelen);
- silc_buffer_pull_tail(sb_new, SILC_BUFFER_END(sb_new));
- silc_buffer_put(sb_new, sb->head, sb->truelen);
- sb_new->data = sb_new->head + (sb->data - sb->head);
- sb_new->tail = sb_new->data + sb->len;
- sb_new->len = sb->len;
-
- return sb_new;
-}
-
-/* Reallocates buffer. Old data is saved into the new buffer. Returns
- new SilcBuffer pointer. The buffer is exact clone of the old one
- except that there is now more space at the end of buffer. */
-
-static inline
-SilcBuffer silc_buffer_realloc(SilcBuffer sb, uint32 newsize)
-{
- SilcBuffer sb_new;
-
- if (!sb)
- return silc_buffer_alloc(newsize);
-
- if (newsize <= sb->truelen)
- return sb;
-
- sb_new = silc_buffer_alloc(newsize);
- silc_buffer_pull_tail(sb_new, SILC_BUFFER_END(sb_new));
- silc_buffer_put(sb_new, sb->head, sb->truelen);
- sb_new->data = sb_new->head + (sb->data - sb->head);
- sb_new->tail = sb_new->data + sb->len;
- sb_new->len = sb->len;
-
- silc_buffer_free(sb);
-
- return sb_new;
-}
-
-#endif
* (or File object) and SilcConfigEntity (or Entity). The File objects are
* structs directly corresponding to the real files in the filesystem, while
* Entities are a little more abstract.
+ *
* An Entity is composed by delimited area on a File object (it can take the
* whole File object or just part of it), plus a group of known options.
- *
* In order to parse this file, first you need to create a File object with
* the silc_config_open() function, and then you need to create the Entity
* with the silc_config_init() function.
+ *
* Now you can use the newly created Entity to register a group of expected
* known options and sub-blocks, and then you can call the main parsing loop
- * with the silc_config_main() function.
- * When silc_config_main() will return, if some error encoured the object file
- * will point to the file that caused this error (this can be different from
- * the originally opened file if it contained `Include' directives). If no
- * errors encoured then the File objects will still point to the original
- * file.
+ * with the silc_config_main() function. When silc_config_main() will
+ * return, if some error encoured the object file will point to the file
+ * that caused this error (this can be different from the originally
+ * opened file if it contained `Include' directives). If no errors
+ * encoured then the File objects will still point to the original file.
+ *
* While silc_config_main() will take care of destroying Entities before
* returning, you need to take care that the File object you created is freed
* with the silc_config_close() function.
* The config file syntax is pretty straightforward. All lines starting
* with `#' will be skipped, while sub-blocks are delimited by braces (see
* the example below).
+ *
* Options with argument must have the `=' character between the option
* name and the value. Simple words and numbers does not require quoting.
* There is a special built-in directive "Include" which allows you to include
*/
-/****h* silcutil/SilcList
+/****h* silcutil/SilcListAPI
*
* DESCRIPTION
*
/*
- silcmemory.c
+ silcmemory.c
- Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
+ Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1999 - 2000 Pekka Riikonen
+ Copyright (C) 1999 - 2002 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
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; version 2 of the License.
+
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
{
free(ptr);
}
+
+void *silc_memdup(const void *ptr, size_t size)
+{
+ unsigned char *addr = silc_malloc(size + 1);
+ assert(addr != NULL);
+ memcpy((void *)addr, ptr, size);
+ addr[size] = '\0';
+ return (void *)addr;
+}
/*
- silcmemory.h
+ silcmemory.h
- Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
+ Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1999 - 2000 Pekka Riikonen
+ Copyright (C) 1999 - 2002 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
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
+ the Free Software Foundation; version 2 of the License.
+
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
*/
+/****h* silcutil/SilcMemoryAPI
+ *
+ * DESCRIPTION
+ *
+ * Basic utility functions for allocating memory. All SILC routines, and
+ * applications use these functions when they need to allocate, manipulate
+ * and free memory.
+ *
+ * Currently all allocation routines assert() that the memory was allocated
+ * successfully. Hence, if memory allocation fails it is fatal error.
+ *
+ ***/
+
#ifndef SILCMEMORY_H
#define SILCMEMORY_H
/* Prototypes */
+
+/****f* silcutil/SilcMemoryAPI/silc_malloc
+ *
+ * SYNOPSIS
+ *
+ * void *silc_malloc(size_t size);
+ *
+ * DESCRIPTION
+ *
+ * Allocates memory of `size' bytes and returns pointer to the allocated
+ * memory area. Free the memory by calling silc_free.
+ *
+ ***/
void *silc_malloc(size_t size);
+
+/****f* silcutil/SilcMemoryAPI/silc_calloc
+ *
+ * SYNOPSIS
+ *
+ * void *silc_calloc(size_t items, size_t size);
+ *
+ * DESCRIPTION
+ *
+ * Allocates memory of for an array of `items' elements of `size' bytes
+ * and returns pointer to the allocated memory area. The memory are is
+ * also zeroed. Free the memory by calling silc_free.
+ *
+ ***/
void *silc_calloc(size_t items, size_t size);
+
+/****f* silcutil/SilcMemoryAPI/silc_realloc
+ *
+ * SYNOPSIS
+ *
+ * void *silc_realloc(void *ptr, size_t size);
+ *
+ * DESCRIPTION
+ *
+ * Change the size of the memory block indicated by `ptr' to the new
+ * size of `size' bytes. The contents of `ptr' will not be changed.
+ * If `ptr' is NULL the call is equivalent to silc_malloc. If the
+ * `size' is zero (0) the call is equivalent to silc_free. Free the
+ * memory by calling silc_free.
+ *
+ * NOTES
+ *
+ * The pointer returned to the reallocated memory area might not be
+ * same as `ptr'.
+ *
+ ***/
void *silc_realloc(void *ptr, size_t size);
+
+/****f* silcutil/SilcMemoryAPI/silc_free
+ *
+ * SYNOPSIS
+ *
+ * void silc_free(void *ptr);
+ *
+ * DESCRIPTION
+ *
+ * Frees the memory area indicated by the `ptr'. If `ptr' is NULL no
+ * operation is performed.
+ *
+ ***/
void silc_free(void *ptr);
-#endif
+/****f* silcutil/SilcMemoryAPI/silc_memdup
+ *
+ * SYNOPSIS
+ *
+ * void *silc_memdup(const void *ptr, size_t size);
+ *
+ * DESCRIPTION
+ *
+ * Duplicates the memory area indicated by `ptr' which is of size
+ * of `size' bytes. Returns pointer to the duplicated memory area.
+ * This NULL terminates the dupped memory area by allocating `size' + 1
+ * bytes, so this function can be used to duplicate strings that does
+ * not have NULL termination.
+ *
+ ***/
+void *silc_memdup(const void *ptr, size_t size);
+
+#endif /* SILCMEMORY_H */
silc_log_flushdelay @ 848 DATA ;
silc_hash_table_list_reset @ 849 ;
silc_debug_hexdump @ 850 DATA ;
+ silc_memdup @ 851 ;