Better re-exporting of symbols from iolib.base
[iolib.git] / net.sockets / wrappers.lisp
blobed3c2733b6df411f755bda3c96365e5c04857eb4
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Wrappers for socket-related C macros.
4 ;;;
6 (in-package :net.sockets)
8 (c "#if defined(__linux__)")
9 (define "_XOPEN_SOURCE" 600)
10 (define "_LARGEFILE_SOURCE")
11 (define "_LARGEFILE64_SOURCE")
12 (define "_FILE_OFFSET_BITS" 64)
13 (c "#endif")
15 (include "stdlib.h")
16 (include "sys/socket.h")
18 (defwrapper* ("cmsg_space" %cmsg-space) ("unsigned" :unsigned-int)
19 ((data-size ("unsigned" :unsigned-int)))
20 "return CMSG_SPACE(data_size);")
22 (defwrapper* ("cmsg_len" %cmsg-len) ("unsigned" :unsigned-int)
23 ((data-size ("unsigned" :unsigned-int)))
24 "return CMSG_LEN(data_size);")
26 (defwrapper* ("cmsg_firsthdr" %cmsg-firsthdr) ("void*" :pointer)
27 ((msg ("struct msghdr*" :pointer)))
28 "return CMSG_FIRSTHDR(msg);")
30 (defwrapper* ("cmsg_data" %cmsg-data) ("void*" :pointer)
31 ((cmsg ("struct cmsghdr*" :pointer)))
32 "return CMSG_DATA(cmsg);")