Skip to content

File notation_plpath.c

FileList > note-plpath > src > notation_plpath.c

Go to the source code of this file

Notation module for PL paths. More...

  • #include "notation_plpath.h"
  • #include "notation_defs.h"
  • #include "tang_defs.h"
  • #include <stdio.h>
  • #include <float.h>
  • #include <string.h>
  • #include <errno.h>
  • #include <stdlib.h>
  • #include <stdbool.h>

Public Functions

Type Name
uint8_t note_plpath_decode (char * str, note_plpath_t * path)
Function to take a note_plpath_t and decode it as a string.
STATIC_INLINE char * note_plpath_dp_build_pt (char * str, note_plpath_point_t * point, const char * str_end)
Build a pointer object from start of the string.
STATIC_INLINE char * note_plpath_dp_move_nl (char * str, const char * str_end)
Strip new lines from the front of the input string.
STATIC_INLINE_UINT8 note_plpath_dp_process_str (char * str, note_plpath_t * path)
Process and input string into a new point.
STATIC_INLINE char * note_plpath_dp_strip_com (char * str, const char * str_end)
Strip a comment line from the input string.
STATIC_INLINE char * note_plpath_dp_strip_lws (char * str, const char * str_end)
Strip white space chars from the front of the input string.
uint8_t note_plpath_encode (note_plpath_t path, char * str, size_t buffer_size)
Function to take a string and decode it as a note_plpath_t . NOTE: This function modifies the input PATH. The input is normalized so all nodes have "forward" order. This does not change the topology.
STATIC_INLINE char * note_plpath_ep_insert_double (double new_double, char * str, const char * str_end)
Insert the base 10 string representation of a double into the output string.
STATIC_INLINE char * note_plpath_ep_writeseg (note_plpath_point_t * active_point, char * str, const char * str_end)
Convert a segment (connected component) of the PL path into a string.

Detailed Description

Author:

Joe Starr

Public Functions Documentation

function note_plpath_decode

Function to take a note_plpath_t and decode it as a string.

uint8_t note_plpath_decode (
    char * str,
    note_plpath_t * path
) 

Parameters:

Returns:

uint8_t The return code for the decoding operation.


function note_plpath_dp_build_pt

Build a pointer object from start of the string.

STATIC_INLINE char * note_plpath_dp_build_pt (
    char * str,
    note_plpath_point_t * point,
    const char * str_end
) 

Parameters:

  • str The start of the input string.
  • point A pointer to the new pointer object.
  • str_end The end of the input string.

Returns:

A pointer to the next char in the string after parsing the point. Alternatively a null pointer if something has gone wrong.


function note_plpath_dp_move_nl

Strip new lines from the front of the input string.

STATIC_INLINE char * note_plpath_dp_move_nl (
    char * str,
    const char * str_end
) 

Parameters:

  • str A pointer to the current location in the input string.
  • str_end The end of the input string.

Returns:

A pointer to the next char in the string after parsing the point. Alternatively a null pointer if something has gone wrong.


function note_plpath_dp_process_str

Process and input string into a new point.

STATIC_INLINE_UINT8 note_plpath_dp_process_str (
    char * str,
    note_plpath_t * path
) 

Parameters:

  • str The input string to process.
  • path The location to store the path.

Returns:

A status flag indicating the success or failure of the operation.


function note_plpath_dp_strip_com

Strip a comment line from the input string.

STATIC_INLINE char * note_plpath_dp_strip_com (
    char * str,
    const char * str_end
) 

Parameters:

  • str A pointer to the current location in the input string.
  • str_end The end of the input string.

Returns:

A pointer to the next char in the string after parsing the point. Alternatively a null pointer if something has gone wrong.


function note_plpath_dp_strip_lws

Strip white space chars from the front of the input string.

STATIC_INLINE char * note_plpath_dp_strip_lws (
    char * str,
    const char * str_end
) 

Parameters:

  • str A pointer to the current location in the input string.
  • str_end The end of the input string.

Returns:

A pointer to the next char in the string after parsing the point. Alternatively a null pointer if something has gone wrong.


function note_plpath_encode

Function to take a string and decode it as a note_plpath_t . NOTE: This function modifies the input PATH. The input is normalized so all nodes have "forward" order. This does not change the topology.

uint8_t note_plpath_encode (
    note_plpath_t path,
    char * str,
    size_t buffer_size
) 

Parameters:

Returns:

uint8_t The return code for the encoding operation.


function note_plpath_ep_insert_double

Insert the base 10 string representation of a double into the output string.

STATIC_INLINE char * note_plpath_ep_insert_double (
    double new_double,
    char * str,
    const char * str_end
) 

Parameters:

  • new_int A double to insert.
  • str A pointer of current index of the output string.
  • buffer_end A pointer to the end of the output string buffer.

Returns:

A pointer to the next char in the string after parsing the point. Alternatively a null pointer if something has gone wrong.


function note_plpath_ep_writeseg

Convert a segment (connected component) of the PL path into a string.

STATIC_INLINE char * note_plpath_ep_writeseg (
    note_plpath_point_t * active_point,
    char * str,
    const char * str_end
) 

Parameters:

  • active_point The start of the segment.
  • str A pointer to the current location in the output string.
  • str_end A pointer to the end of the output string.

Returns:

A pointer to the next char in the string after parsing the point. Alternatively a null pointer if something has gone wrong.



The documentation for this class was generated from the following file source/note-plpath/src/notation_plpath.c