Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/utils/sprintf.h
1476 views
1
/*
2
* Copyright (c) 2019 CTCaer
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#ifndef _SPRINTF_H_
18
#define _SPRINTF_H_
19
20
#include <stdarg.h>
21
22
#include <utils/types.h>
23
24
/*
25
* Padding:
26
* Numbers:
27
* %3d: Fill: ' ', Count: 3.
28
* % 3d: Fill: ' ', Count: 3.
29
* %23d: Fill: '2', Count: 3.
30
* % 23d: Fill: ' ', Count: 23.
31
* %223d: Fill: '2', Count: 23.
32
*
33
* Strings, Fill: ' ':
34
* %3s: Count: 5, Left.
35
* %23s: Count: 5, Left.
36
* %223s: Count: 25, Left.
37
* %.3s: Count: 5, Right.
38
* %.23s: Count: 25, Right.
39
* %.223s: Count: 225, Right.
40
*/
41
42
void s_printf(char *out_buf, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
43
void s_vprintf(char *out_buf, const char *fmt, va_list ap);
44
45
#endif
46
47