Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 Pekka Riikonen
+ Copyright (C) 2001 - 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
*/
-/****h* silccore/SilcArgumentAPI
+/****h* silccore/SILC Argument Interface
*
* DESCRIPTION
*
#ifndef SILCPAYLOAD_H
#define SILCPAYLOAD_H
+/****s* silccore/SilcArgumentAPI/SilcArgumentPayload
+ *
+ * NAME
+ *
+ * typedef struct SilcArgumentPayloadStruct *SilcArgumentPayload;
+ *
+ * DESCRIPTION
+ *
+ * This context is the actual Argument Payload and is allocated
+ * by silc_argument_payload_parse and given as argument usually to
+ * all silc_argument_payload_* functions. It is freed by the
+ * silc_argument_payload_free function.
+ *
+ ***/
+typedef struct SilcArgumentPayloadStruct *SilcArgumentPayload;
+
/****f* silccore/SilcArgumentAPI/silc_argument_payload_parse
*
* SYNOPSIS
SilcUInt32 *argv_lens,
SilcUInt32 *argv_types);
+/****f* silccore/SilcArgumentAPI/silc_argument_payload_encode_one
+ *
+ * SYNOPSIS
+ *
+ * SilcBuffer silc_argument_payload_encode_one(SilcBuffer args,
+ * unsigned char *arg,
+ * SilcUInt32 arg_len,
+ * SilcUInt32 arg_type);
+ *
+ * DESCRIPTION
+ *
+ * Same as silc_argument_payload_encode but encodes one argument to
+ * the buffer `args' and returns the buffer. The returned buffer
+ * may be different than the `args'. If `args' is NULL for the first
+ * argument this allocates the buffer and returns it.
+ *
+ ***/
+SilcBuffer silc_argument_payload_encode_one(SilcBuffer args,
+ unsigned char *arg,
+ SilcUInt32 arg_len,
+ SilcUInt32 arg_type);
+
/****f* silccore/SilcArgumentAPI/silc_argument_payload_encode_payload
*
* SYNOPSIS
* SYNOPSIS
*
* unsigned char *silc_argument_get_first_arg(SilcArgumentPayload payload,
+ * SilcUInt32 *type,
* SilcUInt32 *ret_len);
*
* DESCRIPTION
*
***/
unsigned char *silc_argument_get_first_arg(SilcArgumentPayload payload,
+ SilcUInt32 *type,
SilcUInt32 *ret_len);
/****f* silccore/SilcArgumentAPI/silc_argument_get_next_arg
*
***/
unsigned char *silc_argument_get_next_arg(SilcArgumentPayload payload,
+ SilcUInt32 *type,
SilcUInt32 *ret_len);
/****f* silccore/SilcArgumentAPI/silc_argument_get_arg_type