Home | History | Annotate | Download | only in src
      1 /* Copyright (C) 2005 Red Hat, Inc. */
      2 
      3 #ifndef _SEMANAGE_DATABASE_JOIN_INTERNAL_H_
      4 #define _SEMANAGE_DATABASE_JOIN_INTERNAL_H_
      5 
      6 #include "database.h"
      7 #include "handle.h"
      8 
      9 #ifndef DBASE_RECORD_JOIN_DEFINED
     10 typedef void *record1_t;
     11 typedef void *record2_t;
     12 #define DBASE_RECORD_JOIN_DEFINED
     13 #endif
     14 
     15 struct dbase_join;
     16 typedef struct dbase_join dbase_join_t;
     17 
     18 /* JOIN extension to RECORD interface - method table */
     19 typedef struct record_join_table {
     20 
     21 	/* Join two records together.
     22 	 * One of the provided records could be NULL */
     23 	int (*join) (semanage_handle_t * handle,
     24 		     const record1_t * record1,
     25 		     const record2_t * record2, record_t ** result);
     26 
     27 	/* Splits a record into two */
     28 	int (*split) (semanage_handle_t * handle,
     29 		      const record_t * record,
     30 		      record1_t ** split1, record2_t ** split2);
     31 
     32 } record_join_table_t;
     33 
     34 /* JOIN - initialization */
     35 extern int dbase_join_init(semanage_handle_t * handle,
     36 			   record_table_t * rtable,
     37 			   record_join_table_t * rjtable,
     38 			   dbase_config_t * join1,
     39 			   dbase_config_t * join2, dbase_join_t ** dbase);
     40 
     41 /* FILE - release */
     42 extern void dbase_join_release(dbase_join_t * dbase);
     43 
     44 /* JOIN - method table implementation */
     45 extern dbase_table_t SEMANAGE_JOIN_DTABLE;
     46 
     47 #endif
     48