@LINK=silcfsm.html:Finite State Machine Interface
@LINK=silcfileutil.html:File Utility Functions
@LINK=silcstrutil.html:String Utility Interface
+@LINK=silcsnprintf.html:Snprintf Interface
@LINK=silcutf8.html:UTF-8 String Interface
@LINK=silcstringprep.html:Stringprep Interface
@LINK=silcutil.html:Utility Functions
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1998 - 2006 Pekka Riikonen
+ Copyright (C) 1998 - 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
ftask->events = SILC_TASK_READ;
ftask->fd = fd;
- /* Add task */
+ /* Add task and schedule it */
silc_hash_table_add(schedule->fd_queue, SILC_32_TO_PTR(fd), ftask);
+ schedule_ops.schedule_fd(schedule, schedule->internal, ftask,
+ ftask->events);
task = (SilcTask)ftask;
#define DP_F_ZERO (1 << 4)
#define DP_F_UP (1 << 5)
#define DP_F_UNSIGNED (1 << 6)
+#define DP_F_HEXPREFIX (1 << 7)
/* Conversion Flags */
#define DP_C_SHORT 1
fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max);
break;
case 'p':
+ flags |= (DP_F_UNSIGNED | DP_F_HEXPREFIX);
strvalue = va_arg (args, void *);
- fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
+ fmtint (buffer, &currlen, maxlen, (long )strvalue, 16, min, max,
+ flags);
break;
case 'n':
if (cflags == DP_C_SHORT) {
/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */
static void fmtint(char *buffer, size_t *currlen, size_t maxlen,
- long value, int base, int min, int max, int flags)
+ long value, int base, int min, int max, int flags)
{
int signvalue = 0;
unsigned long uvalue;
--spadlen;
}
+ /* 0x prefix */
+ if (flags & DP_F_HEXPREFIX) {
+ dopr_outch (buffer, currlen, maxlen, '0');
+ dopr_outch (buffer, currlen, maxlen, 'x');
+ }
+
/* Sign */
if (signvalue)
dopr_outch (buffer, currlen, maxlen, signvalue);
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1998 - 2006 Pekka Riikonen
+ Copyright (C) 1998 - 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
SilcUnixScheduler internal = (SilcUnixScheduler)context;
struct epoll_event event;
+ if (!internal)
+ return FALSE;
+
event.events = 0;
if (task->events & SILC_TASK_READ)
event.events |= (EPOLLIN | EPOLLPRI);
return NULL;
}
#endif
+ silc_schedule_internal_schedule_fd(schedule, internal,
+ (SilcTaskFd)internal->wakeup_task,
+ SILC_TASK_READ);
internal->app_context = app_context;