VERSION: Disable GIT_SNAPSHOT for the 4.12.0rc3 release.
[Samba.git] / lib / util / util.h
blobc89f4807d5b2cfad4185e18f08daefb136c4dfef
1 /*
2 Unix SMB/CIFS implementation.
3 Utility functions for Samba
4 Copyright (C) Andrew Tridgell 1992-1999
5 Copyright (C) Jelmer Vernooij 2005
6 Copyright (C) Swen Schillig 2019
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef __UTIL_SAMBA_UTIL_H__
23 #define __UTIL_SAMBA_UTIL_H__
25 #define SMB_STR_STANDARD 0x00
26 #define SMB_STR_ALLOW_NEGATIVE 0x01
27 #define SMB_STR_FULL_STR_CONV 0x02
28 #define SMB_STR_ALLOW_NO_CONVERSION 0x04
29 #define SMB_STR_GLIBC_STANDARD (SMB_STR_ALLOW_NO_CONVERSION | \
30 SMB_STR_ALLOW_NEGATIVE)
32 unsigned long int
33 smb_strtoul(const char *nptr, char **endptr, int base, int *err, int flags);
35 unsigned long long int
36 smb_strtoull(const char *nptr, char **endptr, int base, int *err, int flags);
38 /**
39 * Write dump of binary data to a callback
41 void dump_data_cb(const uint8_t *buf, int len,
42 bool omit_zero_bytes,
43 void (*cb)(const char *buf, void *private_data),
44 void *private_data);
46 /**
47 * Write dump of binary data to a FILE
49 void dump_data_file(const uint8_t *buf, int len, bool omit_zero_bytes,
50 FILE *f);
52 /**
53 * Write dump of binary data to the log file.
55 * The data is only written if the log level is at least level.
57 _PUBLIC_ void dump_data(int level, const uint8_t *buf,int len);
59 /**
60 * Write dump of binary data to the log file.
62 * The data is only written if the log level is at least level for
63 * debug class dbgc_class.
65 _PUBLIC_ void dump_data_dbgc(int dbgc_class, int level, const uint8_t *buf, int len);
67 #endif