Browse Source

add routines to put number in buffer.

master
Felix von Leitner 21 years ago
parent
commit
504192c0f9
  1. 5
      buffer.h
  2. 8
      buffer/buffer_put8long.c
  3. 8
      buffer/buffer_putlong.c
  4. 8
      buffer/buffer_putulong.c
  5. 8
      buffer/buffer_putxlong.c
  6. 5
      socket/socket_listen.c

5
buffer.h

@ -47,6 +47,11 @@ extern void buffer_seek(buffer* b,unsigned int len);
extern int buffer_copy(buffer* out,buffer* in);
int buffer_putulong(buffer *b,unsigned long l);
int buffer_put8long(buffer *b,unsigned long l);
int buffer_putxlong(buffer *b,unsigned long l);
int buffer_putlong(buffer *b,unsigned long l);
extern buffer *buffer_0;
extern buffer *buffer_0small;
extern buffer *buffer_1;

8
buffer/buffer_put8long.c

@ -0,0 +1,8 @@
#include "buffer.h"
#include "fmt.h"
int buffer_put8long(buffer *b,unsigned long l) {
char buf[FMT_8LONG];
return buffer_put(b,buf,fmt_8long(buf,l));
}

8
buffer/buffer_putlong.c

@ -0,0 +1,8 @@
#include "buffer.h"
#include "fmt.h"
int buffer_putlong(buffer *b,unsigned long l) {
char buf[FMT_ULONG];
return buffer_put(b,buf,fmt_long(buf,l));
}

8
buffer/buffer_putulong.c

@ -0,0 +1,8 @@
#include "buffer.h"
#include "fmt.h"
int buffer_putulong(buffer *b,unsigned long l) {
char buf[FMT_ULONG];
return buffer_put(b,buf,fmt_ulong(buf,l));
}

8
buffer/buffer_putxlong.c

@ -0,0 +1,8 @@
#include "buffer.h"
#include "fmt.h"
int buffer_putxlong(buffer *b,unsigned long l) {
char buf[FMT_XLONG];
return buffer_put(b,buf,fmt_xlong(buf,l));
}

5
socket/socket_listen.c

@ -0,0 +1,5 @@
#include <sys/socket.h>
int socket_listen(int s,unsigned int backlog) {
return listen(s, backlog);
}
Loading…
Cancel
Save