Loading...
Searching...
No Matches
oscap_source.h
/*
* Copyright 2014 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Šimon Lukašík
*/
#ifndef OSCAP_SOURCE_H
#define OSCAP_SOURCE_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stddef.h>
#include "oscap.h"
#include "oscap_export.h"
struct oscap_source;
OSCAP_API struct oscap_source *oscap_source_new_from_file(const char *filepath);
OSCAP_API struct oscap_source *oscap_source_new_from_memory(const char *buffer, size_t size, const char *filepath);
OSCAP_API struct oscap_source *oscap_source_clone(struct oscap_source *old);
OSCAP_API void oscap_source_free(struct oscap_source *source);
OSCAP_API void oscap_source_free_xmlDoc(struct oscap_source *source);
OSCAP_API const char *oscap_source_get_filepath(struct oscap_source *source);
OSCAP_API oscap_document_type_t oscap_source_get_scap_type(struct oscap_source *source);
OSCAP_API const char *oscap_source_get_schema_version(struct oscap_source *source);
OSCAP_API int oscap_source_validate(struct oscap_source *source, xml_reporter reporter, void *user);
OSCAP_API int oscap_source_validate_schematron(struct oscap_source *source);
OSCAP_API const char *oscap_source_readable_origin(const struct oscap_source *source);
OSCAP_API int oscap_source_save_as(struct oscap_source *source, const char *filename);
OSCAP_API int oscap_source_to_fd(struct oscap_source *source, int fd);
OSCAP_API int oscap_source_get_raw_memory(struct oscap_source *source, char **buffer, size_t *size);
#endif
oscap_document_type_t
enum oscap_document_type oscap_document_type_t
SCAP document type identifiers.
oscap.h
General OpenScap functions and types.
oscap_source
Definition oscap_source.c:66
oscap_source::oscap_source_validate_schematron
OSCAP_API int oscap_source_validate_schematron(struct oscap_source *source)
Validate the SCAP document against schematron assertions.
Definition oscap_source.c:369
oscap_source::oscap_source_save_as
OSCAP_API int oscap_source_save_as(struct oscap_source *source, const char *filename)
Store the resource represented by oscap_source to the file.
Definition oscap_source.c:434
oscap_source::oscap_source_get_filepath
OSCAP_API const char * oscap_source_get_filepath(struct oscap_source *source)
Get filepath of the given resource.
Definition oscap_source.c:208
oscap_source::oscap_source_get_scap_type
OSCAP_API oscap_document_type_t oscap_source_get_scap_type(struct oscap_source *source)
Get SCAP document type of the given resource.
Definition oscap_source.c:190
oscap_source::oscap_source_readable_origin
OSCAP_API const char * oscap_source_readable_origin(const struct oscap_source *source)
Returns human readable description of oscap_source origin.
Definition oscap_source.c:169
oscap_source::filepath
char * filepath
Filepath (if originated from file).
Definition oscap_source.c:71
oscap_source::oscap_source_to_fd
OSCAP_API int oscap_source_to_fd(struct oscap_source *source, int fd)
Store the resource represented by oscap_source to the file descriptor.
Definition oscap_source.c:446
oscap_source::oscap_source_get_schema_version
OSCAP_API const char * oscap_source_get_schema_version(struct oscap_source *source)
Get the version of the schema for the particular document type.
Definition oscap_source.c:385
oscap_source::oscap_source_validate
OSCAP_API int oscap_source_validate(struct oscap_source *source, xml_reporter reporter, void *user)
Validate the SCAP document against particular XML schema definition.
Definition oscap_source.c:345
reporter
Definition reporter.c:31