mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-28 12:30:58 +00:00
Add printf.h
This commit is contained in:
1 parent
2b325102f3
commit
8e14ad0536
19 files changed
+49
-37
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include "dns.h"
|
||||
#include "log.h"
|
||||
#include "printf.h"
|
||||
#include "str.h"
|
||||
#include "timer.h"
|
||||
#include "url.h"
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#include "event.h"
|
||||
#include "fmt.h"
|
||||
#include "log.h"
|
||||
#include "net.h"
|
||||
#include "printf.h"
|
||||
|
||||
void mg_call(struct mg_connection *c, int ev, void *ev_data) {
|
||||
// Run user-defined handler first, in order to give it an ability
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "fmt.h"
|
||||
#include "iobuf.h"
|
||||
#include "printf.h"
|
||||
#include "util.h"
|
||||
|
||||
static bool is_digit(int c) { return c >= '0' && c <= '9'; }
|
||||
|
||||
@@ -1,30 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "arch.h"
|
||||
#include "iobuf.h"
|
||||
#include "queue.h"
|
||||
|
||||
typedef void (*mg_pfn_t)(char, void *); // Output function
|
||||
typedef size_t (*mg_pm_t)(mg_pfn_t, void *, va_list *); // %M printer
|
||||
|
||||
size_t mg_vxprintf(void (*)(char, void *), void *, const char *fmt, va_list *);
|
||||
size_t mg_xprintf(void (*fn)(char, void *), void *, const char *fmt, ...);
|
||||
|
||||
// Convenience wrappers around mg_xprintf
|
||||
size_t mg_vsnprintf(char *buf, size_t len, const char *fmt, va_list *ap);
|
||||
size_t mg_snprintf(char *, size_t, const char *fmt, ...);
|
||||
char *mg_vmprintf(const char *fmt, va_list *ap);
|
||||
char *mg_mprintf(const char *fmt, ...);
|
||||
size_t mg_queue_vprintf(struct mg_queue *, const char *fmt, va_list *);
|
||||
size_t mg_queue_printf(struct mg_queue *, const char *fmt, ...);
|
||||
|
||||
// %M print helper functions
|
||||
size_t mg_print_ip(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_ip_port(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_ip4(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_ip6(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_mac(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
|
||||
// Various output functions
|
||||
void mg_pfn_iobuf(char ch, void *param); // param: struct mg_iobuf *
|
||||
void mg_pfn_stdout(char c, void *param); // param: ignored
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "fs.h"
|
||||
#include "fmt.h"
|
||||
#include "printf.h"
|
||||
|
||||
struct mg_fd *mg_fs_open(struct mg_fs *fs, const char *path, int flags) {
|
||||
struct mg_fd *fd = (struct mg_fd *) calloc(1, sizeof(*fd));
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#include "fmt.h"
|
||||
#include "fs.h"
|
||||
#include "printf.h"
|
||||
#include "str.h"
|
||||
|
||||
struct packed_file {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "json.h"
|
||||
#include "log.h"
|
||||
#include "net.h"
|
||||
#include "printf.h"
|
||||
#include "ssi.h"
|
||||
#include "util.h"
|
||||
#include "version.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "fmt.h"
|
||||
#include "log.h"
|
||||
#include "net.h"
|
||||
#include "printf.h"
|
||||
#include "timer.h"
|
||||
#include "tls.h"
|
||||
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
#include "fmt.h"
|
||||
#include "iobuf.h"
|
||||
#include "queue.h"
|
||||
#include "printf.h"
|
||||
#include "util.h"
|
||||
|
||||
size_t mg_queue_vprintf(struct mg_queue *q, const char *fmt, va_list *ap) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "arch.h"
|
||||
#include "iobuf.h"
|
||||
#include "queue.h"
|
||||
|
||||
// Convenience wrappers around mg_xprintf
|
||||
size_t mg_vsnprintf(char *buf, size_t len, const char *fmt, va_list *ap);
|
||||
size_t mg_snprintf(char *, size_t, const char *fmt, ...);
|
||||
char *mg_vmprintf(const char *fmt, va_list *ap);
|
||||
char *mg_mprintf(const char *fmt, ...);
|
||||
size_t mg_queue_vprintf(struct mg_queue *, const char *fmt, va_list *);
|
||||
size_t mg_queue_printf(struct mg_queue *, const char *fmt, ...);
|
||||
|
||||
// %M print helper functions
|
||||
size_t mg_print_ip(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_ip_port(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_ip4(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_ip6(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
size_t mg_print_mac(void (*out)(char, void *), void *arg, va_list *ap);
|
||||
|
||||
// Various output functions
|
||||
void mg_pfn_iobuf(char ch, void *param); // param: struct mg_iobuf *
|
||||
void mg_pfn_stdout(char c, void *param); // param: ignored
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "event.h"
|
||||
#include "log.h"
|
||||
#include "net.h"
|
||||
#include "printf.h"
|
||||
#include "str.h"
|
||||
#include "timer.h"
|
||||
#include "tls.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "ssi.h"
|
||||
#include "fmt.h"
|
||||
#include "log.h"
|
||||
#include "printf.h"
|
||||
#include "ssi.h"
|
||||
|
||||
#ifndef MG_MAX_SSI_DEPTH
|
||||
#define MG_MAX_SSI_DEPTH 5
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#include "fmt.h"
|
||||
#include "fs.h"
|
||||
#include "printf.h"
|
||||
#include "tls.h"
|
||||
|
||||
#if MG_ENABLE_MBEDTLS
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#include "fmt.h"
|
||||
#include "printf.h"
|
||||
#include "tls.h"
|
||||
|
||||
#if MG_ENABLE_OPENSSL
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "arch.h"
|
||||
#include "config.h"
|
||||
#include "fmt.h"
|
||||
#include "net.h"
|
||||
#include "str.h"
|
||||
|
||||
|
||||
Reference in new issue
Block a user