luasandbox
1.4.0
Generic Lua sandbox for dynamic data analysis
|
Data stream output buffer. More...
Go to the source code of this file.
Classes | |
struct | lsb_output_buffer |
Macros | |
#define | LSB_OUTPUT_SIZE 1024 |
Typedefs | |
typedef struct lsb_output_buffer | lsb_output_buffer |
Functions | |
LSB_UTIL_EXPORT lsb_err_value | lsb_init_output_buffer (lsb_output_buffer *b, size_t max_message_size) |
Initialize the provided input buffer. More... | |
LSB_UTIL_EXPORT void | lsb_free_output_buffer (lsb_output_buffer *b) |
Frees the memory internally allocated by the buffer and resets the state. More... | |
LSB_UTIL_EXPORT lsb_err_value | lsb_expand_output_buffer (lsb_output_buffer *b, size_t needed) |
Resize the output buffer when more space is needed. More... | |
LSB_UTIL_EXPORT lsb_err_value | lsb_outputc (lsb_output_buffer *b, char ch) |
Append a character to the output buffer. More... | |
LSB_UTIL_EXPORT lsb_err_value | lsb_outputf (lsb_output_buffer *b, const char *fmt,...) |
Append a formatted string to the output buffer. More... | |
LSB_UTIL_EXPORT lsb_err_value | lsb_outputs (lsb_output_buffer *b, const char *str, size_t len) |
Append a fixed string to the output buffer. More... | |
LSB_UTIL_EXPORT lsb_err_value | lsb_outputd (lsb_output_buffer *b, double d) |
More efficient output of a double to a string. More... | |
LSB_UTIL_EXPORT lsb_err_value | lsb_outputfd (lsb_output_buffer *b, double d) |
More efficient output of a double to a string; no NaN or Inf outputs. More... | |
Data stream output buffer.
Definition in file output_buffer.h.
#define LSB_OUTPUT_SIZE 1024 |
Definition at line 16 of file output_buffer.h.
typedef struct lsb_output_buffer lsb_output_buffer |
LSB_UTIL_EXPORT lsb_err_value lsb_expand_output_buffer | ( | lsb_output_buffer * | b, |
size_t | needed | ||
) |
Resize the output buffer when more space is needed.
b | Output buffer to resize. |
needed | Number of additional bytes needed. |
LSB_UTIL_EXPORT void lsb_free_output_buffer | ( | lsb_output_buffer * | b | ) |
Frees the memory internally allocated by the buffer and resets the state.
b | Output buffer |
LSB_UTIL_EXPORT lsb_err_value lsb_init_output_buffer | ( | lsb_output_buffer * | b, |
size_t | max_message_size | ||
) |
Initialize the provided input buffer.
b | Output buffer |
max_message_size | The maximum message size the buffer will handle before erroring |
LSB_UTIL_EXPORT lsb_err_value lsb_outputc | ( | lsb_output_buffer * | b, |
char | ch | ||
) |
Append a character to the output buffer.
b | Pointer the b buffer. |
ch | Character to append to the b. |
LSB_UTIL_EXPORT lsb_err_value lsb_outputd | ( | lsb_output_buffer * | b, |
double | d | ||
) |
More efficient output of a double to a string.
NaN/Inf check and then calls lsb_outputfd.
b | Pointer the output buffer. |
d | Double value to convert to a string. |
LSB_UTIL_EXPORT lsb_err_value lsb_outputf | ( | lsb_output_buffer * | b, |
const char * | fmt, | ||
... | |||
) |
Append a formatted string to the output buffer.
b | Pointer the b buffer. |
fmt | Printf format specifier. |
LSB_UTIL_EXPORT lsb_err_value lsb_outputfd | ( | lsb_output_buffer * | b, |
double | d | ||
) |
More efficient output of a double to a string; no NaN or Inf outputs.
b | Pointer the output buffer. |
d | Double value to convert to a string. |
LSB_UTIL_EXPORT lsb_err_value lsb_outputs | ( | lsb_output_buffer * | b, |
const char * | str, | ||
size_t | len | ||
) |
Append a fixed string to the output buffer.
b | Pointer the b buffer. |
str | String to append to the b. |
len | Length of the string to append |