Football I/O event handlers.
More...
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#include <ctype.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <stdbool.h>
#include "fb_service.h"
|
#define | _BSD_SOURCE /* snprintf() */ |
|
#define | _DEFAULT_SOURCE |
|
#define | _POSIX_C_SOURCE 200112L |
|
|
ssize_t | fb_queue_message (void *thing, FB_MESSAGE *message, bool broadcast) |
|
ssize_t | fb_fprint (void *thing, const char *bytes, ssize_t length) |
| Adds an unformatted message to the output queue. More...
|
|
ssize_t | fb_fprintf (void *thing, const char *format,...) |
| Add messages to output queues in various forms and styles. More...
|
|
ssize_t | fb_vfprintf (void *thing, const char *format, va_list parameters) |
|
ssize_t | fb_bfprintf (void *thing, const char *format,...) |
|
ssize_t | fb_bvfprintf (void *thing, const char *format, va_list parameters) |
|
ssize_t | fb_cbfprintf (void *thing, bool(*callback)(FB_CONNECTION *), const char *format,...) |
|
ssize_t | fb_cbvfprintf (void *thing, bool(*callback)(FB_CONNECTION *), const char *format, va_list parameters) |
|
FB_EVENT * | fb_send_output (FB_EVENT *event, FB_CONNECTION *connection) |
|
bool | fb_set_input_buffer_size (FB_CONNECTION *connection, size_t size) |
|
bool | fb_recv_input (FB_CONNECTION *connection, ssize_t byte_count) |
|
FB_EVENT * | fb_read_line_input (FB_EVENT *event, FB_CONNECTION *connection) |
|
FB_EVENT * | fb_read_input (FB_EVENT *ev, FB_CONNECTION *connection) |
|
FB_EVENT * | fb_new_connect (FB_EVENT *event, FB_SERVICE *service) |
|
Football I/O event handlers.
- Football socket abstraction layer
- Author
- Perette Barella
- Date
- 2012-03-03
- Copyright
- Copyright 2012-2021 Devious Fish. All rights reserved.
◆ fb_bfprintf()
ssize_t fb_bfprintf |
( |
void * |
thing, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ fb_bvfprintf()
ssize_t fb_bvfprintf |
( |
void * |
thing, |
|
|
const char * |
format, |
|
|
va_list |
parameters |
|
) |
| |
◆ fb_cbfprintf()
ssize_t fb_cbfprintf |
( |
void * |
thing, |
|
|
bool(*)(FB_CONNECTION *) |
callback, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
◆ fb_cbvfprintf()
ssize_t fb_cbvfprintf |
( |
void * |
thing, |
|
|
bool(*)(FB_CONNECTION *) |
callback, |
|
|
const char * |
format, |
|
|
va_list |
parameters |
|
) |
| |
◆ fb_fprint()
ssize_t fb_fprint |
( |
void * |
thing, |
|
|
const char * |
bytes, |
|
|
ssize_t |
length |
|
) |
| |
Adds an unformatted message to the output queue.
- Parameters
-
thing | the destined service, connection or event. |
bytes | the bytes to transmit. |
length | number of bytes in the message. |
- Returns
- -1 on error, number of bytes written on success or partial success.
◆ fb_fprintf()
ssize_t fb_fprintf |
( |
void * |
thing, |
|
|
const char * |
format, |
|
|
|
... |
|
) |
| |
Add messages to output queues in various forms and styles.
All forms take an opaque type and determine if it's a connection or service, so you can write code once and deal with both single and broadcast messages.
- 'b' variants broadcast, given either a connection or service. Services always broadcast, regardless of service.
- 'cb' variants broadcast only to those connections identified buy the supplied callback function returning
true
.
- 'v' accepts a pointer to the format arguments.
- Parameters
-
thing | the destined service, connection or event. |
format | a printf format string, with values to follow. |
- Returns
- -1 on error, number of bytes written on success or partial success.
◆ fb_vfprintf()
ssize_t fb_vfprintf |
( |
void * |
thing, |
|
|
const char * |
format, |
|
|
va_list |
parameters |
|
) |
| |