Browse Source

add routines to put number in buffer.

master
Felix von Leitner 20 years ago
parent
commit
504192c0f9
6 changed files with 42 additions and 0 deletions
  1. +5
    -0
      buffer.h
  2. +8
    -0
      buffer/buffer_put8long.c
  3. +8
    -0
      buffer/buffer_putlong.c
  4. +8
    -0
      buffer/buffer_putulong.c
  5. +8
    -0
      buffer/buffer_putxlong.c
  6. +5
    -0
      socket/socket_listen.c

+ 5
- 0
buffer.h View File

@ -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
- 0
buffer/buffer_put8long.c View File

@ -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
- 0
buffer/buffer_putlong.c View File

@ -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
- 0
buffer/buffer_putulong.c View File

@ -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
- 0
buffer/buffer_putxlong.c View File

@ -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
- 0
socket/socket_listen.c View File

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

Loading…
Cancel
Save