view interps/cfunge/cfunge-src/doc/fingerprintspecformat.txt @ 9071:581584df6d82

<fizzie> revert 942e964c81c1
author HackBot
date Sun, 25 Sep 2016 20:17:31 +0000
parents 859f9b4339e6
children
line wrap: on
line source

cfunge use a special file format to generate fingerprints from.
The format is quite simple. An example follows:

%fingerprint-spec 1.4
%fprint:TEST
%url:http://example.com/desc/test.html
%f109-uri:http://example.com/test
%condition:defined(HAVE_foo) && !defined(__FOOBAR)
%desc:This is a test of the fingerprint spec file system.
%safe:true
%alias:FOOO
%begin-instrs
# a comment
#I	name	desc
A	foobar	Description
B	quux	Other Description
%end

The first line should always be "%fingerprint-spec 1.4" (or in future versions,
possibly higher numbers).

Note:
 * The format is case sensitive.
 * Any lines after the first starting with a # is considered a comment.

After that fprint, url, desc, safe and alias can follow in any order.
 * fprint is the fingerprint name
 * url is the url for more info on the fingerprint (docs and such)
 * f109-uri is an optional Funge-109 URI for the fingerprint.
 * condition is an optional C preprocessor condition. If the line exists it will
   be used as an #if condition to enable or disable this fingerprint at compile
   time. It is up to you to make sure the condition is sane and valid C.
 * desc is a short one line description. Less than 60 chars is definitly
   recommended.
 * safe can be either true or false, true indicates it is safe in sandbox mode
   and false that it isn't.
 * alias is special because it is:
    * It is optional.
    * You can have several.
   alias allows a fingerprint to be known under several names. It's use is
   highly discouraged. If you really want to use it, you need to work out how
   by reading the code.

After that, to indicate that the instruction list begins, use %begin-instrs
The instruction list must be sorted and contain no duplicates.

Each line in this section consists of:
<instruction> whitespace <name for function> whitespace <short description>

 * Whitespace consists of one or more tabs and/or spaces.
 * The instruction must be in the range A-Z.
 * The name should be a valid name to use in a C function name (it is currently
   not sanity checked).
 * The description is a short string describing the fuction.

Finally there should be a line %end after the instruction list.
Any further lines are ignored (currently, but that may change).