Compare commits

..

11 Commits
0.1.1 ... 0.1.3

Author SHA1 Message Date
Guillem Jover
d03b2b07fc Release libbsd 0.1.3 2009-05-25 09:37:39 +02:00
Guillem Jover
cb1346e5b3 Export public functions as extern C 2009-05-25 09:25:13 +02:00
Guillem Jover
61fa98ea9e Add missing <stdarg.h> include in <bsd/err.h> 2009-05-25 09:12:45 +02:00
Guillem Jover
931e043430 Add new __RCSID macro
Define it to nothing, so that source imported from BSDs can be easily
compiled w/o needing to modify them.
2009-05-25 08:56:34 +02:00
Guillem Jover
f984a7006b Release libbsd 0.1.2 2009-05-25 06:57:50 +02:00
Guillem Jover
326a3a7619 Install humanize_number(3) man page 2009-05-25 06:57:03 +02:00
Guillem Jover
e4aff3d9fc Use N_SYMSIZE instead of directly accessing ‘struct exec’
On Linux alpha ‘struct exec’ does not have an a_syms member, and the
N_SYMSIZE is mapped to 0.
2009-05-25 06:41:42 +02:00
Gerardo Exequiel Pozzi
c3feeb0092 Add some man page links
Add man page links for strlcat, getmode and arc4random_*.

Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2009-05-25 06:32:45 +02:00
Guillem Jover
80c3954e3c Use the correct path when including a.out.h
Reported-by: Aurélien Jarno <aurelien@aurel32.net>
2009-05-25 06:23:01 +02:00
Guillem Jover
4c3e03efeb Add man/md5.3bsd to .gitignore 2009-05-25 06:22:22 +02:00
Guillem Jover
9b30dae909 Fix typos (‘ELFDATA2MSG’ → ‘ELFDATA2MSB’) 2009-05-21 05:04:09 +02:00
16 changed files with 45 additions and 10 deletions

View File

@@ -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 := 1 LIB_VERSION_MICRO := 3
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
@@ -60,11 +60,16 @@ LIB_INCLUDES := \
LIB_MANS := \ LIB_MANS := \
arc4random.3 \ arc4random.3 \
arc4random_addrandom.3 \
arc4random_stir.3 \
strlcpy.3 \ strlcpy.3 \
strlcat.3 \
fgetln.3 \ fgetln.3 \
humanize_number.3 \
fmtcheck.3 \ fmtcheck.3 \
nlist.3 \ nlist.3 \
setmode.3 \ setmode.3 \
getmode.3 \
strmode.3 \ strmode.3 \
md5.3bsd md5.3bsd
LIB_MANS := $(patsubst %,man/%,$(LIB_MANS)) LIB_MANS := $(patsubst %,man/%,$(LIB_MANS))

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -28,7 +28,7 @@
#define LIBBSD_NLIST_H #define LIBBSD_NLIST_H
#include <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/a.out.h> #include <a.out.h>
__BEGIN_DECLS __BEGIN_DECLS
extern int nlist(const char *filename, struct nlist *list); extern int nlist(const char *filename, struct nlist *list);

1
man/.gitignore vendored
View File

@@ -1 +1,2 @@
md5.3 md5.3
md5.3bsd

View File

@@ -0,0 +1 @@
.so man3/arc4random.3

1
man/arc4random_stir.3 Normal file
View File

@@ -0,0 +1 @@
.so man3/arc4random.3

1
man/getmode.3 Normal file
View File

@@ -0,0 +1 @@
.so man3/setmode.3

1
man/strlcat.3 Normal file
View File

@@ -0,0 +1 @@
.so man3/strlcpy.3

View File

@@ -124,13 +124,13 @@
#define ELF_TARG_MACH EM_PPC #define ELF_TARG_MACH EM_PPC
#define ELF_TARG_CLASS ELFCLASS32 #define ELF_TARG_CLASS ELFCLASS32
#define ELF_TARG_DATA ELFDATA2MSG #define ELF_TARG_DATA ELFDATA2MSB
#elif defined(__powerpc64__) #elif defined(__powerpc64__)
#define ELF_TARG_MACH EM_PPC64 #define ELF_TARG_MACH EM_PPC64
#define ELF_TARG_CLASS ELFCLASS64 #define ELF_TARG_CLASS ELFCLASS64
#define ELF_TARG_DATA ELFDATA2MSG #define ELF_TARG_DATA ELFDATA2MSB
#elif defined(__sparc__) #elif defined(__sparc__)
@@ -163,7 +163,7 @@
#else #else
#define ELF_TARG_CLASS ELFCLASS32 #define ELF_TARG_CLASS ELFCLASS32
#endif #endif
#define ELF_TARG_DATA ELFDATA2MSG #define ELF_TARG_DATA ELFDATA2MSB
#else #else

View File

@@ -155,7 +155,7 @@ __aout_fdnlist(fd, list)
} }
symoff = N_SYMOFF(*exec); symoff = N_SYMOFF(*exec);
symsize = exec->a_syms; symsize = N_SYMSIZE(*exec);
stroff = symoff + symsize; stroff = symoff + symsize;
/* find the string table in our mmapped area */ /* find the string table in our mmapped area */