Browse Source

remove superfluous #includes

make it possibly to specify that a buffer should be freed
master
Felix von Leitner 17 years ago
parent
commit
2e4bf41523
12 changed files with 28 additions and 32 deletions
  1. +0
    -1
      io/io_canread.c
  2. +0
    -1
      io/io_canwrite.c
  3. +0
    -4
      io/io_check.c
  4. +0
    -1
      io/io_fd.c
  5. +0
    -3
      io/io_tryreadtimeout.c
  6. +0
    -3
      io/io_trywritetimeout.c
  7. +0
    -4
      io/io_wait.c
  8. +1
    -4
      io/io_waituntil.c
  9. +1
    -11
      io/iob_addbuf.c
  10. +5
    -0
      io/iob_addbuf_free.c
  11. +15
    -0
      io/iob_addbuf_internal.c
  12. +6
    -0
      io/iob_adds_free.c

+ 0
- 1
io/io_canread.c View File

@ -1,6 +1,5 @@
#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"


+ 0
- 1
io/io_canwrite.c View File

@ -1,6 +1,5 @@
#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"


+ 0
- 4
io/io_check.c View File

@ -1,7 +1,3 @@
#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"
void io_check() {


+ 0
- 1
io/io_fd.c View File

@ -4,7 +4,6 @@
#undef extern
#include "byte.h"
#ifdef HAVE_SIGIO
#include <sys/poll.h>
#include <signal.h>
#include <fcntl.h>
#endif


+ 0
- 3
io/io_tryreadtimeout.c View File

@ -1,6 +1,3 @@
#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"


+ 0
- 3
io/io_trywritetimeout.c View File

@ -1,6 +1,3 @@
#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"


+ 0
- 4
io/io_wait.c View File

@ -1,7 +1,3 @@
#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"
void io_wait() {


+ 1
- 4
io/io_waituntil.c View File

@ -1,7 +1,3 @@
#include <unistd.h>
#include <sys/time.h>
#include <poll.h>
#include <errno.h>
#include "io_internal.h"
#include "safemult.h"
@ -12,5 +8,6 @@ void io_waituntil(tai6464 t) {
taia_sub(&diff,&t,&now);
if (!umult64(diff.sec.x,1000,&x) || (y=x+diff.nano/10000000)<x)
y=-1; /* overflow; wait indefinitely */
if (!y && diff.nano) y=1;
io_waituntil2(y);
}

+ 1
- 11
io/iob_addbuf.c View File

@ -1,15 +1,5 @@
#include "iob_internal.h"
int iob_addbuf(io_batch* b,const void* buf,uint64 n) {
iob_entry* e=array_allocate(&b->b,sizeof(iob_entry),
array_length(&b->b,sizeof(iob_entry)));
if (!e) return 0;
e->type=FROMBUF;
e->fd=-1;
e->buf=buf;
e->n=n;
e->offset=0;
b->bytesleft+=n;
++b->bufs;
return 1;
return iob_addbuf_internal(b,buf,n,0);
}

+ 5
- 0
io/iob_addbuf_free.c View File

@ -0,0 +1,5 @@
#include "iob_internal.h"
int iob_addbuf(io_batch* b,const void* buf,uint64 n) {
return iob_addbuf_internal(b,buf,n,1);
}

+ 15
- 0
io/iob_addbuf_internal.c View File

@ -0,0 +1,15 @@
#include "iob_internal.h"
int iob_addbuf_internal(io_batch* b,const void* buf,uint64 n,int _free) {
iob_entry* e=array_allocate(&b->b,sizeof(iob_entry),
array_length(&b->b,sizeof(iob_entry)));
if (!e) return 0;
e->type=_free?FROMBUF_FREE:FROMBUF;
e->fd=-1;
e->buf=buf;
e->n=n;
e->offset=0;
b->bytesleft+=n;
++b->bufs;
return 1;
}

+ 6
- 0
io/iob_adds_free.c View File

@ -0,0 +1,6 @@
#include "str.h"
#include "iob.h"
int iob_adds(io_batch* b,const char* s) {
return iob_addbuf_free(b,s,str_len(s));
}

Loading…
Cancel
Save