File: database_file.h

package info (click to toggle)
android-platform-external-libselinux 10.0.0%2Br36-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 34,176 kB
  • sloc: ansic: 147,112; python: 25,790; makefile: 1,930; yacc: 1,389; sh: 1,206; lex: 452; xml: 180
file content (43 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Copyright (C) 2005 Red Hat, Inc. */

#ifndef _SEMANAGE_DATABASE_FILE_INTERNAL_H_
#define _SEMANAGE_DATABASE_FILE_INTERNAL_H_

#include <stdio.h>
#include "database.h"
#include "parse_utils.h"
#include "handle.h"

struct dbase_file;
typedef struct dbase_file dbase_file_t;

/* FILE extension to RECORD interface - method table */
typedef struct record_file_table {

	/* Fill record structuure based on supplied parse info.
	 * Parser must return STATUS_NODATA when EOF is encountered.
	 * Parser must handle NULL file stream correctly */
	int (*parse) (semanage_handle_t * handle,
		      parse_info_t * info, record_t * record);

	/* Print record to stream */
	int (*print) (semanage_handle_t * handle,
		      record_t * record, FILE * str);

} record_file_table_t;

/* FILE - initialization */
extern int dbase_file_init(semanage_handle_t * handle,
			   const char *path_ro,
			   const char *path_rw,
			   record_table_t * rtable,
			   record_file_table_t * rftable,
			   dbase_file_t ** dbase);

/* FILE - release */
extern void dbase_file_release(dbase_file_t * dbase);

/* FILE - method table implementation */
extern dbase_table_t SEMANAGE_FILE_DTABLE;

#endif