nyctergatis.com

Contact

Projects
Sysquake Remote Live
NME
PDF
Hike
Sudoku
GifBuilder
jpeglib for Palm OS
MySQL Client
Cross-GCC for Mac OS
NMEPluginTOC.c File Reference

NME optional plugin for table of contents in HTML. More...

#include "NMEPluginTOC.h"
#include <stdlib.h>

Go to the source code of this file.

Defines

#define isBlankOrEol(c)   ((c) == ' ' || (c) == '\t' || (c) == 10 || (c) == 13)
 Test if a character is a space, tab, cr or lf.

Functions

static void switchOutputFormatTOC (HookTOCData *hookData, NMEBoolean heading)
 Switch output on for titles and off for everything else.
static NMEErr parHookTOC (NMEInt level, NMEInt item, NMEBoolean enter, NMEConstText markup, NMEInt srcIndex, NMEInt srcLineNumber, NMEContext *context, void *data)
 Paragraph hook for TOC (switch output on for titles and off for everything else)
void NMESetTOCOutputFormat (NMEOutputFormat *f, HookTOCData *d)
 Set output format structure for TOC generation.
NMEErr NMEPluginTOC (NMEConstText name, NMEInt nameLen, NMEConstText data, NMEInt dataLen, NMEContext *context, void *userData)
 Plugin implementation for table of contents.

Detailed Description

NME optional plugin for table of contents in HTML.

Author:
Yves Piguet.

Definition in file NMEPluginTOC.c.


Function Documentation

NMEErr NMEPluginTOC ( NMEConstText  name,
NMEInt  nameLen,
NMEConstText  data,
NMEInt  dataLen,
NMEContext context,
void *  userData 
)

Plugin implementation for table of contents.

Parameters:
[in]nameplugin name, such as "toc"
[in]nameLenlength of name
[in]datadata text
[in]dataLenlength of data
[in,out]contextcurrent context
[in]userDatapointer passed from the parser, as specified in NMEPlugin
Returns:
error code (kNMEErrOk for success)
Test:
    << toc level
    >>

or

    << toc level1 level2
    >>

or

    << toc level1 level2 title
    >>

Definition at line 89 of file NMEPluginTOC.c.

void NMESetTOCOutputFormat ( NMEOutputFormat f,
HookTOCData d 
)

Set output format structure for TOC generation.

Parameters:
[in]faddress of output format structure, whose contents are filled
[out]dparagraph hook user data

Definition at line 80 of file NMEPluginTOC.c.

static NMEErr parHookTOC ( NMEInt  level,
NMEInt  item,
NMEBoolean  enter,
NMEConstText  markup,
NMEInt  srcIndex,
NMEInt  srcLineNumber,
NMEContext context,
void *  data 
) [static]

Paragraph hook for TOC (switch output on for titles and off for everything else)

Parameters:
[in]levelheading or list level (1 = topmost)
[in]itemlist item or heading counter
[in]enterTRUE when entering construct, FALSE when exiting
[in]markupnull-terminated string for initial markup ("p" for par, "*" for unnumbered list of any level, "//" for italic, "{{{" for preformatted)
[in]srcIndexcurrent index in source code
[in]srcLineNumbercurrent line number in source code
[in,out]contextcurrent context
[in,out]datavalue specific to the callback
Returns:
error code (kNMEErrOk for success)

Definition at line 31 of file NMEPluginTOC.c.

static void switchOutputFormatTOC ( HookTOCData hookData,
NMEBoolean  heading 
) [static]

Switch output on for titles and off for everything else.

Parameters:
[in,out]hookDatahook user data
[in]headingTRUE for heading start, FALSE for heading end

Definition at line 52 of file NMEPluginTOC.c.

Generated by Doxygen.
Copyright 2007-2013, Yves Piguet.
All rights reserved.