aboutsummaryrefslogtreecommitdiff
path: root/src/lib/string/printf.h
blob: 2f462065459f9157fcfce829cb06022b23297e10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Copyright (c) 2003-2004, Roger Dingledine
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
 * Copyright (c) 2007-2018, The Tor Project, Inc. */
/* See LICENSE for licensing information */

#ifndef TOR_UTIL_PRINTF_H
#define TOR_UTIL_PRINTF_H

#include "orconfig.h"
#include "lib/cc/compat_compiler.h"

#include <stdarg.h>
#include <stddef.h>

int tor_snprintf(char *str, size_t size, const char *format, ...)
  CHECK_PRINTF(3,4) ATTR_NONNULL((1,3));
int tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
  CHECK_PRINTF(3,0) ATTR_NONNULL((1,3));

int tor_asprintf(char **strp, const char *fmt, ...)
  CHECK_PRINTF(2,3);
int tor_vasprintf(char **strp, const char *fmt, va_list args)
  CHECK_PRINTF(2,0);

#endif /* !defined(TOR_UTIL_STRING_H) */