libacfutils
A general purpose library of utility functions designed to make it easier to develop addons for the X-Plane flight simulator.
Loading...
Searching...
No Matches
Functions
acf_file.h File Reference
#include <stdint.h>
#include "types.h"
Include dependency graph for acf_file.h:

Go to the source code of this file.

Functions

acf_file_t * acf_file_read (const char *filename)
 
void acf_file_free (acf_file_t *acf)
 
const char * acf_prop_find (const acf_file_t *acf, const char *prop_path)
 
int acf_file_get_version (const acf_file_t *acf)
 

Detailed Description

This module contains functionality to parse and traverse X-Plane .acf files. This can be used to interrogate aircraft properties, as well as to read physics model shape outlines.

See also
acf_file_read()
acf_prop_find()

Definition in file acf_file.h.

Function Documentation

◆ acf_file_free()

void acf_file_free ( acf_file_t *  acf)

Frees the structured returned by acf_file_read().

Definition at line 157 of file acf_file.c.

◆ acf_file_get_version()

int acf_file_get_version ( const acf_file_t *  acf)

Returns the version number of an ACF file read by acf_file_read().

Definition at line 197 of file acf_file.c.

◆ acf_file_read()

acf_file_t * acf_file_read ( const char *  filename)

Reads an X-Plane .acf file and returns a structure which can be used to access its properties.

Parameters
filenameA full path to the .acf file to read.
Returns
A constructed .acf file in an accessible structure, or NULL on error. The exact error is emitted via logMsg.
See also
acf_prop_find()
acf_file_get_version()

Definition at line 71 of file acf_file.c.

◆ acf_prop_find()

const char * acf_prop_find ( const acf_file_t *  acf,
const char *  prop_path 
)

Locates a property in a parsed .acf file and returns its contents.

Parameters
acfThe parsed acf file structure.
prop_pathA nul-terminated string containing the full path of the property in the acf file.
Returns
A pointer to a nul-terminated string containing the value of the property if found, or NULL if the property doesn't exist in the acf file.

Definition at line 183 of file acf_file.c.