mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-20 05:49:08 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
391c75b427 | ||
![]() |
45783ae4ca | ||
![]() |
5902730a03 | ||
![]() |
42601170ac | ||
![]() |
0bd48c4a4d | ||
![]() |
d03b2b07fc | ||
![]() |
cb1346e5b3 | ||
![]() |
61fa98ea9e | ||
![]() |
931e043430 |
31
Makefile
31
Makefile
@@ -1,7 +1,7 @@
|
|||||||
LIB_NAME := libbsd
|
LIB_NAME := libbsd
|
||||||
LIB_VERSION_MAJOR := 0
|
LIB_VERSION_MAJOR := 0
|
||||||
LIB_VERSION_MINOR := 1
|
LIB_VERSION_MINOR := 1
|
||||||
LIB_VERSION_MICRO := 2
|
LIB_VERSION_MICRO := 4
|
||||||
LIB_VERSION := $(LIB_VERSION_MAJOR).$(LIB_VERSION_MINOR).$(LIB_VERSION_MICRO)
|
LIB_VERSION := $(LIB_VERSION_MAJOR).$(LIB_VERSION_MINOR).$(LIB_VERSION_MICRO)
|
||||||
|
|
||||||
LIB_PKGCONFIG := $(LIB_NAME).pc
|
LIB_PKGCONFIG := $(LIB_NAME).pc
|
||||||
@@ -82,13 +82,13 @@ CFLAGS ?= -g -Wall -Wextra -Wno-unused-variable
|
|||||||
|
|
||||||
MK_CFLAGS := -Iinclude/ -include bsd/bsd.h -D_GNU_SOURCE -D__REENTRANT
|
MK_CFLAGS := -Iinclude/ -include bsd/bsd.h -D_GNU_SOURCE -D__REENTRANT
|
||||||
|
|
||||||
prefix := /usr
|
prefix = /usr
|
||||||
exec_prefix :=
|
exec_prefix =
|
||||||
libdir := ${exec_prefix}/lib
|
libdir = ${exec_prefix}/lib
|
||||||
usrlibdir := ${prefix}/lib
|
usrlibdir = ${prefix}/lib
|
||||||
includedir := ${prefix}/include
|
includedir = ${prefix}/include
|
||||||
pkgconfigdir := ${usrlibdir}/pkgconfig
|
pkgconfigdir = ${usrlibdir}/pkgconfig
|
||||||
mandir := ${prefix}/share/man
|
mandir = ${prefix}/share/man
|
||||||
|
|
||||||
.PHONY: libs
|
.PHONY: libs
|
||||||
libs: $(LIB_STATIC) $(LIB_SHARED_SO) $(LIB_PKGCONFIG)
|
libs: $(LIB_STATIC) $(LIB_SHARED_SO) $(LIB_PKGCONFIG)
|
||||||
@@ -108,13 +108,12 @@ man/md5.3bsd: man/mdX.3
|
|||||||
src/hash/md5hl.c: src/hash/helper.c
|
src/hash/md5hl.c: src/hash/helper.c
|
||||||
sed -e 's:hashinc:bsd/md5.h:g' -e 's:HASH:MD5:g' $< > $@
|
sed -e 's:hashinc:bsd/md5.h:g' -e 's:HASH:MD5:g' $< > $@
|
||||||
|
|
||||||
# FIXME: the variables should be preserved unexpanded in the .pc file
|
|
||||||
$(LIB_PKGCONFIG): $(LIB_PKGCONFIG).in
|
$(LIB_PKGCONFIG): $(LIB_PKGCONFIG).in
|
||||||
sed -e 's:@VERSION@:$(LIB_VERSION):' \
|
sed -e 's:@VERSION@:$(LIB_VERSION):' \
|
||||||
-e 's:@prefix@:$(prefix):' \
|
-e 's:@prefix@:$(value prefix):' \
|
||||||
-e 's:@exec_prefix@:$(exec_prefix):' \
|
-e 's:@exec_prefix@:$(value exec_prefix):' \
|
||||||
-e 's:@libdir@:$(libdir):' \
|
-e 's:@libdir@:$(value usrlibdir):' \
|
||||||
-e 's:@includedir@:$(includedir):' \
|
-e 's:@includedir@:$(value includedir):' \
|
||||||
$< > $@
|
$< > $@
|
||||||
|
|
||||||
$(LIB_STATIC): $(LIB_STATIC_OBJS)
|
$(LIB_STATIC): $(LIB_STATIC_OBJS)
|
||||||
@@ -158,7 +157,13 @@ install: libs man
|
|||||||
done
|
done
|
||||||
install -m644 $(LIB_MANS) $(DESTDIR)/$(mandir)/man3
|
install -m644 $(LIB_MANS) $(DESTDIR)/$(mandir)/man3
|
||||||
install -m644 $(LIB_PKGCONFIG) $(DESTDIR)/$(pkgconfigdir)
|
install -m644 $(LIB_PKGCONFIG) $(DESTDIR)/$(pkgconfigdir)
|
||||||
|
ifeq ($(libdir),$(usrlibdir))
|
||||||
|
# If both dirs are the same, do a relative symlink.
|
||||||
|
ln -sf $(LIB_SHARED) $(DESTDIR)/$(usrlibdir)/$(LIB_SHARED_SO)
|
||||||
|
else
|
||||||
|
# Otherwise, do an absolute one.
|
||||||
ln -sf $(libdir)/$(LIB_SHARED) $(DESTDIR)/$(usrlibdir)/$(LIB_SHARED_SO)
|
ln -sf $(libdir)/$(LIB_SHARED) $(DESTDIR)/$(usrlibdir)/$(LIB_SHARED_SO)
|
||||||
|
endif
|
||||||
ln -sf $(LIB_SHARED) $(DESTDIR)/$(libdir)/$(LIB_SONAME)
|
ln -sf $(LIB_SHARED) $(DESTDIR)/$(libdir)/$(LIB_SONAME)
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2004, 2005, 2006 Guillem Jover
|
* Copyright © 2004, 2005, 2006, 2009 Guillem Jover
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -61,6 +61,10 @@
|
|||||||
# define __bounded__(x, y, z)
|
# define __bounded__(x, y, z)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __RCSID
|
||||||
|
# define __RCSID(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __FBSDID
|
#ifndef __FBSDID
|
||||||
# define __FBSDID(x)
|
# define __FBSDID(x)
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2006 Robert Millan
|
* Copyright © 2006 Robert Millan
|
||||||
|
* Copyright © 2009 Guillem Jover
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -27,11 +28,15 @@
|
|||||||
#ifndef LIBBSD_ERR_H
|
#ifndef LIBBSD_ERR_H
|
||||||
#define LIBBSD_ERR_H
|
#define LIBBSD_ERR_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
extern void warnc (int code, const char *format, ...);
|
extern void warnc (int code, const char *format, ...);
|
||||||
extern void vwarnc (int code, const char *format, va_list ap);
|
extern void vwarnc (int code, const char *format, va_list ap);
|
||||||
extern void errc (int status, int code, const char *format, ...);
|
extern void errc (int status, int code, const char *format, ...);
|
||||||
extern void verrc (int status, int code, const char *format, va_list ap);
|
extern void verrc (int status, int code, const char *format, va_list ap);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2006 Robert Millan
|
* Copyright © 2006 Robert Millan
|
||||||
|
* Copyright © 2009 Guillem Jover
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -27,10 +28,13 @@
|
|||||||
#ifndef LIBBSD_GETOPT_H
|
#ifndef LIBBSD_GETOPT_H
|
||||||
#define LIBBSD_GETOPT_H
|
#define LIBBSD_GETOPT_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
extern int optreset;
|
extern int optreset;
|
||||||
|
|
||||||
int bsd_getopt (int, char **, char *);
|
int bsd_getopt (int, char **, char *);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2008 Guillem Jover
|
* Copyright © 2008, 2009 Guillem Jover
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -27,9 +27,12 @@
|
|||||||
#ifndef LIBBSD_INET_H
|
#ifndef LIBBSD_INET_H
|
||||||
#define LIBBSD_INET_H
|
#define LIBBSD_INET_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
int inet_net_pton(int af, const char *src, void *dst, siez_t size);
|
int inet_net_pton(int af, const char *src, void *dst, siez_t size);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2004, 2005 Guillem Jover
|
* Copyright © 2004, 2005, 2009 Guillem Jover
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -27,11 +27,14 @@
|
|||||||
#ifndef LIBBSD_RANDOM_H
|
#ifndef LIBBSD_RANDOM_H
|
||||||
#define LIBBSD_RANDOM_H
|
#define LIBBSD_RANDOM_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
u_int32_t arc4random();
|
u_int32_t arc4random();
|
||||||
void arc4random_stir();
|
void arc4random_stir();
|
||||||
void arc4random_addrandom(u_char *dat, int datlen);
|
void arc4random_addrandom(u_char *dat, int datlen);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright © 2005 Aurelien Jarno
|
* Copyright © 2005 Aurelien Jarno
|
||||||
* Copyright © 2006 Robert Millan
|
* Copyright © 2006 Robert Millan
|
||||||
* Copyright © 2008 Guillem Jover
|
* Copyright © 2008, 2009 Guillem Jover
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -29,9 +29,11 @@
|
|||||||
#ifndef LIBBSD_STDLIB_H
|
#ifndef LIBBSD_STDLIB_H
|
||||||
#define LIBBSD_STDLIB_H
|
#define LIBBSD_STDLIB_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
const char *fmtcheck (const char *, const char *);
|
const char *fmtcheck (const char *, const char *);
|
||||||
|
|
||||||
char *getprogname ();
|
char *getprogname ();
|
||||||
@@ -45,5 +47,6 @@ int heapsort (void *, size_t, size_t, int (*)(const void *, const void *));
|
|||||||
|
|
||||||
mode_t getmode(const void *set, mode_t mode);
|
mode_t getmode(const void *set, mode_t mode);
|
||||||
void *setmode(const char *mode_str);
|
void *setmode(const char *mode_str);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -27,15 +27,18 @@
|
|||||||
#ifndef LIBBSD_STRING_H
|
#ifndef LIBBSD_STRING_H
|
||||||
#define LIBBSD_STRING_H
|
#define LIBBSD_STRING_H
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
size_t strlcpy(char *dst, const char *src, size_t siz);
|
size_t strlcpy(char *dst, const char *src, size_t siz);
|
||||||
size_t strlcat(char *dst, const char *src, size_t siz);
|
size_t strlcat(char *dst, const char *src, size_t siz);
|
||||||
char *fgetln(FILE *fp, size_t *lenp);
|
char *fgetln(FILE *fp, size_t *lenp);
|
||||||
wchar_t *fgetwln(FILE * __restrict fp, size_t *lenp);
|
wchar_t *fgetwln(FILE * __restrict fp, size_t *lenp);
|
||||||
|
|
||||||
void strmode(mode_t mode, char *str);
|
void strmode(mode_t mode, char *str);
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -57,6 +57,9 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
|
|||||||
|
|
||||||
#ifdef _NLIST_DO_AOUT
|
#ifdef _NLIST_DO_AOUT
|
||||||
static int __aout_fdnlist(int, struct nlist *);
|
static int __aout_fdnlist(int, struct nlist *);
|
||||||
|
#ifndef N_SYMSIZE
|
||||||
|
#define N_SYMSIZE(a) ((a).a_syms)
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef _NLIST_DO_ELF
|
#ifdef _NLIST_DO_ELF
|
||||||
static int __elf_fdnlist(int, struct nlist *);
|
static int __elf_fdnlist(int, struct nlist *);
|
||||||
|
Reference in New Issue
Block a user