Browse Source

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

master
Felix von Leitner 11 years ago
parent
commit
d702d06774
  1. 9
      array.h
  2. 4
      array/array_get.c
  3. 1
      buffer.h
  4. 1
      byte.h
  5. 1
      case.h
  6. 1
      cdb.h
  7. 1
      cdb_make.h
  8. 1
      dns.h
  9. 1
      errmsg.h
  10. 1
      fmt.h
  11. 1
      iarray.h
  12. 3
      io.h
  13. 15
      io_internal.h
  14. 1
      iob.h
  15. 1
      iopause.h1
  16. 1
      iopause.h2
  17. 1
      ip4.h
  18. 1
      ip6.h
  19. 1
      mmap.h
  20. 1
      ndelay.h
  21. 1
      open.h
  22. 1
      openreadclose.h
  23. 1
      rangecheck.h
  24. 1
      safemult.h
  25. 1
      scan.h
  26. 1
      socket.h
  27. 1
      str.h
  28. 1
      stralloc.h
  29. 1
      tai.h
  30. 1
      taia.h
  31. 1
      textcode.h
  32. 1
      uint16.h
  33. 1
      uint32.h
  34. 1
      uint64.h
  35. 1
      va_narg.h

9
array.h

@ -1,6 +1,8 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef ARRAY_H
#define ARRAY_H
#include <stddef.h>
#include "uint64.h"
typedef struct {
@ -11,10 +13,12 @@ typedef struct {
/* p and allocated nonzero: array is allocated */
/* p and allocated zero: array is unallocated */
/* p zero and allocated < 0: array is failed */
size_t headroom; /* the actual pointer for free() and realloc() is p-headroom */
} array;
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);
int64 array_length(const array* const x,uint64 membersize);
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_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_unallocated(x) (array_bytes(x)==0)

4
array/array_get.c

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

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

1
byte.h

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

1
case.h

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

1
cdb.h

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

1
cdb_make.h

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

1
dns.h

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

1
errmsg.h

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

1
fmt.h

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

1
iarray.h

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

3
io.h

@ -1,3 +1,4 @@
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef 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. */
int64 io_receivefd(int64 sock);
int io_starteventloopthread(unsigned int threads);
typedef int64 (*io_write_callback)(int64 s,const void* buf,uint64 n);
/* used internally, but hey, who knows */

15
io_internal.h

@ -50,6 +50,9 @@ typedef struct {
#endif
} io_entry;
extern int io_multithreaded;
extern int io_sockets[2];
my_extern array io_fds;
my_extern uint64 io_wanted_fds;
my_extern array io_pollfds;
@ -92,4 +95,16 @@ int64 io_waituntil2(int64 milliseconds);
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)

1
iob.h

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

1
iopause.h1

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

1
iopause.h2

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

1
ip4.h

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

1
ip6.h

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

1
mmap.h

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

1
ndelay.h

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

1
open.h

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

1
openreadclose.h

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

1
rangecheck.h

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

1
safemult.h

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

1
scan.h

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

1
socket.h

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

1
str.h

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

1
stralloc.h

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

1
tai.h

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

1
taia.h

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

1
textcode.h

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

1
uint16.h

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

1
uint32.h

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

1
uint64.h

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

1
va_narg.h

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

Loading…
Cancel
Save