*
* SYNOPSIS
*
- * typedef void (*SilcVerifyPublicKey)(bool success, void *context);
+ * typedef void (*SilcVerifyPublicKey)(SilcBool success, void *context);
*
* DESCRIPTION
*
* either success or failure.
*
***/
-typedef void (*SilcVerifyPublicKey)(bool success, void *context);
+typedef void (*SilcVerifyPublicKey)(SilcBool success, void *context);
/****f* silcclient/SilcClientAPI/SilcGetAuthMeth
*
* SYNOPSIS
*
- * typedef void (*SilcGetAuthMeth)(bool success,
+ * typedef void (*SilcGetAuthMeth)(SilcBool success,
* SilcProtocolAuthMeth auth_meth,
* const unsigned char *auth_data,
* SilcUInt32 auth_data_len, void *context);
* context sent to the get_auth_method client operation.
*
***/
-typedef void (*SilcGetAuthMeth)(bool success,
+typedef void (*SilcGetAuthMeth)(SilcBool success,
SilcProtocolAuthMeth auth_meth,
const unsigned char *auth_data,
SilcUInt32 auth_data_len, void *context);
after application has called the command. Just to tell application
that the command really was processed. */
void (*command)(SilcClient client, SilcClientConnection conn,
- SilcClientCommandContext cmd_context, bool success,
+ SilcClientCommandContext cmd_context, SilcBool success,
SilcCommand command, SilcStatus status);
/* Command reply handler. This function is called always in the command reply
ID. For example, if Client ID is receives application receives
SilcClientEntry. */
void (*command_reply)(SilcClient client, SilcClientConnection conn,
- SilcCommandPayload cmd_payload, bool success,
+ SilcCommandPayload cmd_payload, SilcBool success,
SilcCommand command, SilcStatus status, ...);
/* Called to indicate that connection was either successfully established
desired (application may start it later by calling the function
silc_client_perform_key_agreement). If TRUE is returned also the
`completion' and `context' arguments must be set by the application. */
- bool (*key_agreement)(SilcClient client, SilcClientConnection conn,
+ SilcBool (*key_agreement)(SilcClient client, SilcClientConnection conn,
SilcClientEntry client_entry, const char *hostname,
SilcUInt16 port, SilcKeyAgreementCallback *completion,
void **context);
is employed only if the library will receive a nickname that is
already saved in the cache. It is recommended to leave this to FALSE
value. */
- bool nickname_force_format;
+ SilcBool nickname_force_format;
/* A callback function provided by the application for the library to
parse the nickname from the formatted nickname string. Even though
If your application does not support Requested Attributes or you do
not want to use them set this to TRUE. See SilcAttribute and
silc_client_attribute_add for more information on attributes. */
- bool ignore_requested_attributes;
+ SilcBool ignore_requested_attributes;
/* If this is set to TRUE, the silcclient library will not register and
deregister the cipher, pkcs, hash and hmac algorithms. The application
itself will need to handle that. */
- bool dont_register_crypto_library;
+ SilcBool dont_register_crypto_library;
} SilcClientParams;
/***/
*
* SYNOPSIS
*
- * bool silc_client_init(SilcClient client);
+ * SilcBool silc_client_init(SilcClient client);
*
* DESCRIPTION
*
* client. Returns FALSE if error occurred, TRUE otherwise.
*
***/
-bool silc_client_init(SilcClient client);
+SilcBool silc_client_init(SilcClient client);
/****f* silcclient/SilcClientAPI/silc_client_run
*
*
* SYNOPSIS
*
- * bool silc_client_send_channel_message(SilcClient client,
+ * SilcBool silc_client_send_channel_message(SilcClient client,
* SilcClientConnection conn,
* SilcChannelEntry channel,
* SilcChannelPrivateKey key,
* SilcMessageFlags flags,
* unsigned char *data,
* SilcUInt32 data_len,
- * bool_force_send);
+ * SilcBool force_send);
*
* DESCRIPTION
*
* blocked).
*
***/
-bool silc_client_send_channel_message(SilcClient client,
+SilcBool silc_client_send_channel_message(SilcClient client,
SilcClientConnection conn,
SilcChannelEntry channel,
SilcChannelPrivateKey key,
SilcMessageFlags flags,
unsigned char *data,
SilcUInt32 data_len,
- bool force_send);
+ SilcBool force_send);
/****f* silcclient/SilcClientAPI/silc_client_send_private_message
*
* SYNOPSIS
*
- * bool silc_client_send_private_message(SilcClient client,
+ * SilcBool silc_client_send_private_message(SilcClient client,
* SilcClientConnection conn,
* SilcClientEntry client_entry,
* SilcMessageFlags flags,
* unsigned char *data,
* SilcUInt32 data_len,
- * bool force_send);
+ * SilcBool force_send);
*
* DESCRIPTION
*
* Returns TRUE if the message was sent, and FALSE if error occurred.
*
***/
-bool silc_client_send_private_message(SilcClient client,
+SilcBool silc_client_send_private_message(SilcClient client,
SilcClientConnection conn,
SilcClientEntry client_entry,
SilcMessageFlags flags,
unsigned char *data,
SilcUInt32 data_len,
- bool force_send);
+ SilcBool force_send);
/* Client and Channel entry retrieval (idlist.c) */
*
* SYNOPSIS
*
- * bool silc_client_del_client(SilcClient client, SilcClientConnection conn,
+ * SilcBool silc_client_del_client(SilcClient client, SilcClientConnection conn,
* SilcClientEntry client_entry)
*
* DESCRIPTION
* the `client_entry'. Returns TRUE if the deletion were successful.
*
***/
-bool silc_client_del_client(SilcClient client, SilcClientConnection conn,
+SilcBool silc_client_del_client(SilcClient client, SilcClientConnection conn,
SilcClientEntry client_entry);
/****f* silcclient/SilcClientAPI/SilcGetChannelCallback
*
* SYNOPSIS
*
- * bool silc_client_del_channel(SilcClient client,
+ * SilcBool silc_client_del_channel(SilcClient client,
* SilcClientConnection conn,
* SilcChannelEntry channel)
*
* the `channel'. Returns TRUE if the deletion were successful.
*
***/
-bool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
+SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn,
SilcChannelEntry channel);
/****f* silcclient/SilcClientAPI/silc_client_get_server
*
* SYNOPSIS
*
- * bool silc_client_del_server(SilcClient client, SilcClientConnection conn,
+ * SilcBool silc_client_del_server(SilcClient client, SilcClientConnection conn,
* SilcServerEntry server);
*
* DESCRIPTION
* the `server'. Returns TRUE if the deletion were successful.
*
***/
-bool silc_client_del_server(SilcClient client, SilcClientConnection conn,
+SilcBool silc_client_del_server(SilcClient client, SilcClientConnection conn,
SilcServerEntry server);
/****f* silcclient/SilcClientAPI/silc_client_on_channel
*
* SYNOPSIS
*
- * bool silc_client_command_call(SilcClient client,
+ * SilcBool silc_client_command_call(SilcClient client,
* SilcClientConnection conn,
* const char *command_line, ...);
*
* function instead.
*
***/
-bool silc_client_command_call(SilcClient client,
+SilcBool silc_client_command_call(SilcClient client,
SilcClientConnection conn,
const char *command_line, ...);
*
* SYNOPSIS
*
- * bool silc_client_add_private_message_key(SilcClient client,
+ * SilcBool silc_client_add_private_message_key(SilcClient client,
* SilcClientConnection conn,
* SilcClientEntry client_entry,
* const char *cipher,
* const char *hmac,
* unsigned char *key,
* SilcUInt32 key_len,
- * bool generate_key,
- * bool responder);
+ * SilcBool generate_key,
+ * SilcBool responder);
*
* DESCRIPTION
*
* otherwise.
*
***/
-bool silc_client_add_private_message_key(SilcClient client,
+SilcBool silc_client_add_private_message_key(SilcClient client,
SilcClientConnection conn,
SilcClientEntry client_entry,
const char *cipher,
const char *hmac,
unsigned char *key,
SilcUInt32 key_len,
- bool generate_key,
- bool responder);
+ SilcBool generate_key,
+ SilcBool responder);
/****f* silcclient/SilcClientAPI/silc_client_add_private_message_key_ske
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_client_add_private_message_key_ske(SilcClient client,
* SilcClientConnection conn,
* SilcClientEntry client_entry,
* negotiated also in the SKE protocol.
*
***/
-bool silc_client_add_private_message_key_ske(SilcClient client,
+SilcBool silc_client_add_private_message_key_ske(SilcClient client,
SilcClientConnection conn,
SilcClientEntry client_entry,
const char *cipher,
const char *hmac,
SilcSKEKeyMaterial *key,
- bool responder);
+ SilcBool responder);
/****f* silcclient/SilcClientAPI/silc_client_del_private_message_key
*
* SYNOPSIS
*
- * bool silc_client_del_private_message_key(SilcClient client,
+ * SilcBool silc_client_del_private_message_key(SilcClient client,
* SilcClientConnection conn,
* SilcClientEntry client_entry);
*
* client. Returns FALSE on error, TRUE otherwise.
*
***/
-bool silc_client_del_private_message_key(SilcClient client,
+SilcBool silc_client_del_private_message_key(SilcClient client,
SilcClientConnection conn,
SilcClientEntry client_entry);
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_client_send_private_message_key_request(SilcClient client,
* SilcClientConnection conn,
* SilcClientEntry client_entry);
*
* SYNOPSIS
*
- * bool silc_client_add_channel_private_key(SilcClient client,
+ * SilcBool silc_client_add_channel_private_key(SilcClient client,
* SilcClientConnection conn,
* SilcChannelEntry channel,
* const char *name,
* as channel private key. However, this API allows it.
*
***/
-bool silc_client_add_channel_private_key(SilcClient client,
+SilcBool silc_client_add_channel_private_key(SilcClient client,
SilcClientConnection conn,
SilcChannelEntry channel,
const char *name,
*
* SYNOPSIS
*
- * bool silc_client_del_channel_private_keys(SilcClient client,
+ * SilcBool silc_client_del_channel_private_keys(SilcClient client,
* SilcClientConnection conn,
* SilcChannelEntry channel);
*
* on error, TRUE otherwise.
*
***/
-bool silc_client_del_channel_private_keys(SilcClient client,
+SilcBool silc_client_del_channel_private_keys(SilcClient client,
SilcClientConnection conn,
SilcChannelEntry channel);
*
* SYNOPSIS
*
- * bool silc_client_del_channel_private_key(SilcClient client,
+ * SilcBool silc_client_del_channel_private_key(SilcClient client,
* SilcClientConnection conn,
* SilcChannelEntry channel,
* SilcChannelPrivateKey key);
* on error, TRUE otherwise.
*
***/
-bool silc_client_del_channel_private_key(SilcClient client,
+SilcBool silc_client_del_channel_private_key(SilcClient client,
SilcClientConnection conn,
SilcChannelEntry channel,
SilcChannelPrivateKey key);
* void *monitor_context,
* const char *local_ip,
* SilcUInt32 local_port,
- * bool do_not_bind,
+ * SilcBool do_not_bind,
* SilcClientEntry client_entry,
* const char *filepath);
* SilcUInt32 *session_id);
void *monitor_context,
const char *local_ip,
SilcUInt32 local_port,
- bool do_not_bind,
+ SilcBool do_not_bind,
SilcClientEntry client_entry,
const char *filepath,
SilcUInt32 *session_id);
*
* SYNOPSIS
*
- * bool silc_client_attribute_del(SilcClient client,
+ * SilcBool silc_client_attribute_del(SilcClient client,
* SilcClientConnection conn,
* SilcAttribute attribute,
* SilcAttributePayload attr);
* This function Returns TRUE if the attribute was found and deleted.
*
***/
-bool silc_client_attribute_del(SilcClient client,
+SilcBool silc_client_attribute_del(SilcClient client,
SilcClientConnection conn,
SilcAttribute attribute,
SilcAttributePayload attr);
*
* SYNOPSIS
*
- * bool silc_client_send_packet(SilcClient client,
+ * SilcBool silc_client_send_packet(SilcClient client,
* SilcClientConnection conn,
* SilcPacketType type,
* const unsigned char *data,
* be sent.
*
***/
-bool silc_client_send_packet(SilcClient client,
+SilcBool silc_client_send_packet(SilcClient client,
SilcClientConnection conn,
SilcPacketType type,
const unsigned char *data,
(void)mp_init(mp);
}
-bool silc_mp_sinit(SilcStack stack, SilcMPInt *mp)
+SilcBool silc_mp_sinit(SilcStack stack, SilcMPInt *mp)
{
/* XXX TODO */
mp_init(mp);
*
* SYNOPSIS
*
- * int silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits, bool verbose,
+ * int silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits, SilcBool verbose,
* SilcRng);
*
* DESCRIPTION
* number number.
*
***/
-bool silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits, bool verbose,
- SilcRng rng);
+SilcBool silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits,
+ SilcBool verbose, SilcRng rng);
/****f* silcmath/SilcMathAPI/silc_math_prime_test
*
* number is probably a prime.
*
***/
-bool silc_math_prime_test(SilcMPInt *p);
+SilcBool silc_math_prime_test(SilcMPInt *p);
#endif
*
* SYNOPSIS
*
- * bool silc_mp_sinit(SilcStack stack, SilcMPInt *mp);
+ * SilcBool silc_mp_sinit(SilcStack stack, SilcMPInt *mp);
*
* DESCRIPTION
*
* to for example enlarge `mp' will allocate the memory from `stack'.
*
***/
-bool silc_mp_sinit(SilcStack stack, SilcMPInt *mp);
+SilcBool silc_mp_sinit(SilcStack stack, SilcMPInt *mp);
/****f* silcmath/SilcMPAPI/silc_mp_uninit
*
If argument verbose is TRUE this will display some status information
about the progress of generation. */
-bool silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits, bool verbose,
- SilcRng rng)
+SilcBool silc_math_gen_prime(SilcMPInt *prime, SilcUInt32 bits,
+ SilcBool verbose, SilcRng rng)
{
unsigned char *numbuf = NULL;
SilcUInt32 i, b, k;
SilcUInt32 *spmods;
SilcMPInt r, base, tmp, tmp2, oprime;
- bool valid = FALSE;
+ SilcBool valid = FALSE;
silc_mp_init(&r);
silc_mp_init(&base);
/* Performs primality testings for given number. Returns TRUE if the
number is probably a prime. */
-bool silc_math_prime_test(SilcMPInt *p)
+SilcBool silc_math_prime_test(SilcMPInt *p)
{
SilcMPInt r, base, tmp;
int i, ret = 0;
/* Parses remote host's version string. */
-bool silc_ske_parse_version(SilcSKE ske,
+SilcBool silc_ske_parse_version(SilcSKE ske,
SilcUInt32 *protocol_version,
char **protocol_version_string,
SilcUInt32 *software_version,
SilcSchedule schedule;
SilcFSMStruct fsm;
SilcAsyncOperationStruct op;
- bool aborted;
+ SilcBool aborted;
};
/***/
*
* SYNOPSIS
*
- * bool silc_ske_parse_version(SilcSKE ske,
+ * SilcBool silc_ske_parse_version(SilcSKE ske,
* SilcUInt32 *protocol_version,
* char **protocol_version_string,
* SilcUInt32 *software_version,
* string was successfully parsed.
*
***/
-bool silc_ske_parse_version(SilcSKE ske,
+SilcBool silc_ske_parse_version(SilcSKE ske,
SilcUInt32 *protocol_version,
char **protocol_version_string,
SilcUInt32 *software_version,
sem_id sema;
};
-bool silc_mutex_alloc(SilcMutex *mutex)
+SilcBool silc_mutex_alloc(SilcMutex *mutex)
{
int ret;
/* Returns human readable socket error message */
-bool silc_socket_get_error(SilcSocketConnection sock, char *error,
+SilcBool silc_socket_get_error(SilcSocketConnection sock, char *error,
SilcUInt32 error_len)
{
char *err;
thread_id thread;
SilcThreadStart start_func;
void *context;
- bool waitable;
+ SilcBool waitable;
} *SilcBeosThread;
/* Actual routine that is called by BeOS when the thread is created.
#endif
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
- bool waitable)
+ SilcBool waitable)
{
#ifdef SILC_THREADS
int ret;
#endif
}
-bool silc_thread_wait(SilcThread thread, void **exit_value)
+SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
{
#ifdef SILC_THREADS
status_t ret, retval;
HMTX mutex;
};
-bool silc_mutex_alloc(SilcMutex *mutex)
+SilcBool silc_mutex_alloc(SilcMutex *mutex)
{
char name[64];
#endif
} SilcSockaddr;
-static bool silc_net_set_sockaddr(SilcSockaddr *addr, const char *ip_addr,
+static SilcBool silc_net_set_sockaddr(SilcSockaddr *addr, const char *ip_addr,
int port)
{
int len;
/* Converts the IP number string from numbers-and-dots notation to
binary form. */
-bool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
+SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
{
int ret = 0;
/* Returns human readable socket error message */
-bool silc_socket_get_error(SilcSocketConnection sock, char *error,
+SilcBool silc_socket_get_error(SilcSocketConnection sock, char *error,
SilcUInt32 error_len)
{
/* XXX TODO */
unsigned long thread;
SilcThreadStart start_func;
void *context;
- bool waitable;
+ SilcBool waitable;
} *SilcOs2Thread;
/* Actual routine that is called by OS/2 when the thread is created.
#endif
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
- bool waitable)
+ SilcBool waitable)
{
#ifdef SILC_THREADS
int ret;
#endif
}
-bool silc_thread_wait(SilcThread thread, void **exit_value)
+SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
{
#ifdef SILC_THREADS
/* Generate key pair */
-bool silc_create_key_pair(const char *pkcs_name,
+SilcBool silc_create_key_pair(const char *pkcs_name,
SilcUInt32 key_len_bits,
const char *pub_filename,
const char *prv_filename,
SilcPKCS *return_pkcs,
SilcPublicKey *return_public_key,
SilcPrivateKey *return_private_key,
- bool interactive)
+ SilcBool interactive)
{
SilcPKCS pkcs;
SilcPublicKey pub_key;
pass = strdup("");
break;
} else {
- bool match;
+ SilcBool match;
printf("\n");
pass2 = silc_get_input("Retype private key passphrase: ", TRUE);
if (!pass2)
/* Load key pair */
-bool silc_load_key_pair(const char *pub_filename,
+SilcBool silc_load_key_pair(const char *pub_filename,
const char *prv_filename,
const char *passphrase,
SilcPKCS *return_pkcs,
/* Dump public key into stdout */
-bool silc_show_public_key(const char *pub_filename)
+SilcBool silc_show_public_key(const char *pub_filename)
{
SilcPublicKey public_key;
SilcPublicKeyIdentifier ident;
/* Change private key passphrase */
-bool silc_change_private_key_passphrase(const char *prv_filename,
+SilcBool silc_change_private_key_passphrase(const char *prv_filename,
const char *old_passphrase,
const char *new_passphrase)
{
SilcPrivateKey private_key;
- bool base64 = FALSE;
+ SilcBool base64 = FALSE;
char *pass;
pass = old_passphrase ? strdup(old_passphrase) : NULL;
*
* SYNOPSIS
*
- * bool silc_create_key_pair(const char *pkcs_name,
+ * SilcBool silc_create_key_pair(const char *pkcs_name,
* SilcUInt32 key_len_bits,
* const char *pub_filename,
* const char *prv_filename,
* SilcPKCS *return_pkcs,
* SilcPublicKey *return_public_key,
* SilcPrivateKey *return_private_key,
- * bool interactive);
+ * SilcBool interactive);
*
* DESCRIPTION
*
* silc_pkcs_register_default function.
*
***/
-bool silc_create_key_pair(const char *pkcs_name,
+SilcBool silc_create_key_pair(const char *pkcs_name,
SilcUInt32 key_len_bits,
const char *pub_filename,
const char *prv_filename,
SilcPKCS *return_pkcs,
SilcPublicKey *return_public_key,
SilcPrivateKey *return_private_key,
- bool interactive);
+ SilcBool interactive);
/****f* silcutil/SilcAppUtil/silc_load_key_pair
*
* SYNOPSIS
*
- * bool silc_load_key_pair(const char *pub_filename,
+ * SilcBool silc_load_key_pair(const char *pub_filename,
* const char *prv_filename,
* const char *passphrase,
* SilcPKCS *return_pkcs,
* which will be used to decrypt the private key file.
*
***/
-bool silc_load_key_pair(const char *pub_filename,
+SilcBool silc_load_key_pair(const char *pub_filename,
const char *prv_filename,
const char *passphrase,
SilcPKCS *return_pkcs,
*
* SYNOPSIS
*
- * bool silc_show_public_key(const char *pub_filename);
+ * SilcBool silc_show_public_key(const char *pub_filename);
*
* DESCRIPTION
*
* into human readable form into stdout. Returns FALSE on error.
*
***/
-bool silc_show_public_key(const char *pub_filename);
+SilcBool silc_show_public_key(const char *pub_filename);
/****f* silcutil/SilcAppUtil/silc_change_private_key_passphrase
*
* SYNOPSIS
*
- * bool silc_change_private_key_passphrase(const char *prv_filename,
+ * SilcBool silc_change_private_key_passphrase(const char *prv_filename,
* const char *old_passphrase,
* const char *new_passphrase);
*
* prompt for them.
*
***/
-bool silc_change_private_key_passphrase(const char *prv_filename,
+SilcBool silc_change_private_key_passphrase(const char *prv_filename,
const char *old_passphrase,
const char *new_passphrase);
/* Halts async operation */
-bool silc_async_halt(SilcAsyncOperation op)
+SilcBool silc_async_halt(SilcAsyncOperation op)
{
SILC_LOG_DEBUG(("Halting async operation"));
/* Resumes async operation */
-bool silc_async_resume(SilcAsyncOperation op)
+SilcBool silc_async_resume(SilcAsyncOperation op)
{
SILC_LOG_DEBUG(("Resuming async operation"));
/* Creates new async operation */
-bool silc_async_init(SilcAsyncOperation op,
+SilcBool silc_async_init(SilcAsyncOperation op,
SilcAsyncOperationAbort abort_cb,
SilcAsyncOperationPause pause_cb,
void *context)
*
* SYNOPSIS
*
- * typedef bool (*SilcAsyncOperationPause)(SilcAsyncOperation op,
- * bool pause_operation,
+ * typedef SilcBool (*SilcAsyncOperationPause)(SilcAsyncOperation op,
+ * SilcBool pause_operation,
* void *context);
*
* DESCRIPTION
* was (or is going to be) halted or resumed, and FALSE on error.
*
***/
-typedef bool (*SilcAsyncOperationPause)(SilcAsyncOperation op,
- bool pause_operation,
+typedef SilcBool (*SilcAsyncOperationPause)(SilcAsyncOperation op,
+ SilcBool pause_operation,
void *context);
/* Upper layer functions for managing asynchronous operations. Layer
*
* SYNOPSIS
*
- * bool silc_async_halt(SilcAsyncOperation op);
+ * SilcBool silc_async_halt(SilcAsyncOperation op);
*
* DESCRIPTION
*
* controls the asynchronous operation.
*
***/
-bool silc_async_halt(SilcAsyncOperation op);
+SilcBool silc_async_halt(SilcAsyncOperation op);
/****f* silcutil/SilcAsyncOperationAPI/silc_async_resume
*
* SYNOPSIS
*
- * bool silc_async_resume(SilcAsyncOperation op);
+ * SilcBool silc_async_resume(SilcAsyncOperation op);
*
* DESCRIPTION
*
* asynchronous operation.
*
***/
-bool silc_async_resume(SilcAsyncOperation op);
+SilcBool silc_async_resume(SilcAsyncOperation op);
/****f* silcutil/SilcAsyncOperationAPI/silc_async_abort
*
*
* SYNOPSIS
*
- * bool silc_async_init(SilcAsyncOperation op,
+ * SilcBool silc_async_init(SilcAsyncOperation op,
* SilcAsyncOperationAbort abort_cb,
* SilcAsyncOperationPause pause_cb,
* void *context);
* not provided then these functions has no effect for this operation.
*
***/
-bool silc_async_init(SilcAsyncOperation op,
+SilcBool silc_async_init(SilcAsyncOperation op,
SilcAsyncOperationAbort abort_cb,
SilcAsyncOperationPause pause_cb,
void *context);
char *p; /* the Parser poitner */
SilcUInt32 len; /* fixed length of the whole file */
SilcUInt32 line; /* current parsing line, strictly linked to p */
- bool included; /* wether this file is main or included */
+ SilcBool included; /* wether this file is main or included */
};
/* We need the entity to base our block-style parsing on */
{
void *pt;
int val_int;
- bool val_bool;
+ SilcBool val_boolean;
char *val_tmp;
SilcUInt32 val_size;
case SILC_CONFIG_ARG_TOGGLE:
if (!strcasecmp(val, "yes") || !strcasecmp(val, "true") ||
!strcasecmp(val, "on") || !strcasecmp(val, "1")) {
- val_bool = TRUE;
+ val_boolean = TRUE;
}
else if (!strcasecmp(val, "no") || !strcasecmp(val, "false") ||
!strcasecmp(val, "off") || !strcasecmp(val, "0")) {
- val_bool = FALSE;
+ val_boolean = FALSE;
}
else
return NULL;
- pt = silc_calloc(1, sizeof(val_bool));
- *(bool *)pt = (bool) val_bool;
+ pt = silc_calloc(1, sizeof(val_boolean));
+ *(SilcBool *)pt = (SilcBool) val_boolean;
return pt;
case SILC_CONFIG_ARG_INT:
val_int = (int) strtol(val, &val_tmp, 0);
/* (Private) destroy a SilcConfigEntity */
-static void silc_config_destroy(SilcConfigEntity ent, bool destroy_opts)
+static void silc_config_destroy(SilcConfigEntity ent, SilcBool destroy_opts)
{
SilcConfigOption *oldopt, *nextopt;
SILC_CONFIG_DEBUG(("Freeing config entity [ent=0x%x] [opts=0x%x]",
/* Registers a new option in the specified entity.
* Returns TRUE on success, FALSE if already registered. */
-bool silc_config_register(SilcConfigEntity ent, const char *name,
+SilcBool silc_config_register(SilcConfigEntity ent, const char *name,
SilcConfigType type, SilcConfigCallback cb,
const SilcConfigTable *subtable, void *context)
{
/* Register a new option table in the specified config entity */
-bool silc_config_register_table(SilcConfigEntity ent,
+SilcBool silc_config_register_table(SilcConfigEntity ent,
const SilcConfigTable table[], void *context)
{
int i;
*
* SYNOPSIS
*
- * bool silc_config_register(SilcConfigEntity ent, const char *name,
+ * SilcBool silc_config_register(SilcConfigEntity ent, const char *name,
* SilcConfigType type, SilcConfigCallback cb,
* const SilcConfigTable *subtable,
* void *context);
* silc_config_register_table
*
***/
-bool silc_config_register(SilcConfigEntity ent, const char *name,
+SilcBool silc_config_register(SilcConfigEntity ent, const char *name,
SilcConfigType type, SilcConfigCallback cb,
const SilcConfigTable *subtable, void *context);
*
* SYNOPSIS
*
- * bool silc_config_register_table(SilcConfigEntity ent,
+ * SilcBool silc_config_register_table(SilcConfigEntity ent,
* const SilcConfigTable table[],
* void *context);
*
* SilcConfigTable
*
***/
-bool silc_config_register_table(SilcConfigEntity ent,
+SilcBool silc_config_register_table(SilcConfigEntity ent,
const SilcConfigTable table[], void *context);
/****f* silcutil/SilcConfigAPI/silc_config_main
/* Return fds */
-bool silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd)
+SilcBool silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd)
{
SilcFDStream fd_stream = stream;
/* Close stream */
-bool silc_fd_stream_close(SilcStream stream)
+SilcBool silc_fd_stream_close(SilcStream stream)
{
SilcFDStream fd_stream = stream;
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd);
*
* DESCRIPTION
* function.
*
***/
-bool silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd);
+SilcBool silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd);
/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_get_error
*
/* Initialize FSM */
-bool silc_fsm_init(SilcFSM fsm,
+SilcBool silc_fsm_init(SilcFSM fsm,
void *fsm_context,
SilcFSMDestructor destructor,
void *destructor_context,
void *thread_context,
SilcFSMThreadDestructor destructor,
void *destructor_context,
- bool real_thread)
+ SilcBool real_thread)
{
SilcFSMThread thread;
/* Initialize FSM thread. Internally machine and thread use same context. */
-bool silc_fsm_thread_init(SilcFSMThread thread,
+SilcBool silc_fsm_thread_init(SilcFSMThread thread,
SilcFSM fsm,
void *thread_context,
SilcFSMThreadDestructor destructor,
void *destructor_context,
- bool real_thread)
+ SilcBool real_thread)
{
SILC_LOG_DEBUG(("Initializing new thread %p (%s)",
thread, real_thread ? "real" : "FSM"));
/* Wait for thread to terminate */
-bool silc_fsm_thread_wait(void *fsm, void *thread)
+SilcBool silc_fsm_thread_wait(void *fsm, void *thread)
{
SilcFSM t = thread;
#if defined(SILC_DEBUG)
*
* SYNOPSIS
*
- * bool silc_fsm_init(SilcFSM fsm,
+ * SilcBool silc_fsm_init(SilcFSM fsm,
* void *fsm_context,
* SilcFSMDestructor destructor,
* void *destructor_context,
* silc_fsm_start(&fsm, first_state);
*
***/
-bool silc_fsm_init(SilcFSM fsm,
+SilcBool silc_fsm_init(SilcFSM fsm,
void *fsm_context,
SilcFSMDestructor destructor,
void *destructor_context,
* void *thread_context,
* SilcFSMThreadDestructor destructor,
* void *destructor_context,
- * bool real_thread);
+ * SilcBool real_thread);
*
* DESCRIPTION
*
void *thread_context,
SilcFSMThreadDestructor destructor,
void *destructor_context,
- bool real_thread);
+ SilcBool real_thread);
/****f* silcutil/SilcFSMAPI/silc_fsm_thread_init
*
* SYNOPSIS
*
- * bool silc_fsm_thread_init(SilcFSMThread thread,
+ * SilcBool silc_fsm_thread_init(SilcFSMThread thread,
* SilcFSM fsm,
* void *thread_context,
* SilcFSMThreadDestructor destructor,
* void *destructor_context,
- * bool real_thread);
+ * SilcBool real_thread);
*
* DESCRIPTION
*
* silc_fsm_start(&thread, first_state);
*
***/
-bool silc_fsm_thread_init(SilcFSMThread thread,
+SilcBool silc_fsm_thread_init(SilcFSMThread thread,
SilcFSM fsm,
void *thread_context,
SilcFSMThreadDestructor destructor,
void *destructor_context,
- bool real_thread);
+ SilcBool real_thread);
/****f* silcutil/SilcFSMAPI/silc_fsm_free
*
/* Used internally by the SILC_FSM_CALL macros to detect whether async
call is really async or not. */
static inline
-bool silc_fsm_set_call(struct SilcFSMObject *fsm, bool async_call)
+SilcBool silc_fsm_set_call(struct SilcFSMObject *fsm, SilcBool async_call)
{
- bool old = fsm->async_call;
+ SilcBool old = fsm->async_call;
fsm->async_call = async_call;
return old;
}
void silc_fsm_continue_sync(void *fsm);
/* Wait for thread to terminate */
-bool silc_fsm_thread_wait(void *fsm, void *thread);
+SilcBool silc_fsm_thread_wait(void *fsm, void *thread);
/* Semaphores */
SilcUInt32 silc_fsm_sema_wait(SilcFSMSema sema, void *fsm);
void *foreach_user_context)
{
SilcHashTableEntry e, tmp;
- bool auto_rehash, found = FALSE;
+ SilcBool auto_rehash, found = FALSE;
SilcUInt32 i = SILC_HASH_TABLE_HASH(hash, hash_user_context);
SILC_HT_DEBUG(("index %d key %p", i, key));
/* Internal routine to add new key to the hash table */
-static inline bool
+static inline SilcBool
silc_hash_table_add_internal(SilcHashTable ht, void *key, void *context,
SilcHashFunction hash,
void *hash_user_context)
/* Internal routine to replace old key with new one (if it exists) */
-static inline bool
+static inline SilcBool
silc_hash_table_replace_internal(SilcHashTable ht, void *key, void *context,
SilcHashFunction hash,
void *hash_user_context)
void *compare_user_context,
SilcHashDestructor destructor,
void *destructor_user_context,
- bool auto_rehash)
+ SilcBool auto_rehash)
{
SilcHashTable ht;
SilcUInt32 size_index = SILC_HASH_TABLE_SIZE;
call the destructor funtion for the found entry. Return TRUE if the
entry was removed successfully and FALSE otherwise. */
-bool silc_hash_table_del(SilcHashTable ht, void *key)
+SilcBool silc_hash_table_del(SilcHashTable ht, void *key)
{
SilcHashTableEntry *entry, prev, e;
/* Same as above but with specific hash and compare functions. */
-bool silc_hash_table_del_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_del_ext(SilcHashTable ht, void *key,
SilcHashFunction hash,
void *hash_user_context,
SilcHashCompare compare,
have duplicate keys. In that case the `context' may be used to check
whether the correct entry is being deleted. */
-bool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
void *context)
{
SilcHashTableEntry *entry, prev, e;
/* Same as above but with specific hash and compare functions. */
-bool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
void *context,
SilcHashFunction hash,
void *hash_user_context,
respectively. If the `ret_key and `ret_context' are NULL then this
maybe used only to check whether given key exists in the table. */
-bool silc_hash_table_find(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find(SilcHashTable ht, void *key,
void **ret_key, void **ret_context)
{
return silc_hash_table_find_ext(ht, key, ret_key, ret_context,
/* Same as above but with specified hash and comparison functions. */
-bool silc_hash_table_find_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find_ext(SilcHashTable ht, void *key,
void **ret_key, void **ret_context,
SilcHashFunction hash,
void *hash_user_context,
/* Same as silc_hash_table_find but finds with specific context. */
-bool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
void *context, void **ret_key)
{
return silc_hash_table_find_by_context_ext(ht, key, context, ret_key,
/* Same as above but with specified hash and comparison functions. */
-bool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
void *context, void **ret_key,
SilcHashFunction hash,
void *hash_user_context,
{
SilcHashTableEntry e, tmp;
int i;
- bool auto_rehash;
+ SilcBool auto_rehash;
if (!foreach)
return;
int i;
SilcHashTableEntry *table, e, tmp;
SilcUInt32 table_size, size_index;
- bool auto_rehash;
+ SilcBool auto_rehash;
SILC_HT_DEBUG(("Start"));
int i;
SilcHashTableEntry *table, e, tmp;
SilcUInt32 table_size, size_index;
- bool auto_rehash;
+ SilcBool auto_rehash;
SILC_HT_DEBUG(("Start"));
`context' and TRUE. If this returns FALSE then there are no anymore
any entrys. Usage: while (silc_hash_table_get(&htl, &key, &context)) */
-bool silc_hash_table_get(SilcHashTableList *htl, void **key, void **context)
+SilcBool silc_hash_table_get(SilcHashTableList *htl, void **key, void **context)
{
SilcHashTableEntry entry = (SilcHashTableEntry)htl->entry;
*
* SYNOPSIS
*
- * typedef bool (*SilcHashCompare)(void *key1, void *key2,
+ * typedef SilcBool (*SilcHashCompare)(void *key1, void *key2,
* void *user_context);
*
* DESCRIPTION
* to the callback.
*
***/
-typedef bool (*SilcHashCompare)(void *key1, void *key2, void *user_context);
+typedef SilcBool (*SilcHashCompare)(void *key1, void *key2, void *user_context);
/****f* silcutil/SilcHashTableAPI/SilcHashDestructor
*
* void *compare_user_context,
* SilcHashDestructor destructor,
* void *destructor_user_context,
- * bool auto_rehash);
+ * SilcBool auto_rehash);
*
* DESCRIPTION
*
void *compare_user_context,
SilcHashDestructor destructor,
void *destructor_user_context,
- bool auto_rehash);
+ SilcBool auto_rehash);
/****f* silcutil/SilcHashTableAPI/silc_hash_table_free
*
*
* SYNOPSIS
*
- * bool silc_hash_table_del(SilcHashTable ht, void *key);
+ * SilcBool silc_hash_table_del(SilcHashTable ht, void *key);
*
* DESCRIPTION
*
* entry was removed successfully and FALSE otherwise.
*
***/
-bool silc_hash_table_del(SilcHashTable ht, void *key);
+SilcBool silc_hash_table_del(SilcHashTable ht, void *key);
/****f* silcutil/SilcHashTableAPI/silc_hash_table_del_by_context
*
* SYNOPSIS
*
- * bool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
+ * SilcBool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
* void *context);
*
* DESCRIPTION
* be used to check whether the correct entry is being deleted.
*
***/
-bool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_del_by_context(SilcHashTable ht, void *key,
void *context);
/****f* silcutil/SilcHashTableAPI/silc_hash_table_find
*
* SYNOPSIS
*
- * bool silc_hash_table_find(SilcHashTable ht, void *key,
+ * SilcBool silc_hash_table_find(SilcHashTable ht, void *key,
* void **ret_key, void **ret_context);
*
* DESCRIPTION
* maybe used only to check whether given key exists in the table.
*
***/
-bool silc_hash_table_find(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find(SilcHashTable ht, void *key,
void **ret_key, void **ret_context);
/****f* silcutil/SilcHashTableAPI/silc_hash_table_find_by_context
*
* SYNOPSIS
*
- * bool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
+ * SilcBool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
* void *context, void **ret_key);
*
* DESCRIPTION
* the caller already knows the context.
*
***/
-bool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find_by_context(SilcHashTable ht, void *key,
void *context, void **ret_key);
/****f* silcutil/SilcHashTableAPI/silc_hash_table_find_foreach
*
* SYNOPSIS
*
- * bool silc_hash_table_get(SilcHashTableList *htl, void **key,
+ * SilcBool silc_hash_table_get(SilcHashTableList *htl, void **key,
* void **context);
*
* DESCRIPTION
* any entrys.
*
***/
-bool silc_hash_table_get(SilcHashTableList *htl, void **key, void **context);
+SilcBool silc_hash_table_get(SilcHashTableList *htl, void **key, void **context);
/* Extended hash table interface (same as above but with specific
*
* SYNOPSIS
*
- * bool silc_hash_table_del_ext(SilcHashTable ht, void *key,
+ * SilcBool silc_hash_table_del_ext(SilcHashTable ht, void *key,
* SilcHashFunction hash,
* void *hash_user_context,
* SilcHashCompare compare,
* specific destructor function.
*
***/
-bool silc_hash_table_del_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_del_ext(SilcHashTable ht, void *key,
SilcHashFunction hash,
void *hash_user_context,
SilcHashCompare compare,
*
* SYNOPSIS
*
- * bool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
+ * SilcBool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
* void *context,
* SilcHashFunction hash,
* void *hash_user_context,
* specific destructor function.
*
***/
-bool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_del_by_context_ext(SilcHashTable ht, void *key,
void *context,
SilcHashFunction hash,
void *hash_user_context,
*
* SYNOPSIS
*
- * bool silc_hash_table_find_ext(SilcHashTable ht, void *key,
+ * SilcBool silc_hash_table_find_ext(SilcHashTable ht, void *key,
* void **ret_key, void **ret_context,
* SilcHashFunction hash,
* void *hash_user_context,
* comparing function. If not provided the hash table's default is used.
*
***/
-bool silc_hash_table_find_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find_ext(SilcHashTable ht, void *key,
void **ret_key, void **ret_context,
SilcHashFunction hash,
void *hash_user_context,
*
* SYNOPSIS
*
- * bool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
+ * SilcBool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
* void *context, void **ret_key,
* SilcHashFunction hash,
* void *hash_user_context,
* comparing function. If not provided the hash table's default is used.
*
***/
-bool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
+SilcBool silc_hash_table_find_by_context_ext(SilcHashTable ht, void *key,
void *context, void **ret_key,
SilcHashFunction hash,
void *hash_user_context,
/* Set and initialize the specified log file. */
-bool silc_log_set_file(SilcLogType type, char *filename, SilcUInt32 maxsize,
+SilcBool silc_log_set_file(SilcLogType type, char *filename, SilcUInt32 maxsize,
SilcSchedule scheduler)
{
FILE *fp = NULL;
/* Set timestamp */
-void silc_log_timestamp(bool enable)
+void silc_log_timestamp(SilcBool enable)
{
silclog.timestamp = enable;
}
/* Set quick logging */
-void silc_log_quick(bool enable)
+void silc_log_quick(SilcBool enable)
{
silclog.quick = enable;
}
/* Set debugging */
-void silc_log_debug(bool enable)
+void silc_log_debug(SilcBool enable)
{
silclog.debug = enable;
}
/* Set debug hexdump */
-void silc_log_debug_hexdump(bool enable)
+void silc_log_debug_hexdump(SilcBool enable)
{
silclog.debug_hexdump = enable;
}
*
* SYNOPSIS
*
- * typedef bool (*SilcLogCb)(SilcLogType type, char *message,
+ * typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message,
* void *context);
*
* DESCRIPTION
* silc_log_set_callback
*
***/
-typedef bool (*SilcLogCb)(SilcLogType type, char *message, void *context);
+typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message, void *context);
/****f* silcutil/SilcLogAPI/SilcLogDebugCb
*
* SYNOPSIS
*
- * typedef bool (*SilcLogDebugCb)(char *file, char *function, int line,
+ * typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
* char *message, void *context);
*
* DESCRIPTION
* silc_debug, silc_log_set_debug_callbacks
*
***/
-typedef bool (*SilcLogDebugCb)(char *file, char *function, int line,
+typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
char *message, void *context);
/****f* silcutil/SilcLogAPI/SilcLogHexdumpCb
*
* SYNOPSIS
*
- * typedef bool (*SilcDebugHexdumpCb)(char *file, char *function, int line,
+ * typedef SilcBool (*SilcDebugHexdumpCb)(char *file, char *function, int line,
* unsigned char *data,
* SilcUInt32 data_len,
* char *message, void *context;
* silc_debug_hexdump, silc_log_set_debug_callbacks
*
***/
-typedef bool (*SilcLogHexdumpCb)(char *file, char *function, int line,
+typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line,
unsigned char *data, SilcUInt32 data_len,
char *message, void *context);
*
* SYNOPSIS
*
- * bool silc_log_set_file(SilcLogType type, char *filename,
+ * SilcBool silc_log_set_file(SilcLogType type, char *filename,
* SilcUInt32 maxsize,
* SilcSchedule scheduler);
*
* save HD activity.
*
***/
-bool silc_log_set_file(SilcLogType type, char *filename, SilcUInt32 maxsize,
+SilcBool silc_log_set_file(SilcLogType type, char *filename, SilcUInt32 maxsize,
SilcSchedule scheduler);
/****f* silcutil/SilcLogAPI/silc_log_get_file
*
* NAME
*
- * void silc_log_timestamp(bool enable);
+ * void silc_log_timestamp(SilcBool enable);
*
* DESCRIPTION
*
* timestamp and to FALSE to disable it. Default is TRUE.
*
***/
-void silc_log_timestamp(bool enable);
+void silc_log_timestamp(SilcBool enable);
/****f* silcutil/SilcLogAPI/silc_log_flushdelay
*
*
* NAME
*
- * void silc_log_quick(bool enable);
+ * void silc_log_quick(SilcBool enable);
*
* DESCRIPTION
*
* Default is FALSE.
*
***/
-void silc_log_quick(bool enable);
+void silc_log_quick(SilcBool enable);
/****v* silcutil/SilcLogAPI/silc_log_debug
*
* NAME
*
- * void silc_log_debug(bool enable);
+ * void silc_log_debug(SilcBool enable);
*
* DESCRIPTION
*
* SILC_LOG_DEBUG
*
***/
-void silc_log_debug(bool enable);
+void silc_log_debug(SilcBool enable);
/****v* silcutil/SilcLogAPI/silc_log_debug_hexdump
*
* NAME
*
- * void silc_log_debug_hexdump(bool enable);
+ * void silc_log_debug_hexdump(SilcBool enable);
*
* DESCRIPTION
*
* SILC_LOG_HEXDUMP
*
***/
-void silc_log_debug_hexdump(bool enable);
+void silc_log_debug_hexdump(SilcBool enable);
#endif /* !SILCLOG_H */
return mime->data;
}
-bool silc_mime_is_partial(SilcMime mime)
+SilcBool silc_mime_is_partial(SilcMime mime)
{
const char *type = silc_mime_get_field(mime, "Content-Type");
if (!type)
mime->multiparts = silc_dlist_init();
}
-bool silc_mime_add_multipart(SilcMime mime, SilcMime part)
+SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part)
{
if (!mime || !mime->multiparts || !part)
return FALSE;
return TRUE;
}
-bool silc_mime_is_multipart(SilcMime mime)
+SilcBool silc_mime_is_multipart(SilcMime mime)
{
if (!mime)
return FALSE;
*
* SYNOPSIS
*
- * bool silc_mime_is_partial(SilcMime mime);
+ * SilcBool silc_mime_is_partial(SilcMime mime);
*
* DESCRIPTION
*
* Returns TRUE if the MIME message `mime' is a partial MIME fragment.
*
***/
-bool silc_mime_is_partial(SilcMime mime);
+SilcBool silc_mime_is_partial(SilcMime mime);
/****f* silcutil/SILCMIMEAPI/silc_mime_set_multipart
*
*
* SYNOPSIS
*
- * bool silc_mime_add_multipart(SilcMime mime, SilcMime part);
+ * SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part);
*
* DESCRIPTION
*
* silc_mime_add_multipart(mime, part);
*
***/
-bool silc_mime_add_multipart(SilcMime mime, SilcMime part);
+SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part);
/****f* silcutil/SILCMIMEAPI/silc_mime_is_multipart
*
* SYNOPSIS
*
- * bool silc_mime_is_multipart(SilcMime mime);
+ * SilcBool silc_mime_is_multipart(SilcMime mime);
*
* DESCRIPTION
*
* Its parts can be get by calling silc_mime_get_multiparts.
*
***/
-bool silc_mime_is_multipart(SilcMime mime);
+SilcBool silc_mime_is_multipart(SilcMime mime);
/****f* silcutil/SILCMIMEAPI/silc_mime_get_multiparts
*
*
* SYNOPSIS
*
- * bool silc_mutex_alloc(SilcMutex *mutex);
+ * SilcBool silc_mutex_alloc(SilcMutex *mutex);
*
* DESCRIPTION
*
* on error.
*
***/
-bool silc_mutex_alloc(SilcMutex *mutex);
+SilcBool silc_mutex_alloc(SilcMutex *mutex);
/****f* silcutil/SilcMutexAPI/silc_mutex_free
*
/* Checks whether IP address sent as argument is valid IPv4 address. */
-bool silc_net_is_ip4(const char *addr)
+SilcBool silc_net_is_ip4(const char *addr)
{
int count = 0;
/* Checks whether IP address sent as argument is valid IPv6 address. */
-bool silc_net_is_ip6(const char *addr)
+SilcBool silc_net_is_ip6(const char *addr)
{
/* XXX does this work with all kinds of IPv6 addresses? */
while (*addr) {
/* Checks whether IP address sent as argument is valid IP address. */
-bool silc_net_is_ip(const char *addr)
+SilcBool silc_net_is_ip(const char *addr)
{
if (silc_net_is_ip4(addr))
return TRUE;
typedef struct {
SilcNetResolveCallback completion;
void *context;
- bool prefer_ipv6;
+ SilcBool prefer_ipv6;
SilcSchedule schedule;
char *input;
char *result;
/* Resolves IP address for hostname. */
-bool silc_net_gethostbyname(const char *name, bool prefer_ipv6, char *address,
+SilcBool silc_net_gethostbyname(const char *name, SilcBool prefer_ipv6, char *address,
SilcUInt32 address_len)
{
#ifdef HAVE_IPV6
/* Resolves IP address for hostname async. */
void silc_net_gethostbyname_async(const char *name,
- bool prefer_ipv6,
+ SilcBool prefer_ipv6,
SilcSchedule schedule,
SilcNetResolveCallback completion,
void *context)
/* Resolves hostname by IP address. */
-bool silc_net_gethostbyaddr(const char *addr, char *name, SilcUInt32 name_len)
+SilcBool silc_net_gethostbyaddr(const char *addr, char *name, SilcUInt32 name_len)
{
#ifdef HAVE_IPV6
struct addrinfo req, *ai;
/* Performs lookups for remote name and IP address. This peforms reverse
lookup as well to verify that the IP has FQDN. */
-bool silc_net_check_host_by_sock(int sock, char **hostname, char **ip)
+SilcBool silc_net_check_host_by_sock(int sock, char **hostname, char **ip)
{
char host[1024];
int rval, len;
/* Performs lookups for local name and IP address. This peforms reverse
lookup as well to verify that the IP has FQDN. */
-bool silc_net_check_local_by_sock(int sock, char **hostname, char **ip)
+SilcBool silc_net_check_local_by_sock(int sock, char **hostname, char **ip)
{
char host[1024];
int rval, len;
* SilcNetServer
* silc_net_create_server(const char **local_ip_addr,
* SilcUInt32 local_ip_count,
- * int port, bool require_fqdn,
+ * int port, SilcBool require_fqdn,
* SilcSchedule schedule,
* SilcNetCallback callback, void *context);
*
***/
SilcNetServer
silc_net_create_server(const char **local_ip_addr, SilcUInt32 local_ip_count,
- int port, bool require_fqdn, SilcSchedule schedule,
+ int port, SilcBool require_fqdn, SilcSchedule schedule,
SilcNetCallback callback, void *context);
/****f* silcutil/SilcNetAPI/silc_net_close_server
*
* SYNOPSIS
*
- * bool silc_net_is_ip4(const char *addr);
+ * SilcBool silc_net_is_ip4(const char *addr);
*
* DESCRIPTION
*
* Checks whether IP address sent as argument is valid IPv4 address.
*
***/
-bool silc_net_is_ip4(const char *addr);
+SilcBool silc_net_is_ip4(const char *addr);
/****f* silcutil/SilcNetAPI/silc_net_is_ip6
*
* SYNOPSIS
*
- * bool silc_net_is_ip6(const char *addr);
+ * SilcBool silc_net_is_ip6(const char *addr);
*
* DESCRIPTION
*
* Checks whether IP address sent as argument is valid IPv6 address.
*
***/
-bool silc_net_is_ip6(const char *addr);
+SilcBool silc_net_is_ip6(const char *addr);
/****f* silcutil/SilcNetAPI/silc_net_is_ip
*
* SYNOPSIS
*
- * bool silc_net_is_ip(const char *addr);
+ * SilcBool silc_net_is_ip(const char *addr);
*
* DESCRIPTION
*
* This supports both IPv4 and IPv6 addresses.
*
***/
-bool silc_net_is_ip(const char *addr);
+SilcBool silc_net_is_ip(const char *addr);
/****f* silcutil/SilcNetAPI/silc_net_addr2bin
*
* SYNOPSIS
*
- * bool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len);
+ * SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len);
*
* DESCRIPTION
*
* IPv4 or IPv6 address.
*
***/
-bool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len);
+SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len);
/****f* silcutil/SilcNetAPI/SilcNetResolveCallback
*
*
* SYNOPSIS
*
- * bool silc_net_gethostbyname(const char *name, bool prefer_ipv6,
+ * SilcBool silc_net_gethostbyname(const char *name, SilcBool prefer_ipv6,
* char *address, SilcUInt32 address_len);
*
* DESCRIPTION
* address also.
*
***/
-bool silc_net_gethostbyname(const char *name, bool prefer_ipv6, char *address,
+SilcBool silc_net_gethostbyname(const char *name, SilcBool prefer_ipv6, char *address,
SilcUInt32 address_len);
/****f* silcutil/SilcNetAPI/silc_net_gethostbyname_async
* SYNOPSIS
*
* void silc_net_gethostbyname_async(const char *name,
- * bool prefer_ipv6,
+ * SilcBool prefer_ipv6,
* SilcSchedule schedule,
* SilcNetResolveCallback completion,
* void *context)
*
***/
void silc_net_gethostbyname_async(const char *name,
- bool prefer_ipv6,
+ SilcBool prefer_ipv6,
SilcSchedule schedule,
SilcNetResolveCallback completion,
void *context);
*
* SYNOPSIS
*
- * bool silc_net_gethostbyaddr(const char *addr, char *name,
+ * SilcBool silc_net_gethostbyaddr(const char *addr, char *name,
* SilcUInt32 name_len);
*
* DESCRIPTION
* This is synchronous function and will block the calling process.
*
***/
-bool silc_net_gethostbyaddr(const char *addr, char *name, SilcUInt32 name_len);
+SilcBool silc_net_gethostbyaddr(const char *addr, char *name, SilcUInt32 name_len);
/****f* silcutil/SilcNetAPI/silc_net_gethostbyaddr_async
*
*
* SYNOPSIS
*
- * bool silc_net_check_host_by_sock(int sock, char **hostname, char **ip);
+ * SilcBool silc_net_check_host_by_sock(int sock, char **hostname, char **ip);
*
* DESCRIPTION
*
* lookup as well to verify that the IP has FQDN.
*
***/
-bool silc_net_check_host_by_sock(int sock, char **hostname, char **ip);
+SilcBool silc_net_check_host_by_sock(int sock, char **hostname, char **ip);
/****f* silcutil/SilcNetAPI/silc_net_check_local_by_sock
*
* SYNOPSIS
*
- * bool silc_net_check_local_by_sock(int sock, char **hostname, char **ip);
+ * SilcBool silc_net_check_local_by_sock(int sock, char **hostname, char **ip);
*
* DESCRIPTION
*
* lookup as well to verify that the IP has FQDN.
*
***/
-bool silc_net_check_local_by_sock(int sock, char **hostname, char **ip);
+SilcBool silc_net_check_local_by_sock(int sock, char **hostname, char **ip);
/****f* silcutil/SilcNetAPI/silc_net_get_remote_port
*
*
* SYNOPSIS
*
- * bool silc_net_win32_init(void);
+ * SilcBool silc_net_win32_init(void);
*
* DESCRIPTION
*
* This routines is available only on Win32 platform.
*
***/
-bool silc_net_win32_init(void);
+SilcBool silc_net_win32_init(void);
/****f* silcutil/SilcNetAPI/silc_net_win32_uninit
*
static void silc_schedule_task_remove(SilcSchedule schedule, SilcTask task);
static void silc_schedule_dispatch_fd(SilcSchedule schedule);
static void silc_schedule_dispatch_timeout(SilcSchedule schedule,
- bool dispatch_all);
+ SilcBool dispatch_all);
/* Fd task hash table destructor */
scheduler could not be uninitialized. This happens when the scheduler
is still valid and silc_schedule_stop has not been called. */
-bool silc_schedule_uninit(SilcSchedule schedule)
+SilcBool silc_schedule_uninit(SilcSchedule schedule)
{
SILC_LOG_DEBUG(("Uninitializing scheduler"));
tasks are removed here. */
static void silc_schedule_dispatch_timeout(SilcSchedule schedule,
- bool dispatch_all)
+ SilcBool dispatch_all)
{
SilcTask t;
SilcTaskTimeout task;
SilcTask t;
SilcTaskTimeout task;
struct timeval curtime;
- bool dispatch = TRUE;
+ SilcBool dispatch = TRUE;
/* Get the current time */
silc_gettimeofday(&curtime);
/* Runs the scheduler once and then returns. */
-bool silc_schedule_one(SilcSchedule schedule, int timeout_usecs)
+SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs)
{
struct timeval timeout;
int ret;
descriptor to set different iomasks. */
void silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
- SilcTaskEvent mask, bool send_events)
+ SilcTaskEvent mask, SilcBool send_events)
{
SilcTaskFd task;
*
* SYNOPSIS
*
- * bool silc_schedule_uninit(SilcSchedule schedule);
+ * SilcBool silc_schedule_uninit(SilcSchedule schedule);
*
* DESCRIPTION
*
* is still valid and silc_schedule_stop has not been called.
*
***/
-bool silc_schedule_uninit(SilcSchedule schedule);
+SilcBool silc_schedule_uninit(SilcSchedule schedule);
/****f* silcutil/SilcScheduleAPI/silc_schedule_stop
*
*
* SYNOPSIS
*
- * bool silc_schedule_one(SilcSchedule schedule, int block);
+ * SilcBool silc_schedule_one(SilcSchedule schedule, int block);
*
* DESCRIPTION
*
* some other event occurs.
*
***/
-bool silc_schedule_one(SilcSchedule schedule, int timeout_usecs);
+SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs);
/****f* silcutil/SilcScheduleAPI/silc_schedule_wakeup
*
* SYNOPSIS
*
* void silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
- * SilcTaskEvent mask, bool send_events);
+ * SilcTaskEvent mask, SilcBool send_events);
*
* DESCRIPTION
*
*
***/
void silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
- SilcTaskEvent mask, bool send_events);
+ SilcTaskEvent mask, SilcBool send_events);
/****f* silcutil/SilcScheduleAPI/silc_schedule_unset_listen_fd
*
SilcUInt32 buf_len);
int silc_socket_stream_write(SilcStream stream, const unsigned char *data,
SilcUInt32 data_len);
-bool silc_socket_stream_close(SilcStream stream);
+SilcBool silc_socket_stream_close(SilcStream stream);
void silc_socket_stream_destroy(SilcStream stream);
/* Internal async host lookup context. */
/* Creates socket stream */
SilcAsyncOperation
-silc_socket_stream_create(int sock, bool lookup, bool require_fqdn,
+silc_socket_stream_create(int sock, SilcBool lookup, SilcBool require_fqdn,
SilcSchedule schedule,
SilcSocketStreamCallback callback,
void *context)
/* Returns socket stream information */
-bool silc_socket_stream_get_info(SilcStream stream,
+SilcBool silc_socket_stream_get_info(SilcStream stream,
int *sock, const char **hostname,
const char **ip, SilcUInt16 *port)
{
/* Set socket information */
-bool silc_socket_stream_set_info(SilcStream stream,
+SilcBool silc_socket_stream_set_info(SilcStream stream,
const char *hostname,
const char *ip, SilcUInt16 port)
{
/* Set QoS for socket stream */
-bool silc_socket_stream_set_qos(SilcStream stream,
+SilcBool silc_socket_stream_set_qos(SilcStream stream,
SilcUInt32 read_rate,
SilcUInt32 read_limit_bytes,
SilcUInt32 limit_sec,
/* Closes socket */
-bool silc_socket_stream_close(SilcStream stream)
+SilcBool silc_socket_stream_close(SilcStream stream)
{
SilcSocketStream socket_stream = stream;
* SYNOPSIS
*
* SilcAsyncOperation
- * silc_socket_stream_create(int sock, bool lookup, bool require_fqdn,
+ * silc_socket_stream_create(int sock, SilcBool lookup, SilcBool require_fqdn,
* SilcSchedule schedule,
* SilcSocketStreamCallback callback,
* void *context);
*
***/
SilcAsyncOperation
-silc_socket_stream_create(int sock, bool lookup, bool require_fqdn,
+silc_socket_stream_create(int sock, SilcBool lookup, SilcBool require_fqdn,
SilcSchedule schedule,
SilcSocketStreamCallback callback,
void *context);
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_socket_stream_get_info(SilcStream stream,
* int *sock, const char **hostname,
* const char **ip, SilcUInt16 *port);
* if these informations are not available.
*
***/
-bool silc_socket_stream_get_info(SilcStream stream,
+SilcBool silc_socket_stream_get_info(SilcStream stream,
int *sock, const char **hostname,
const char **ip, SilcUInt16 *port);
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_socket_stream_set_info(SilcStream stream,
* const char *hostname,
* const char *ip, SilcUInt16 port);
* silc_socket_stream_get_info to get the information from the stream.
*
***/
-bool silc_socket_stream_set_info(SilcStream stream,
+SilcBool silc_socket_stream_set_info(SilcStream stream,
const char *hostname,
const char *ip, SilcUInt16 port);
*
* SYNOPSIS
*
- * bool silc_socket_stream_set_qos(SilcStream stream,
+ * SilcBool silc_socket_stream_set_qos(SilcStream stream,
* SilcUInt32 read_rate,
* SilcUInt32 read_limit_bytes,
* SilcUInt32 limit_sec,
* this socket stream that may be pending will be cancelled.
*
***/
-bool silc_socket_stream_set_qos(SilcStream stream,
+SilcBool silc_socket_stream_set_qos(SilcStream stream,
SilcUInt32 read_rate,
SilcUInt32 read_limit_bytes,
SilcUInt32 limit_sec,
memory, otherwise memory is aligned. Returns pointer to the memory
or NULL on error. */
-void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, bool aligned)
+void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, SilcBool aligned)
{
void *ptr;
SilcUInt32 bsize, bsize2;
the old memory remains intact. */
void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
- void *ptr, SilcUInt32 size, bool aligned)
+ void *ptr, SilcUInt32 size, SilcBool aligned)
{
SilcUInt32 si = stack->frame->si;
SilcUInt32 bsize;
/* Allocate memory. If the `aligned' is FALSE this allocates unaligned
memory, otherwise memory is aligned. Returns pointer to the memory
or NULL on error. */
-void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, bool aligned);
+void *silc_stack_malloc(SilcStack stack, SilcUInt32 size, SilcBool aligned);
/* Attempts to reallocate memory by changing the size of the `ptr' into
`size'. This routine works only if the previous allocation to `stack'
if the `size' does not fit into the current block. If NULL is returned
the old memory remains intact. */
void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
- void *ptr, SilcUInt32 size, bool aligned);
+ void *ptr, SilcUInt32 size, SilcBool aligned);
#ifdef SILC_DIST_INPLACE
/* Prints statistics of the usage of SilcStack to stdout. */
return h->ops->write(stream, data, data_len);
}
-bool silc_stream_close(SilcStream stream)
+SilcBool silc_stream_close(SilcStream stream)
{
SilcStreamHeader h = stream;
return h->ops->close(stream);
/* This is called to close the stream. This is called when the
silc_stream_close function was called. */
- bool (*close)(SilcStream stream);
+ SilcBool (*close)(SilcStream stream);
/* This is called to destroy the stream. This is called when the
silc_stream_destroy function was called. */
*
* SYNOPSIS
*
- * bool silc_stream_close(SilcStream stream);
+ * SilcBool silc_stream_close(SilcStream stream);
*
* DESCRIPTION
*
* callback will be called with an error status.
*
***/
-bool silc_stream_close(SilcStream stream);
+SilcBool silc_stream_close(SilcStream stream);
/****f* silcutil/SilcStreamAPI/silc_stream_destroy
*
/* Parses MIME object and MIME header in it. */
-bool
+SilcBool
silc_mime_parse(const unsigned char *mime, SilcUInt32 mime_len,
char *version, SilcUInt32 version_size,
char *content_type, SilcUInt32 content_type_size,
/* Same as above but does not allocate memory, just checks the
validity of the string. */
-bool silc_identifier_verify(const unsigned char *identifier,
+SilcBool silc_identifier_verify(const unsigned char *identifier,
SilcUInt32 identifier_len,
SilcStringEncoding identifier_encoding,
SilcUInt32 max_allowed_length)
/* Same as above but does not allocate memory, just checks the
validity of the string. */
-bool silc_channel_name_verify(const unsigned char *identifier,
+SilcBool silc_channel_name_verify(const unsigned char *identifier,
SilcUInt32 identifier_len,
SilcStringEncoding identifier_encoding,
SilcUInt32 max_allowed_length)
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_mime_parse(const unsigned char *mime, SilcUInt32 mime_len,
* char *version, SilcUInt32 version_size,
* char *content_type, SilcUInt32 content_type_size,
* NULL terminating the buffers it provides.
*
***/
-bool
+SilcBool
silc_mime_parse(const unsigned char *mime, SilcUInt32 mime_len,
char *version, SilcUInt32 version_size,
char *content_type, SilcUInt32 content_type_size,
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_identifier_check(const unsigned char *identifier,
* SilcUInt32 identifier_len,
* SilcStringEncoding identifier_encoding,
* Returns TRUE if the string is valid and FALSE if it is prohibited.
*
***/
-bool silc_identifier_verify(const unsigned char *identifier,
+SilcBool silc_identifier_verify(const unsigned char *identifier,
SilcUInt32 identifier_len,
SilcStringEncoding identifier_encoding,
SilcUInt32 max_allowed_length);
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_channel_name_check(const unsigned char *identifier,
* SilcUInt32 identifier_len,
* SilcStringEncoding identifier_encoding,
* Returns TRUE if the string is valid and FALSE if it is prohibited.
*
***/
-bool silc_channel_name_verify(const unsigned char *identifier,
+SilcBool silc_channel_name_verify(const unsigned char *identifier,
SilcUInt32 identifier_len,
SilcStringEncoding identifier_encoding,
SilcUInt32 max_allowed_length);
* SYNOPSIS
*
* SilcThread silc_thread_create(SilcThreadStart start_func,
- * void *context, bool waitable);
+ * void *context, SilcBool waitable);
* DESCRIPTION
*
* Creates a new thread. The `start_func' with `context' will be
*
***/
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
- bool waitable);
+ SilcBool waitable);
/****f* silcutil/SilcThreadAPI/silc_thread_exit
*
*
* SYNOPSIS
*
- * bool silc_thread_wait(SilcThread thread, void **exit_value);
+ * SilcBool silc_thread_wait(SilcThread thread, void **exit_value);
*
* DESCRIPTION
*
* FALSE value.
*
***/
-bool silc_thread_wait(SilcThread thread, void **exit_value);
+SilcBool silc_thread_wait(SilcThread thread, void **exit_value);
#endif
/* Returns time as SilcTime structure */
-bool silc_time_value(SilcInt64 timeval, SilcTime ret_time)
+SilcBool silc_time_value(SilcInt64 timeval, SilcTime ret_time)
{
struct tm *time;
/* Fills the SilcTime structure with correct values */
-static bool silc_time_fill(SilcTime time,
+static SilcBool silc_time_fill(SilcTime time,
unsigned int year,
unsigned int month,
unsigned int day,
/* Returns time from universal time string into SilcTime */
-bool silc_time_universal(const char *universal_time, SilcTime ret_time)
+SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time)
{
int ret;
unsigned int year, month, day, hour = 0, minute = 0, second = 0;
/* Encode universal time string. */
-bool silc_time_universal_string(SilcTime timeval, char *ret_string,
+SilcBool silc_time_universal_string(SilcTime timeval, char *ret_string,
SilcUInt32 ret_string_size)
{
int ret, len = 0;
/* Returns time from generalized time string into SilcTime */
-bool silc_time_generalized(const char *generalized_time, SilcTime ret_time)
+SilcBool silc_time_generalized(const char *generalized_time, SilcTime ret_time)
{
int ret, i;
unsigned int year, month, day, hour = 0, minute = 0, second = 0;
/* Encode generalized time string */
-bool silc_time_generalized_string(SilcTime timeval, char *ret_string,
+SilcBool silc_time_generalized_string(SilcTime timeval, char *ret_string,
SilcUInt32 ret_string_size)
{
int len = 0, ret;
*
* SYNOPSIS
*
- * bool silc_time_value(SilcInt64 timeval, SilcTime ret_time);
+ * SilcBool silc_time_value(SilcInt64 timeval, SilcTime ret_time);
*
* DESCRIPTION
*
* Returns FALSE on error, TRUE otherwise.
*
***/
-bool silc_time_value(SilcInt64 timeval, SilcTime ret_time);
+SilcBool silc_time_value(SilcInt64 timeval, SilcTime ret_time);
/****f* silcutil/SilcTimeAPI/silc_time_universal
*
* SYNOPSIS
*
- * bool silc_time_universal(const char *universal_time,
+ * SilcBool silc_time_universal(const char *universal_time,
* SilcTime ret_time);
*
* DESCRIPTION
* silc_time_universal("030219190403Z", &ret_time);
*
***/
-bool silc_time_universal(const char *universal_time, SilcTime ret_time);
+SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time);
/****f* silcutil/SilcTimeAPI/silc_time_universal_string
*
* SYNOPSIS
*
- * bool silc_time_universal_string(SilcTime timeval, char *ret_string,
+ * SilcBool silc_time_universal_string(SilcTime timeval, char *ret_string,
* SilcUInt32 ret_string_size);
*
* DESCRIPTION
* `ret_string' buffer. Returns FALSE if the buffer is too small.
*
***/
-bool silc_time_universal_string(SilcTime timeval, char *ret_string,
+SilcBool silc_time_universal_string(SilcTime timeval, char *ret_string,
SilcUInt32 ret_string_size);
/****f* silcutil/SilcTimeAPI/silc_time_generalized
*
* SYNOPSIS
*
- * bool silc_time_generalized(const char *generalized_time,
+ * SilcBool silc_time_generalized(const char *generalized_time,
* SilcTime ret_time);
*
* DESCRIPTION
* silc_time_generalized("20030219190510.212Z", &ret_time);
*
***/
-bool silc_time_generalized(const char *generalized_time, SilcTime ret_time);
+SilcBool silc_time_generalized(const char *generalized_time, SilcTime ret_time);
/****f* silcutil/SilcTimeAPI/silc_time_generalized_string
*
* SYNOPSIS
*
- * bool silc_time_generalized_string(SilcTime timeval, char *ret_string,
+ * SilcBool silc_time_generalized_string(SilcTime timeval, char *ret_string,
* SilcUInt32 ret_string_size);
*
* DESCRIPTION
* `ret_string' buffer. Returns FALSE if the buffer is too small.
*
***/
-bool silc_time_generalized_string(SilcTime timeval, char *ret_string,
+SilcBool silc_time_generalized_string(SilcTime timeval, char *ret_string,
SilcUInt32 ret_string_size);
#endif /* SILCTIME_H */
*
* NAME
*
- * #define bool ...
+ * #define SilcBool ...
*
* DESCRIPTION
*
* Boolean value, and is always 8-bits. Represents value 0 or 1.
*
***/
-typedef unigned char SilcBool;
+typedef unsigned char SilcBool;
#define silc_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/* Returns TRUE if the `utf8' string of length of `utf8_len' is valid
UTF-8 encoded string, FALSE if it is not UTF-8 encoded string. */
-bool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len)
+SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len)
{
return silc_utf8_decode(utf8, utf8_len, 0, NULL, 0) != 0;
}
/* Pretty close strcasecmp */
-bool silc_utf8_strcasecmp(const char *s1, const char *s2)
+SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2)
{
if (s1 == s2)
return TRUE;
/* Pretty close strcasecmp */
-bool silc_utf8_strncasecmp(const char *s1, const char *s2, SilcUInt32 n)
+SilcBool silc_utf8_strncasecmp(const char *s1, const char *s2, SilcUInt32 n)
{
unsigned char *s1u, *s2u;
SilcUInt32 s1u_len, s2u_len;
SilcStringprepStatus status;
- bool ret;
+ SilcBool ret;
if (s1 == s2)
return TRUE;
*
* SYNOPSIS
*
- * bool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len);
+ * SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len);
*
* DESCRIPTION
*
* UTF-8 encoded string, FALSE if it is not UTF-8 encoded string.
*
***/
-bool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len);
+SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len);
/****f* silcutil/SilcStrUtilAPI/silc_utf8_strcasecmp
*
* SYNOPSIS
*
- * bool silc_utf8_strcasecmp(const char *s1, const char *s2);
+ * SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2);
*
* DESCRIPTION
*
* Unicode characters will be ignored when comparing.
*
***/
-bool silc_utf8_strcasecmp(const char *s1, const char *s2);
+SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2);
/****f* silcutil/SilcStrUtilAPI/silc_utf8_strncasecmp
*
* SYNOPSIS
*
- * bool silc_utf8_strcasecmp(const char *s1, const char *s2,
+ * SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2,
* SilcUInt32 n);
*
* DESCRIPTION
* Unicode characters will be ignored when comparing.
*
***/
-bool silc_utf8_strncasecmp(const char *s1, const char *s2, SilcUInt32 n);
+SilcBool silc_utf8_strncasecmp(const char *s1, const char *s2, SilcUInt32 n);
#endif /* SILCUTF8_H */
/* Converts string to capital characters. */
-bool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size)
+SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size)
{
int i;
/* Converts string to lower letter characters. */
-bool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size)
+SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size)
{
int i;
/* Parse userfqdn string which is in user@fqdn format. */
-bool silc_parse_userfqdn(const char *string, char **left, char **right)
+SilcBool silc_parse_userfqdn(const char *string, char **left, char **right)
{
SilcUInt32 tlen;
/* Compares two strings. It may be used as SilcHashTable comparison
function. */
-bool silc_hash_string_compare(void *key1, void *key2, void *user_context)
+SilcBool silc_hash_string_compare(void *key1, void *key2, void *user_context)
{
return !strcasecmp((char *)key1, (char *)key2);
}
The Client ID's compares only the hash of the Client ID not any other
part of the Client ID. Other ID's are fully compared. */
-bool silc_hash_id_compare(void *key1, void *key2, void *user_context)
+SilcBool silc_hash_id_compare(void *key1, void *key2, void *user_context)
{
SilcIdType id_type = (SilcIdType)SILC_PTR_TO_32(user_context);
return (id_type == SILC_ID_CLIENT ?
/* Compare two Client ID's entirely and not just the hash from the ID. */
-bool silc_hash_client_id_compare(void *key1, void *key2, void *user_context)
+SilcBool silc_hash_client_id_compare(void *key1, void *key2, void *user_context)
{
return SILC_ID_COMPARE_TYPE(key1, key2, SILC_ID_CLIENT);
}
/* Compares binary data. May be used as SilcHashTable comparison function. */
-bool silc_hash_data_compare(void *key1, void *key2, void *user_context)
+SilcBool silc_hash_data_compare(void *key1, void *key2, void *user_context)
{
SilcUInt32 len = SILC_PTR_TO_32(user_context);
return !memcmp(key1, key2, len);
/* Compares UTF-8 string. */
-bool silc_hash_utf8_compare(void *key1, void *key2, void *user_context)
+SilcBool silc_hash_utf8_compare(void *key1, void *key2, void *user_context)
{
int l1 = strlen((char *)key1);
int l2 = strlen((char *)key2);
/* Compares two SILC Public keys. It may be used as SilcHashTable
comparison function. */
-bool silc_hash_public_key_compare(void *key1, void *key2, void *user_context)
+SilcBool silc_hash_public_key_compare(void *key1, void *key2, void *user_context)
{
return silc_pkcs_public_key_compare(key1, key2);
}
/* Return TRUE if the `data' is ASCII string. */
-bool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len)
+SilcBool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len)
{
int i;
/* Parses SILC protocol style version string. */
-bool silc_parse_version_string(const char *version,
+SilcBool silc_parse_version_string(const char *version,
SilcUInt32 *protocol_version,
char **protocol_version_string,
SilcUInt32 *software_version,
/* Displays input prompt on command line and takes input data from user */
-char *silc_get_input(const char *prompt, bool echo_off)
+char *silc_get_input(const char *prompt, SilcBool echo_off)
{
#ifdef SILC_UNIX
int fd;
/* Return mode list */
-bool silc_get_mode_list(SilcBuffer mode_list, SilcUInt32 mode_list_count,
+SilcBool silc_get_mode_list(SilcBuffer mode_list, SilcUInt32 mode_list_count,
SilcUInt32 **list)
{
int i;
/* Return TRUE if `smaller' is smaller than `bigger'. */
-bool silc_compare_timeval(struct timeval *smaller,
+SilcBool silc_compare_timeval(struct timeval *smaller,
struct timeval *bigger)
{
if ((smaller->tv_sec < bigger->tv_sec) ||
*
* SYNOPSIS
*
- * bool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size);
+ * SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size);
*
* DESCRIPTION
*
* Converts string to capital characters.
*
***/
-bool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size);
+SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size);
/****f* silcutil/SilcUtilAPI/silc_to_lower
*
* SYNOPSIS
*
- * bool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size);
+ * SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size);
*
* DESCRIPTION
*
* Converts string to capital characters.
*
***/
-bool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size);
+SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size);
/****f* silcutil/SilcUtilAPI/silc_parse_userfqdn
*
* SYNOPSIS
*
- * bool silc_parse_userfqdn(const char *string, char **left, char **right);
+ * SilcBool silc_parse_userfqdn(const char *string, char **left, char **right);
*
* DESCRIPTION
*
* Parse userfqdn string which is in user@fqdn format.
*
***/
-bool silc_parse_userfqdn(const char *string, char **left, char **right);
+SilcBool silc_parse_userfqdn(const char *string, char **left, char **right);
/****f* silcutil/SilcUtilAPI/silc_parse_command_line
*
*
* SYNOPSIS
*
- * bool silc_hash_string_compare(void *key1, void *key2,
+ * SilcBool silc_hash_string_compare(void *key1, void *key2,
* void *user_context);
*
* DESCRIPTION
* function.
*
***/
-bool silc_hash_string_compare(void *key1, void *key2, void *user_context);
+SilcBool silc_hash_string_compare(void *key1, void *key2, void *user_context);
/****f* silcutil/SilcUtilAPI/silc_hash_id_compare
*
* SYNOPSIS
*
- * bool silc_hash_id_compare(void *key1, void *key2, void *user_context);
+ * SilcBool silc_hash_id_compare(void *key1, void *key2, void *user_context);
*
* DESCRIPTION
*
* part of the Client ID. Other ID's are fully compared.
*
***/
-bool silc_hash_id_compare(void *key1, void *key2, void *user_context);
+SilcBool silc_hash_id_compare(void *key1, void *key2, void *user_context);
/****f* silcutil/SilcUtilAPI/silc_hash_client_id_compare
*
* SYNOPSIS
*
- * bool silc_hash_client_id_compare(void *key1, void *key2, void *user_context);
+ * SilcBool silc_hash_client_id_compare(void *key1, void *key2, void *user_context);
*
* DESCRIPTION
*
* Compare two Client ID's entirely and not just the hash from the ID.
*
***/
-bool silc_hash_client_id_compare(void *key1, void *key2, void *user_context);
+SilcBool silc_hash_client_id_compare(void *key1, void *key2, void *user_context);
/****f* silcutil/SilcUtilAPI/silc_hash_data_compare
*
* SYNOPSIS
*
- * bool silc_hash_data_compare(void *key1, void *key2, void *user_context);
+ * SilcBool silc_hash_data_compare(void *key1, void *key2, void *user_context);
*
* DESCRIPTION
*
* Compares binary data. May be used as SilcHashTable comparison function.
*
***/
-bool silc_hash_data_compare(void *key1, void *key2, void *user_context);
+SilcBool silc_hash_data_compare(void *key1, void *key2, void *user_context);
/****f* silcutil/SilcUtilAPI/silc_hash_utf8_compare
*
* SYNOPSIS
*
- * bool silc_hash_utf8_compare(void *key1, void *key2, void *user_context);
+ * SilcBool silc_hash_utf8_compare(void *key1, void *key2, void *user_context);
*
* DESCRIPTION
*
* expected. May be used as SilcHashTable comparison function.
*
***/
-bool silc_hash_utf8_compare(void *key1, void *key2, void *user_context);
+SilcBool silc_hash_utf8_compare(void *key1, void *key2, void *user_context);
/****f* silcutil/SilcUtilAPI/silc_hash_public_key_compare
*
* SYNOPSIS
*
- * bool silc_hash_public_key_compare(void *key1, void *key2,
+ * SilcBool silc_hash_public_key_compare(void *key1, void *key2,
* void *user_context);
*
* DESCRIPTION
* comparison function.
*
***/
-bool silc_hash_public_key_compare(void *key1, void *key2, void *user_context);
+SilcBool silc_hash_public_key_compare(void *key1, void *key2, void *user_context);
/****f* silcutil/SilcUtilAPI/silc_client_chmode
*
*
* SYNOPSIS
*
- * bool silc_string_is_ascii(const unsigned char *data,
+ * SilcBool silc_string_is_ascii(const unsigned char *data,
* SilcUInt32 data_len);
*
* DESCRIPTION
* Return TRUE if the `data' is ASCII string.
*
***/
-bool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len);
+SilcBool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len);
/****f* silcutil/SilcUtilAPI/silc_parse_version_string
*
* SYNOPSIS
*
- * bool silc_parse_version_string(const char *version,
+ * SilcBool silc_parse_version_string(const char *version,
* SilcUInt32 *protocol_version,
* char **protocol_version_string,
* SilcUInt32 *software_version,
* Parses SILC protocol style version string.
*
***/
-bool silc_parse_version_string(const char *version,
+SilcBool silc_parse_version_string(const char *version,
SilcUInt32 *protocol_version,
char **protocol_version_string,
SilcUInt32 *software_version,
*
* SYNOPSIS
*
- * char *silc_get_input(const char *prompt, bool echo_off);
+ * char *silc_get_input(const char *prompt, SilcBool echo_off);
*
* DESCRIPTION
*
* Displays input prompt on command line and takes input data from user.
*
***/
-char *silc_get_input(const char *prompt, bool echo_off);
+char *silc_get_input(const char *prompt, SilcBool echo_off);
/* System dependant prototypes */
*
* SYNOPSIS
*
- * bool silc_compare_timeval(struct timeval *smaller,
+ * SilcBool silc_compare_timeval(struct timeval *smaller,
* struct timeval *bigger)
*
* DESCRIPTION
* time value is smaller than the second time value.
*
***/
-bool silc_compare_timeval(struct timeval *smaller,
+SilcBool silc_compare_timeval(struct timeval *smaller,
struct timeval *bigger);
/****f* silcutil/SilcUtilAPI/silc_string_regexify
*
* SYNOPSIS
*
- * bool silc_get_mode_list(SilcBuffer mode_list, SilcUInt32 mode_list_count,
+ * SilcBool silc_get_mode_list(SilcBuffer mode_list, SilcUInt32 mode_list_count,
* SilcUInt32 **list);
*
* DESCRIPTION
* there is error parsing the list.
*
***/
-bool silc_get_mode_list(SilcBuffer mode_list, SilcUInt32 mode_list_count,
+SilcBool silc_get_mode_list(SilcBuffer mode_list, SilcUInt32 mode_list_count,
SilcUInt32 **list);
/****f* silcutil/SilcUtilAPI/silc_get_status_message
/* Decode VCard */
-bool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len,
+SilcBool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len,
SilcVCard vcard)
{
unsigned char *val;
- bool has_begin = FALSE, has_end = FALSE;
+ SilcBool has_begin = FALSE, has_end = FALSE;
int len, i, off = 0;
val = (unsigned char *)data;
char *note; /* a note, string */
char *rev; /* revision of card, UTC date string */
- bool dynamic; /* TRUE when dynamically allocated */
+ SilcBool dynamic; /* TRUE when dynamically allocated */
} SilcVCardStruct, *SilcVCard;
/***/
*
* SYNOPSIS
*
- * bool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len,
+ * SilcBool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len,
* SilcVCard vcard);
*
* DESCRIPTION
* is freed with silc_vcard_free function when it is not needed anymore.
*
***/
-bool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len,
+SilcBool silc_vcard_decode(const unsigned char *data, SilcUInt32 data_len,
SilcVCard vcard);
/****f* silcutil/SilcVCard/silc_vcard_alloc
static void *st_blocks = NULL;
static unsigned long st_blocks_count = 0;
-static bool dump = FALSE;
-static bool malloc_check = FALSE;
+static SilcBool dump = FALSE;
+static SilcBool malloc_check = FALSE;
#define SILC_ST_DEPTH 10
SilcAsyncOperation op;
Callback cb;
void *cb_context;
- bool aborted;
+ SilcBool aborted;
} *Foo;
SILC_FSM_STATE(test_st_start);
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
SilcFSM fsm;
Foo f;
typedef struct {
SilcFSMThreadStruct thread;
SilcFSMSemaStruct sema;
- bool finished;
+ SilcBool finished;
int rounds;
Foo f;
} T;
struct FooStruct {
- bool error;
+ SilcBool error;
SilcFSM fsm;
SilcFSMThreadStruct thread;
int timeout;
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
SilcSchedule schedule;
SilcFSM fsm;
Foo f;
int val;
} *entry;
-bool dump = FALSE;
-bool auto_rehash = TRUE;
+SilcBool dump = FALSE;
+SilcBool auto_rehash = TRUE;
int count = 2000;
SilcHashTable t = NULL;
return e->val + silc_hash_string(e->name, NULL);
}
-bool hash_compare(void *key1, void *key2, void *user_context)
+SilcBool hash_compare(void *key1, void *key2, void *user_context)
{
entry e = key1;
entry e2 = key2;
silc_free(e);
}
-bool add_entries()
+SilcBool add_entries()
{
entry e;
int i;
return TRUE;
}
-bool del_entries_with_list()
+SilcBool del_entries_with_list()
{
SilcHashTableList htl;
entry e;
silc_hash_table_del(t, key);
}
-bool del_n_entries_foreach()
+SilcBool del_n_entries_foreach()
{
struct entry_struct f;
int i;
return TRUE;
}
-bool del_entries_foreach()
+SilcBool del_entries_foreach()
{
SILC_LOG_DEBUG(("Deleting all entries with foreach"));
silc_hash_table_foreach(t, del_foreach, NULL);
return TRUE;
}
-bool alloc_table()
+SilcBool alloc_table()
{
SILC_LOG_DEBUG(("Allocating hash table with %d entries (%s)",
count, auto_rehash ? "auto rehash" : "no auto rehash"));
return TRUE;
}
-bool delete_table_with_list()
+SilcBool delete_table_with_list()
{
SILC_LOG_DEBUG(("Deleting entries with SilcHashTableList"));
return TRUE;
}
-bool find_entries()
+SilcBool find_entries()
{
struct entry_struct f;
entry e;
return TRUE;
}
-bool dump_table()
+SilcBool dump_table()
{
SilcHashTableList htl;
entry e;
char *name;
- bool dumpped = FALSE;
+ SilcBool dumpped = FALSE;
SILC_LOG_DEBUG(("Dumping hash table entries"));
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
int i;
if (argc > 1 && !strcmp(argv[1], "-d")) {
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
SilcList list;
struct foo *f, *f1, *f2, *f3, *f4;
#include "silcincludes.h"
#include "silcmime.h"
-struct foo {
- int i;
- struct foo *next;
-};
-
-static void ass_complete(SilcMime mime, void *context)
-{
- unsigned char *enc;
- SilcUInt32 enc_len;
-
- SILC_LOG_DEBUG(("Defragmentation completed"));
- SILC_LOG_DEBUG(("Encoding MIME context"));
- enc = silc_mime_encode(mime, &enc_len);
- if (!enc)
- SILC_LOG_DEBUG(("Error encoding"));
- SILC_LOG_DEBUG(("Encoded MIME message: \n%s", enc));
- silc_free(enc);
- silc_mime_free(mime);
-}
-
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
SilcMime mime, part, part2;
SilcMimeAssembler ass;
int i;
SilcUInt32 enc_len;
SilcDList frag;
SilcBuffer buf;
+ const char *mtype;
if (argc > 1 && !strcmp(argv[1], "-d")) {
silc_log_debug(TRUE);
SILC_LOG_DEBUG(("Re-encoded MIME message: \n%s", enc));
silc_free(enc);
SILC_LOG_DEBUG(("Get multiparts"));
- frag = silc_mime_get_multiparts(mime);
+ frag = silc_mime_get_multiparts(mime, &mtype);
if (!frag)
goto err;
+ SILC_LOG_DEBUG(("Multipart type '%s'", mtype));
silc_dlist_start(frag);
while ((part = silc_dlist_get(frag)) != SILC_LIST_END) {
SILC_LOG_DEBUG(("Encoding MIME part"));
/* Fragmentation test */
SILC_LOG_DEBUG(("Allocating MIME assembler"));
- ass = silc_mime_assembler_alloc(ass_complete, NULL);
+ ass = silc_mime_assembler_alloc();
if (!ass)
goto err;
SILC_LOG_DEBUG(("Allocating MIME message context"));
goto err;
silc_dlist_start(frag);
while ((buf = silc_dlist_get(frag)) != SILC_LIST_END)
- SILC_LOG_DEBUG(("Fragment \n%s", buf->data, buf->len));
+ SILC_LOG_DEBUG(("Fragment \n%s", buf->data, silc_buffer_len(buf)));
SILC_LOG_DEBUG(("Defragment"));
silc_dlist_start(frag);
while ((buf = silc_dlist_get(frag)) != SILC_LIST_END) {
- part = silc_mime_decode(buf->data, buf->len);
+ part = silc_mime_decode(buf->data, silc_buffer_len(buf));
if (!silc_mime_is_partial(part))
goto err;
- silc_mime_assemble(ass, part);
+ part = silc_mime_assemble(ass, part);
+ if (part) {
+ SILC_LOG_DEBUG(("Defragmentation completed"));
+ SILC_LOG_DEBUG(("Encoding MIME context"));
+ enc = silc_mime_encode(mime, &enc_len);
+ if (!enc)
+ SILC_LOG_DEBUG(("Error encoding"));
+ SILC_LOG_DEBUG(("Encoded MIME message: \n%s", enc));
+ silc_free(enc);
+ }
}
silc_mime_partial_free(frag);
silc_mime_assembler_free(ass);
SilcNetStatus client_status;
SilcStream server_stream;
SilcNetStatus server_status;
- bool success;
+ SilcBool success;
} *Foo;
SILC_FSM_STATE(test_st_start);
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
SilcFSM fsm;
Foo f;
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
if (argc > 1 && !strcmp(argv[1], "-d")) {
silc_log_debug(TRUE);
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
SilcStack stack;
void *ptr, *ptr2;
int i;
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
int i, enc;
unsigned char *out = NULL;
SilcUInt32 out_len;
int main(int argc, char **argv)
{
- bool success = FALSE;
+ SilcBool success = FALSE;
unsigned char *s1, *s2, *s3, *s4;
int l, opt;
#endif /* SILC_THREADS */
};
-bool silc_mutex_alloc(SilcMutex *mutex)
+SilcBool silc_mutex_alloc(SilcMutex *mutex)
{
#ifdef SILC_THREADS
*mutex = silc_calloc(1, sizeof(**mutex));
#endif
} SilcSockaddr;
-static bool silc_net_set_sockaddr(SilcSockaddr *addr, const char *ip_addr,
+static SilcBool silc_net_set_sockaddr(SilcSockaddr *addr, const char *ip_addr,
int port)
{
int len;
SilcNetServer
silc_net_create_server(const char **local_ip_addr, SilcUInt32 local_ip_count,
- int port, bool require_fqdn, SilcSchedule schedule,
+ int port, SilcBool require_fqdn, SilcSchedule schedule,
SilcNetCallback callback, void *context)
{
SilcNetServer netserver = NULL;
SilcNetConnect conn = fsm_context;
int sock, rval;
SilcSockaddr desthost;
- bool prefer_ipv6 = TRUE;
+ SilcBool prefer_ipv6 = TRUE;
if (conn->aborted) {
/** Aborted */
/* Converts the IP number string from numbers-and-dots notation to
binary form. */
-bool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
+SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
{
int ret = 0;
SilcUInt32 signal;
SilcTaskCallback callback;
void *context;
- bool call;
+ SilcBool call;
} SilcUnixSignal;
/* Internal context. */
#if 0
/* Returns human readable socket error message */
-bool silc_socket_get_error(SilcStream sock, char *error,
+SilcBool silc_socket_get_error(SilcStream sock, char *error,
SilcUInt32 error_len)
{
char *err;
#include "silcincludes.h"
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
- bool waitable)
+ SilcBool waitable)
{
#ifdef SILC_THREADS
pthread_attr_t attr;
#endif
}
-bool silc_thread_wait(SilcThread thread, void **exit_value)
+SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
{
#ifdef SILC_THREADS
SILC_LOG_DEBUG(("Waiting for thread %p", thread));
#endif /* SILC_THREADS */
};
-bool silc_mutex_alloc(SilcMutex *mutex)
+SilcBool silc_mutex_alloc(SilcMutex *mutex)
{
#ifdef SILC_THREADS
*mutex = silc_calloc(1, sizeof(**mutex));
/* Converts the IP number string from numbers-and-dots notation to
binary form. */
-bool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
+SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len)
{
unsigned long ret;
/* Init Winsock2. */
-bool silc_net_win32_init(void)
+SilcBool silc_net_win32_init(void)
{
int ret, sopt = SO_SYNCHRONOUS_NONALERT;
WSADATA wdata;
/* Returns human readable socket error message */
-bool silc_socket_get_error(SilcSocketConnection sock, char *error,
+SilcBool silc_socket_get_error(SilcSocketConnection sock, char *error,
SilcUInt32 error_len)
{
/* XXX TODO */
HANDLE thread;
SilcThreadStart start_func;
void *context;
- bool waitable;
+ SilcBool waitable;
} *SilcWin32Thread;
static DWORD silc_thread_tls;
#endif
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
- bool waitable)
+ SilcBool waitable)
{
#ifdef SILC_THREADS
SilcWin32Thread thread;
#endif
}
-bool silc_thread_wait(SilcThread thread, void **exit_value)
+SilcBool silc_thread_wait(SilcThread thread, void **exit_value)
{
#ifdef SILC_THREADS
SilcWin32Thread self = (SilcWin32Thread)thread;