Changeset 2650

Show
Ignore:
Timestamp:
01/03/08 16:30:17 (1 year ago)
Author:
dhozac
Message:

Move WRITE_INT to util-io.h, so other programs can use it too.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib_internal/util-io.h

    r1954 r2650  
    2222#include <unistd.h> 
    2323#include <string.h> 
     24#include "ensc_fmt/fmt.h" 
    2425 
    2526inline static void UNUSED 
     
    3536} 
    3637 
     38inline static void UNUSED 
     39WRITE_INT(int fd, int num) 
     40{ 
     41  char   buf[sizeof(num)*3+2]; 
     42  size_t l; 
     43 
     44  l = utilvserver_fmt_long(buf,num); 
     45 
     46  Vwrite(fd, buf, l); 
     47} 
     48 
    3749#define WRITE_MSG(FD,X)         Vwrite(FD,X,sizeof(X)-1) 
    3850#define WRITE_STR(FD,X)         writeStr(FD,X) 
  • trunk/src/h2ext.c

    r2561 r2650  
    209209    buf[i] = tmp; 
    210210  } 
    211 } 
    212  
    213 static inline ALWAYSINLINE void 
    214 WRITE_INT(int fd, int num) 
    215 { 
    216   char   buf[sizeof(num)*3+2]; 
    217   size_t l; 
    218  
    219   l = utilvserver_fmt_long(buf,num); 
    220  
    221   Vwrite(fd, buf, l); 
    222211} 
    223212