pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
schemas.c File Reference
#include <crm_internal.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <libxml/relaxng.h>
#include <libxml/tree.h>
#include <libxml/xmlstring.h>
#include <libxslt/xslt.h>
#include <libxslt/transform.h>
#include <libxslt/security.h>
#include <libxslt/xsltutils.h>
#include <crm/common/schemas.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include "crmcommon_private.h"
#include <crm/common/xml_compat.h>
Include dependency graph for schemas.c:

Go to the source code of this file.

Macros

#define SCHEMA_ZERO   { .v = { 0, 0 } }
 
#define schema_strdup_printf(prefix, version, suffix)
 

Functions

const char * pcmk__highest_schema_name (void)
 
GList * pcmk__find_x_0_schema (void)
 
void pcmk__load_schemas_from_dir (const char *dir)
 
void pcmk__sort_schemas (void)
 
void pcmk__schema_init (void)
 
void pcmk__schema_cleanup (void)
 
GList * pcmk__get_schema (const char *name)
 
int pcmk__cmp_schemas_by_name (const char *schema1_name, const char *schema2_name)
 
bool pcmk__validate_xml (xmlNode *xml_blob, const char *validation, xmlRelaxNGValidityErrorFunc error_handler, void *error_handler_context)
 
bool pcmk__configured_schema_validates (xmlNode *xml)
 
int pcmk__update_schema (xmlNode **xml, const char *max_schema_name, bool transform, bool to_logs)
 Update CIB XML to latest schema that validates it.
 
int pcmk_update_configured_schema (xmlNode **xml)
 
int pcmk__update_configured_schema (xmlNode **xml, bool to_logs)
 Update XML from its configured schema to the latest major series.
 
GList * pcmk__schema_files_later_than (const char *name)
 
void pcmk__build_schema_xml_node (xmlNode *parent, const char *name, GList **already_included)
 
const char * pcmk__remote_schema_dir (void)
 
void pcmk__warn_if_schema_deprecated (const char *schema)
 
gboolean cli_config_update (xmlNode **xml, int *best_version, gboolean to_logs)
 

Macro Definition Documentation

◆ schema_strdup_printf

#define schema_strdup_printf ( prefix,
version,
suffix )
Value:
crm_strdup_printf(prefix "%u.%u" suffix, (version).v[0], (version).v[1])
uint32_t version
Definition remote.c:1
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1

Definition at line 36 of file schemas.c.

◆ SCHEMA_ZERO

#define SCHEMA_ZERO   { .v = { 0, 0 } }

Definition at line 34 of file schemas.c.

Function Documentation

◆ cli_config_update()

gboolean cli_config_update ( xmlNode ** xml,
int * best_version,
gboolean to_logs )
Deprecated
Do not use

Definition at line 1584 of file schemas.c.

◆ pcmk__build_schema_xml_node()

void pcmk__build_schema_xml_node ( xmlNode * parent,
const char * name,
GList ** already_included )

Definition at line 1528 of file schemas.c.

◆ pcmk__cmp_schemas_by_name()

int pcmk__cmp_schemas_by_name ( const char * schema1_name,
const char * schema2_name )

Definition at line 759 of file schemas.c.

◆ pcmk__configured_schema_validates()

bool pcmk__configured_schema_validates ( xmlNode * xml)

Definition at line 861 of file schemas.c.

◆ pcmk__find_x_0_schema()

GList * pcmk__find_x_0_schema ( void )

Definition at line 115 of file schemas.c.

◆ pcmk__get_schema()

GList * pcmk__get_schema ( const char * name)

Definition at line 732 of file schemas.c.

◆ pcmk__highest_schema_name()

const char * pcmk__highest_schema_name ( void )

Definition at line 101 of file schemas.c.

◆ pcmk__load_schemas_from_dir()

void pcmk__load_schemas_from_dir ( const char * dir)

Definition at line 453 of file schemas.c.

◆ pcmk__remote_schema_dir()

const char * pcmk__remote_schema_dir ( void )

Definition at line 1547 of file schemas.c.

◆ pcmk__schema_cleanup()

void pcmk__schema_cleanup ( void )

Definition at line 712 of file schemas.c.

◆ pcmk__schema_files_later_than()

GList * pcmk__schema_files_later_than ( const char * name)

Definition at line 1382 of file schemas.c.

◆ pcmk__schema_init()

void pcmk__schema_init ( void )

Definition at line 550 of file schemas.c.

◆ pcmk__sort_schemas()

void pcmk__sort_schemas ( void )

Definition at line 537 of file schemas.c.

◆ pcmk__update_configured_schema()

int pcmk__update_configured_schema ( xmlNode ** xml,
bool to_logs )

Update XML from its configured schema to the latest major series.

Parameters
[in,out]xmlXML to update
[in]to_logsIf false, certain validation errors will be sent to stderr rather than logged
Returns
Standard Pacemaker return code

Definition at line 1257 of file schemas.c.

◆ pcmk__update_schema()

int pcmk__update_schema ( xmlNode ** xml,
const char * max_schema_name,
bool transform,
bool to_logs )

Update CIB XML to latest schema that validates it.

Parameters
[in,out]xmlXML to update (may be freed and replaced after being transformed)
[in]max_schema_nameIf not NULL, do not update xml to any schema later than this one
[in]transformIf false, do not update xml to any schema that requires an XSL transform
[in]to_logsIf false, certain validation errors will be sent to stderr rather than logged
Returns
Standard Pacemaker return code

Definition at line 1144 of file schemas.c.

◆ pcmk__validate_xml()

bool pcmk__validate_xml ( xmlNode * xml_blob,
const char * validation,
xmlRelaxNGValidityErrorFunc error_handler,
void * error_handler_context )

Definition at line 825 of file schemas.c.

◆ pcmk__warn_if_schema_deprecated()

void pcmk__warn_if_schema_deprecated ( const char * schema)

Definition at line 1565 of file schemas.c.

◆ pcmk_update_configured_schema()

int pcmk_update_configured_schema ( xmlNode ** xml)

Definition at line 1242 of file schemas.c.