ext/jail.h
changeset 6 2d52adc4adcc
child 7 4460fc10c6a3
equal deleted inserted replaced
5:41a1542b3b10 6:2d52adc4adcc
       
     1 /*
       
     2  *  jail.h - Header for the ruby jail extension
       
     3  *
       
     4  *  vim: set nosta noet ts=4 sw=4:
       
     5  *
       
     6  *  $Id$
       
     7  *  
       
     8  *  Authors:
       
     9  *    * Michael Granger <ged@FaerieMUD.org>
       
    10  *    * Mahlon E. Smith <mahlon@martini.nu>
       
    11  *  
       
    12  *  Copyright (c) 2008, Michael Granger and Mahlon Smith
       
    13  *  All rights reserved.
       
    14  *  
       
    15  *  Redistribution and use in source and binary forms, with or without
       
    16  *  modification, are permitted provided that the following conditions are met:
       
    17  *  
       
    18  *    * Redistributions of source code must retain the above copyright notice,
       
    19  *      this list of conditions and the following disclaimer.
       
    20  *  
       
    21  *    * Redistributions in binary form must reproduce the above copyright notice,
       
    22  *      this list of conditions and the following disclaimer in the documentation
       
    23  *      and/or other materials provided with the distribution.
       
    24  *  
       
    25  *    * Neither the name of the author/s, nor the names of the project's
       
    26  *      contributors may be used to endorse or promote products derived from this
       
    27  *      software without specific prior written permission.
       
    28  *  
       
    29  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
       
    30  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
       
    31  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
       
    32  *  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
       
    33  *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
       
    34  *  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
       
    35  *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
       
    36  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
       
    37  *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
       
    38  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       
    39  *  
       
    40  */
       
    41 
       
    42 #ifndef _BSDJAIL_H_
       
    43 #define _BSDJAIL_H_
       
    44 
       
    45 #include "ruby.h"
       
    46 
       
    47 #include <stdio.h>
       
    48 #include <sys/param.h>
       
    49 #include <sys/jail.h>
       
    50 #include <sys/types.h>
       
    51 #include <sys/sysctl.h>
       
    52 #include <unistd.h>
       
    53 #include <arpa/inet.h>
       
    54 #include <errno.h>
       
    55 
       
    56 
       
    57 /* Debugging functions/macros */
       
    58 #ifdef HAVE_STDARG_PROTOTYPES
       
    59 #include <stdarg.h>
       
    60 #define va_init_list(a,b) va_start(a,b)
       
    61 extern void rbjail_debug(const char *fmt, ...);
       
    62 #else
       
    63 #include <stdargs.h>
       
    64 #define va_init_list(a,b) va_start(a)
       
    65 extern void rbjail_debug(fmt, va_alist);
       
    66 #endif
       
    67 
       
    68 
       
    69 /* Debugging macro */
       
    70 #if DEBUG
       
    71 #  define debugMsg(f)	rbjail_debug f
       
    72 #else /* ! DEBUG */
       
    73 #  define debugMsg(f) 
       
    74 #endif /* DEBUG */
       
    75 
       
    76 
       
    77 #endif /* _BSDJAIL_H_ */
       
    78