-Wed Jul 4 16:31:05 EEST 2007 Pekka Riikonen <priikone@silcnet.org>
+Wed Jul 4 20:20:05 EEST 2007 Pekka Riikonen <priikone@silcnet.org>
+
+ * Unified the SILC_STR_FUNC callback. Affected files are
+ lib/silcutil/silcbuffmt.[ch].
+
+ * Added SilcStack support to SILC File Util API. Affected files
+ are lib/silcutil/silcfileutil.[ch].
+
+ * Added SilcStack support to SILC FD Stream API. Affected files
+ are lib/silcutil/silcfdstream.[ch].
* Added SilcStack support to SILC Scheduler API. The scheduler
now creates stack always. It can be retrieved by
/* Put USER_INFO */
silc_client_attribute_del(silc_client, conn,
SILC_ATTRIBUTE_USER_INFO, NULL);
- tmp = silc_file_readfile(sv, &tmp_len);
+ tmp = silc_file_readfile(sv, &tmp_len, NULL);
if (tmp) {
tmp[tmp_len] = 0;
if (silc_vcard_decode(tmp, tmp_len, &vcard))
/* Put STATUS_MESSAGE */
silc_client_attribute_del(silc_client, conn,
SILC_ATTRIBUTE_STATUS_MESSAGE, NULL);
- tmp = silc_file_readfile(sv, &tmp_len);
+ tmp = silc_file_readfile(sv, &tmp_len, NULL);
if (tmp) {
mime = silc_mime_decode(NULL, tmp, tmp_len);
if (mime)
list = g_strsplit(sv, " ", -1);
for (entry = list; *entry != NULL; entry++) {
if (!strncasecmp(*entry, "silc-rsa:", 8)) {
- tmp = silc_file_readfile((*entry) + 8, &tmp_len);
+ tmp = silc_file_readfile((*entry) + 8, &tmp_len, NULL);
if (tmp) {
tmp[tmp_len] = 0;
pk.type = "silc-rsa";
SILC_LOG_DEBUG(("Filename: '%s'", filename));
if (!usephp) {
- filedata = silc_file_readfile(filename, &data_len);
+ filedata = silc_file_readfile(filename, &data_len, NULL);
if (!filedata) {
silc_http_server_send_error(httpd, conn, "404 Not Found",
"<body><h1>404 Not Found</h1><p>The page you are looking for cannot be located</body>");
* This routine use SilcStack are memory source. If `stack' is NULL
* reverts back to normal allocating routine.
*
+ * Note that this call consumes the `stack'. The caller should push the
+ * stack before calling the function and pop it later.
+ *
***/
static inline
* This routine use SilcStack are memory source. If `stack' is NULL
* reverts back to normal allocating routine.
*
+ * Note that this call consumes the `stack'. The caller should push the
+ * stack before calling the function and pop it later.
+ *
***/
static inline
* This routine use SilcStack are memory source. If `stack' is NULL
* reverts back to normal allocating routine.
*
+ * Note that this call consumes the `stack'. The caller should push the
+ * stack before calling the function and pop it later.
+ *
***/
static inline
* This routine use SilcStack are memory source. If `stack' is NULL
* reverts back to normal allocating routine.
*
+ * Note that this call consumes the `stack'. The caller should push the
+ * stack before calling the function and pop it later.
+ *
***/
static inline
* This routine use SilcStack are memory source. If `stack' is NULL
* reverts back to normal allocating routine.
*
+ * Note that this call consumes the `stack'. The caller should push the
+ * stack before calling the function and pop it later.
+ *
***/
static inline
* This routine use SilcStack are memory source. If `stack' is NULL
* reverts back to normal allocating routine.
*
+ * Note that this call consumes the `stack'. The caller should push the
+ * stack before calling the function and pop it later.
+ *
***/
static inline
* This routine use SilcStack are memory source. If `stack' is NULL
* reverts back to normal allocating routine.
*
+ * Note that this call consumes the `stack'. The caller should push the
+ * stack before calling the function and pop it later.
+ *
***/
static inline
SilcUInt32 filelen;
SilcConfigFile *ret;
- if (!(buffer = silc_file_readfile(configfile, &filelen)))
+ if (!(buffer = silc_file_readfile(configfile, &filelen, NULL)))
return NULL;
ret = silc_calloc(1, sizeof(*ret));
/* Reads a file to a buffer. The allocated buffer is returned. Length of
the file read is returned to the return_len argument. */
-char *silc_file_readfile(const char *filename, SilcUInt32 *return_len)
+char *silc_file_readfile(const char *filename, SilcUInt32 *return_len,
+ SilcStack stack)
{
int fd;
char *buffer;
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2005 Pekka Riikonen
+ Copyright (C) 1997 - 2007 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
*
* SYNOPSIS
*
- * char *silc_file_readfile(const char *filename, SilcUInt32 *return_len);
+ * char *silc_file_readfile(const char *filename, SilcUInt32 *return_len,
+ * SilcStack stack);
*
* DESCRIPTION
*
* If the `return_len' pointer is not NULL, it's filled with the length of
* the file.
*
+ * If `stack' is non-NULL the returned buffer is allocated from `stack'.
+ * The allocation consumes `stack' so caller should push the stack before
+ * calling this function and pop it later.
+ *
***/
-char *silc_file_readfile(const char *filename, SilcUInt32 *return_len);
+char *silc_file_readfile(const char *filename, SilcUInt32 *return_len,
+ SilcStack stack);
/****f* silcutil/SilcFileUtilAPI/silc_file_writefile
*