for installed header files, add comment saying where they came from

master
leitner 15 years ago
parent 2cb6a12c92
commit 928bfe5c09

@ -1,6 +1,8 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef ARRAY_H #ifndef ARRAY_H
#define ARRAY_H #define ARRAY_H
#include <stddef.h>
#include "uint64.h" #include "uint64.h"
typedef struct { typedef struct {
@ -11,10 +13,12 @@ typedef struct {
/* p and allocated nonzero: array is allocated */ /* p and allocated nonzero: array is allocated */
/* p and allocated zero: array is unallocated */ /* p and allocated zero: array is unallocated */
/* p zero and allocated < 0: array is failed */ /* p zero and allocated < 0: array is failed */
size_t headroom; /* the actual pointer for free() and realloc() is p-headroom */
} array; } array;
void* array_allocate(array* x,uint64 membersize,int64 pos); void* array_allocate(array* x,uint64 membersize,int64 pos);
void* array_get(array* x,uint64 membersize,int64 pos); void* array_get(const array* const x,uint64 membersize,int64 pos);
void* array_start(const array* const x); void* array_start(const array* const x);
int64 array_length(const array* const x,uint64 membersize); int64 array_length(const array* const x,uint64 membersize);
int64 array_bytes(const array* const x); int64 array_bytes(const array* const x);
@ -30,6 +34,9 @@ void array_cats0(array* to,const char* from);
void array_cat0(array* to); void array_cat0(array* to);
void array_cate(array* to,const array* const from,int64 pos,int64 stop); void array_cate(array* to,const array* const from,int64 pos,int64 stop);
void array_shift(array* x,uint64 membersize,uint64 members);
void array_chop(array* x,uint64 membersize,uint64 members);
#define array_failed(x) (array_bytes(x)==-1) #define array_failed(x) (array_bytes(x)==-1)
#define array_unallocated(x) (array_bytes(x)==0) #define array_unallocated(x) (array_bytes(x)==0)

@ -15,11 +15,11 @@
(pos+1)*sizeof(t) bytes are initialized. (pos+1)*sizeof(t) bytes are initialized.
#endif #endif
void* array_get(array* x,uint64 membersize,int64 pos) { void* array_get(const array* const x,uint64 membersize,int64 pos) {
uint64 wanted; uint64 wanted;
if (__unlikely(pos+1<1)) return 0; if (__unlikely(pos+1<1)) return 0;
if (__unlikely(!umult64(membersize,pos,&wanted))) return 0; if (__unlikely(!umult64(membersize,pos,&wanted))) return 0;
if (__unlikely((int64)wanted >= x->allocated || wanted>=x->initialized)) return 0; if (__unlikely((int64)wanted >= x->allocated || wanted>=x->initialized)) return 0;
return x->p+pos*membersize; return (void*)(x->p+pos*membersize);
} }

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef BUFFER_H #ifndef BUFFER_H
#define BUFFER_H #define BUFFER_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef BYTE_H #ifndef BYTE_H
#define BYTE_H #define BYTE_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef CASE_H #ifndef CASE_H
#define CASE_H #define CASE_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef CDB_H #ifndef CDB_H
#define CDB_H #define CDB_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef CDB_MAKE_H #ifndef CDB_MAKE_H
#define CDB_MAKE_H #define CDB_MAKE_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef DNS_H #ifndef DNS_H
#define DNS_H #define DNS_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef ERRMSG_H #ifndef ERRMSG_H
#define ERRMSG_H #define ERRMSG_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef FMT_H #ifndef FMT_H
#define FMT_H #define FMT_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef IARRAY_H #ifndef IARRAY_H
#define IARRAY_H #define IARRAY_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef IO_H #ifndef IO_H
#define IO_H #define IO_H
@ -103,6 +104,8 @@ int io_passfd(int64 sock,int64 fd);
* process. Return sock if ok, -1 on error, setting errno. */ * process. Return sock if ok, -1 on error, setting errno. */
int64 io_receivefd(int64 sock); int64 io_receivefd(int64 sock);
int io_starteventloopthread(unsigned int threads);
typedef int64 (*io_write_callback)(int64 s,const void* buf,uint64 n); typedef int64 (*io_write_callback)(int64 s,const void* buf,uint64 n);
/* used internally, but hey, who knows */ /* used internally, but hey, who knows */

@ -50,6 +50,9 @@ typedef struct {
#endif #endif
} io_entry; } io_entry;
extern int io_multithreaded;
extern int io_sockets[2];
my_extern array io_fds; my_extern array io_fds;
my_extern uint64 io_wanted_fds; my_extern uint64 io_wanted_fds;
my_extern array io_pollfds; my_extern array io_pollfds;
@ -92,4 +95,16 @@ int64 io_waituntil2(int64 milliseconds);
void io_sigpipe(void); void io_sigpipe(void);
/* return next descriptor from io_wait that can be read from */
int64 io_canread_unlocked();
/* return next descriptor from io_wait that can be written to */
int64 io_canwrite_unlocked();
/* return next descriptor with expired timeout */
int64 io_timeouted_unlocked();
struct eventpacket {
int fd;
enum { CANREAD, CANWRITE, TIMEOUT } what;
};
#define debug_printf(x) #define debug_printf(x)

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef _IOB_H #ifndef _IOB_H
#define _IOB_H #define _IOB_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef IOPAUSE_H #ifndef IOPAUSE_H
#define IOPAUSE_H #define IOPAUSE_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef IOPAUSE_H #ifndef IOPAUSE_H
#define IOPAUSE_H #define IOPAUSE_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef IP4_H #ifndef IP4_H
#define IP4_H #define IP4_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef IP6_H #ifndef IP6_H
#define IP6_H #define IP6_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef MMAP_H #ifndef MMAP_H
#define MMAP_H #define MMAP_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef NDELAY_H #ifndef NDELAY_H
#define NDELAY_H #define NDELAY_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef OPEN_H #ifndef OPEN_H
#define OPEN_H #define OPEN_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef OPENREADCLOSE_H #ifndef OPENREADCLOSE_H
#define OPENREADCLOSE_H #define OPENREADCLOSE_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef RANGECHECK_H #ifndef RANGECHECK_H
#define RANGECHECK_H #define RANGECHECK_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef _SAFEMULT_H #ifndef _SAFEMULT_H
#define _SAFEMULT_H #define _SAFEMULT_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef SCAN_H #ifndef SCAN_H
#define SCAN_H #define SCAN_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef SOCKET_H #ifndef SOCKET_H
#define SOCKET_H #define SOCKET_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef STR_H #ifndef STR_H
#define STR_H #define STR_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef STRALLOC_H #ifndef STRALLOC_H
#define STRALLOC_H #define STRALLOC_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef TAI_H #ifndef TAI_H
#define TAI_H #define TAI_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef TAIA_H #ifndef TAIA_H
#define TAIA_H #define TAIA_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef TEXTCODE_H #ifndef TEXTCODE_H
#define TEXTCODE_H #define TEXTCODE_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef UINT16_H #ifndef UINT16_H
#define UINT16_H #define UINT16_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef UINT32_H #ifndef UINT32_H
#define UINT32_H #define UINT32_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef UINT64_H #ifndef UINT64_H
#define UINT64_H #define UINT64_H

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef _VA_NARG_H #ifndef _VA_NARG_H
#define _VA_NARG_H #define _VA_NARG_H

Loading…
Cancel
Save