Browse Source

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

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

+ 8
- 1
array.h View File

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



+ 2
- 2
array/array_get.c View File

@@ -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
- 0
buffer.h View File

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



+ 1
- 0
byte.h View File

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



+ 1
- 0
case.h View File

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



+ 1
- 0
cdb.h View File

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



+ 1
- 0
cdb_make.h View File

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



+ 1
- 0
dns.h View File

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



+ 1
- 0
errmsg.h View File

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



+ 1
- 0
fmt.h View File

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



+ 1
- 0
iarray.h View File

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



+ 3
- 0
io.h View File

@@ -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
- 0
io_internal.h View File

@@ -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
- 0
iob.h View File

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



+ 1
- 0
iopause.h1 View File

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



+ 1
- 0
iopause.h2 View File

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



+ 1
- 0
ip4.h View File

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



+ 1
- 0
ip6.h View File

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



+ 1
- 0
mmap.h View File

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



+ 1
- 0
ndelay.h View File

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



+ 1
- 0
open.h View File

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



+ 1
- 0
openreadclose.h View File

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



+ 1
- 0
rangecheck.h View File

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



+ 1
- 0
safemult.h View File

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



+ 1
- 0
scan.h View File

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



+ 1
- 0
socket.h View File

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



+ 1
- 0
str.h View File

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



+ 1
- 0
stralloc.h View File

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



+ 1
- 0
tai.h View File

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



+ 1
- 0
taia.h View File

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



+ 1
- 0
textcode.h View File

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



+ 1
- 0
uint16.h View File

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



+ 1
- 0
uint32.h View File

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



+ 1
- 0
uint64.h View File

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



+ 1
- 0
va_narg.h View File

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