long overdue header cleanup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "buffer.h"
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
void buffer_init(buffer* b,ssize_t (*op)(),int fd,
|
||||
char* y,size_t ylen) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "buffer.h"
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
int buffer_init_allocbuf(buffer* b, ssize_t (*op)(), int fd, size_t ylen) {
|
||||
if (fd==-1) return -1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "buffer.h"
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
void buffer_init_free(buffer* b,ssize_t (*op)(),int fd,
|
||||
char* y,size_t ylen) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <unistd.h>
|
||||
#include <buffer.h>
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
int buffer_init_read(buffer* b, int fd, char* y,size_t ylen) {
|
||||
if (fd==-1) return -1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <unistd.h>
|
||||
#include "buffer.h"
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
int buffer_init_read_allocbuf(buffer* b, int fd, size_t ylen) {
|
||||
return buffer_init_allocbuf(b, read, fd, ylen);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "buffer.h"
|
||||
#include <mmap.h>
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
static ssize_t op() {
|
||||
return 0;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "buffer.h"
|
||||
#include <mmap.h>
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
void buffer_init_staticcontents_free(buffer* b, char* y, size_t len) {
|
||||
buffer_init_staticcontents(b, y, len);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <unistd.h>
|
||||
#include <buffer.h>
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
int buffer_init_write(buffer* b, int fd, char* y,size_t ylen) {
|
||||
if (fd==-1) return -1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <unistd.h>
|
||||
#include "buffer.h"
|
||||
#include <libowfat/buffer.h>
|
||||
|
||||
int buffer_init_write_allocbuf(buffer* b, int fd, size_t ylen) {
|
||||
return buffer_init_allocbuf(b, write, fd, ylen);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "buffer.h"
|
||||
#include <mmap.h>
|
||||
#include <libowfat/buffer.h>
|
||||
#include <libowfat/mmap.h>
|
||||
|
||||
static ssize_t op() {
|
||||
return 0;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 5)
|
||||
|
||||
#include "uint16.h"
|
||||
#include <libowfat/uint16.h>
|
||||
|
||||
int imult16( int16 a, int16 b, int16* c) { return !__builtin_mul_overflow(a,b,c); }
|
||||
|
||||
#else
|
||||
|
||||
#include "safemult.h"
|
||||
#include <libowfat/safemult.h>
|
||||
|
||||
int imult16(int16 a,int16 b,int16* c) {
|
||||
int32 x=(int32)a*b;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 5)
|
||||
|
||||
#include "uint32.h"
|
||||
#include <libowfat/uint32.h>
|
||||
|
||||
int imult32( int32 a, int32 b, int32* c) { return !__builtin_mul_overflow(a,b,c); }
|
||||
|
||||
#else
|
||||
|
||||
#include "safemult.h"
|
||||
#include <libowfat/safemult.h>
|
||||
|
||||
int imult32(int32 a,int32 b,int32* c) {
|
||||
int64 x=(int64)a*b;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 5)
|
||||
|
||||
#include "uint64.h"
|
||||
#include <libowfat/uint64.h>
|
||||
|
||||
int imult64( int64 a, int64 b, int64* c) { return !__builtin_mul_overflow(a,b,c); }
|
||||
|
||||
#else
|
||||
|
||||
#include "safemult.h"
|
||||
#include <libowfat/safemult.h>
|
||||
|
||||
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__ia64__) || defined(__powerpc64__) || defined(__alpha__) || defined(__mips64__) || defined(__sparc64__))
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <rangecheck.h>
|
||||
#include <safemult.h>
|
||||
#include <libowfat/rangecheck.h>
|
||||
#include <libowfat/safemult.h>
|
||||
|
||||
/* does an array of "elements" members of size "membersize" starting at
|
||||
* "arraystart" lie inside buf1[0..len-1]? */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <rangecheck.h>
|
||||
#include <libowfat/rangecheck.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* does an UTF-16 string starting at "ptr" lie in buf[0..len-1]? */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <rangecheck.h>
|
||||
#include <libowfat/rangecheck.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
/* does an UTF-32 string starting at "ptr" lie in buf[0..len-1]? */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <rangecheck.h>
|
||||
#include <libowfat/rangecheck.h>
|
||||
|
||||
/* does an ASCIIZ string starting at "ptr" lie in buf[0..len-1]? */
|
||||
int range_strinbuf(const void* buf,size_t len,const void* stringstart) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 5)
|
||||
|
||||
#include "uint16.h"
|
||||
#include <libowfat/uint16.h>
|
||||
|
||||
int umult16(uint16 a,uint16 b,uint16* c) { return !__builtin_mul_overflow(a,b,c); }
|
||||
|
||||
#else
|
||||
|
||||
#include "safemult.h"
|
||||
#include <libowfat/safemult.h>
|
||||
|
||||
int umult16(uint16 a,uint16 b,uint16* c) {
|
||||
unsigned long x=(unsigned long)a*b;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 5)
|
||||
|
||||
#include "uint32.h"
|
||||
#include <libowfat/uint32.h>
|
||||
|
||||
int umult32(uint32 a,uint32 b,uint32* c) { return !__builtin_mul_overflow(a,b,c); }
|
||||
|
||||
#else
|
||||
|
||||
#include "safemult.h"
|
||||
#include <libowfat/safemult.h>
|
||||
|
||||
int umult32(uint32 a,uint32 b,uint32* c) {
|
||||
unsigned long long x=(unsigned long long)a*b;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 5)
|
||||
|
||||
#include "uint64.h"
|
||||
#include <libowfat/uint64.h>
|
||||
|
||||
int umult64(uint64 a,uint64 b,uint64* c) { return !__builtin_mul_overflow(a,b,c); }
|
||||
|
||||
@@ -8,7 +8,7 @@ int umult64(uint64 a,uint64 b,uint64* c) { return !__builtin_mul_overflow(a,b,c)
|
||||
|
||||
#include "haveuint128.h"
|
||||
|
||||
#include "safemult.h"
|
||||
#include <libowfat/safemult.h>
|
||||
|
||||
#if defined(HAVE_UINT128)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifdef __MINGW32__
|
||||
#include "socket.h"
|
||||
#include <libowfat/socket.h>
|
||||
#include "windoze.h"
|
||||
|
||||
void __winsock_init(void) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "tai.h"
|
||||
#include <libowfat/tai.h>
|
||||
|
||||
void tai_add(struct tai *t,const struct tai *u,const struct tai *v)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <time.h>
|
||||
#include "tai.h"
|
||||
#include <libowfat/tai.h>
|
||||
|
||||
void tai_now(struct tai *t)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "tai.h"
|
||||
#include <libowfat/tai.h>
|
||||
|
||||
void tai_pack(char *s,const struct tai *t)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "tai.h"
|
||||
#include <libowfat/tai.h>
|
||||
|
||||
void tai_sub(struct tai *t,const struct tai *u,const struct tai *v)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "tai.h"
|
||||
#include <libowfat/tai.h>
|
||||
|
||||
void tai_uint(struct tai *t,unsigned int u)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "tai.h"
|
||||
#include <libowfat/tai.h>
|
||||
|
||||
void tai_unpack(const char *s,struct tai *t)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
/* XXX: breaks tai encapsulation */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
/* XXX: breaks tai encapsulation */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
double taia_approx(const struct taia *t)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
double taia_frac(const struct taia *t)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
/* XXX: breaks tai encapsulation */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
/* XXX: breaks tai encapsulation */
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
#ifdef __MINGW32__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
void taia_pack(char *s,const struct taia *t)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
/* XXX: breaks tai encapsulation */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
void taia_tai(const struct taia *ta,struct tai *t)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
/* XXX: breaks tai encapsulation */
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "taia.h"
|
||||
#include <libowfat/taia.h>
|
||||
|
||||
void taia_unpack(const char* s,struct taia* t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user