mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-14 15:05:39 +02:00
Add new fparseln() function
Taken from NetBSD. [guillem@hadrons.org: - Import from NetBSD instead of FreeBSD to get a 3-clause BSD license, instead of a 4-clause one. - Define compatibility macros. - Change library from libc to libbsd and header in man page. - Add copyright information to COPYING. - Add symbol to map file. ] Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
@@ -40,8 +40,10 @@
|
||||
#define _LIBUTIL_H_
|
||||
|
||||
#include <features.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* for pidfile.c */
|
||||
struct pidfh {
|
||||
@@ -62,6 +64,8 @@ struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr);
|
||||
int pidfile_write(struct pidfh *pfh);
|
||||
int pidfile_close(struct pidfh *pfh);
|
||||
int pidfile_remove(struct pidfh *pfh);
|
||||
|
||||
char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
|
||||
__END_DECLS
|
||||
|
||||
/* humanize_number(3) */
|
||||
@@ -73,4 +77,13 @@ __END_DECLS
|
||||
#define HN_GETSCALE 0x10
|
||||
#define HN_AUTOSCALE 0x20
|
||||
|
||||
/*
|
||||
* fparseln() specific operation flags.
|
||||
*/
|
||||
#define FPARSELN_UNESCESC 0x01
|
||||
#define FPARSELN_UNESCCONT 0x02
|
||||
#define FPARSELN_UNESCCOMM 0x04
|
||||
#define FPARSELN_UNESCREST 0x08
|
||||
#define FPARSELN_UNESCALL 0x0f
|
||||
|
||||
#endif /* !_LIBUTIL_H_ */
|
||||
|
Reference in New Issue
Block a user