Home | History | Annotate | Download | only in src
      1 /* Author: Dan Walsh
      2    Based on selinuxswig_python.i by James Athey
      3  */
      4 
      5 /* Never build rpm_execcon interface */
      6 #ifndef DISABLE_RPM
      7 #define DISABLE_RPM
      8 #endif
      9 
     10 %module selinux
     11 %{
     12 	#include "selinux/selinux.h"
     13 %}
     14 
     15 /* return a sid along with the result */
     16 %typemap(argout) (security_id_t * sid) {
     17 	if (*$1) {
     18                 %append_output(SWIG_NewPointerObj(*$1, $descriptor(security_id_t), 0));
     19 	}
     20 }
     21 
     22 %typemap(in,numinputs=0) security_id_t *(security_id_t temp) {
     23   $1 = &temp;
     24 }
     25 
     26 %typemap(in,noblock=1,numinputs=0) char ** (char * temp = 0) {
     27 	$1 = &temp;
     28 }
     29 %typemap(freearg,match="in") char ** "";
     30 %typemap(argout,noblock=1) char ** {
     31 	if (*$1) {
     32 		%append_output(SWIG_FromCharPtr(*$1));
     33 		freecon(*$1);
     34 	}
     35 }
     36 
     37 %typemap(in,noblock=1,numinputs=0) char ** (char * temp = 0) {
     38 	$1 = &temp;
     39 }
     40 %typemap(freearg,match="in") char ** "";
     41 %typemap(argout,noblock=1) char ** {
     42 	if (*$1) {
     43 		%append_output(SWIG_FromCharPtr(*$1));
     44 		free(*$1);
     45 	}
     46 }
     47 
     48 %include "selinuxswig.i"
     49