X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tests%2Ffile-socket.lisp;fp=tests%2Ffile-socket.lisp;h=0000000000000000000000000000000000000000;hb=bdb966b22ea563a7dfa1f464a1b6cb6d8b5a712c;hp=67fe8869a0aa3a044d633eb39a5c0b422ad9a50c;hpb=886f754686a07aea92089a3ffdc997836d69d9f3;p=uffi.git diff --git a/tests/file-socket.lisp b/tests/file-socket.lisp deleted file mode 100644 index 67fe886..0000000 --- a/tests/file-socket.lisp +++ /dev/null @@ -1,42 +0,0 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: file-socket.cl -;;;; Purpose: UFFI Example file to get a socket on a file -;;;; Programmer: Kevin M. Rosenberg -;;;; Date Started: Jul 2002 -;;;; -;;;; $Id: file-socket.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $ -;;;; -;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; -;;;; UFFI users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - -(in-package :cl-user) - -;; Values for linux -(uffi:def-constant PF_UNIX 1) -(uffi:def-constant SOCK_STREAM 1) - -(uffi:def-function ("socket" c-socket) - ((family :int) - (type :int) - (protocol :int)) - :returning :int) - -(uffi:def-function ("connect" c-connect) - ((sockfd :int) - (serv-addr :void-pointer) - (addr-len :int)) - :returning :int) - -(defun connect-to-file-socket (filename) - (let ((socket (c-socket PF_UNIX SOCK_STREAM 0))) - (if (plusp socket) - (let ((stream (c-connect socket filename (length filename)))) - stream) - (error "Unable to create socket"))))