Table of Contents

Name

get_history, put_history, app_history , ask_history, reset_history, ask_headline, set_headline - data history utilities

Synopsis


#include <history.h>get_history(instr)put_history(outstr)app_history (s)string
*ask_history()reset_history()
void set_headline(s)string ask_headline()
stream
instr, outstr;string s;

Description

history is a general mechanism to keep track of data history, and also store random user-supplied comments to data in filestruct(5NEMO) format. One history database at a time can be managed, history from a file can be added to this, and it can be written out to a file. Whenever a NEMO command is run, the history is initialized with the actual command line supplied. History from datafiles can be appended to this.

get_history() appends history from a file instr (assumed to be in filestruct(5NEMO) format) to the internal history buffer. This is usually one of the first things a program should do before other input is attempted, as the data history is normally prepended to the data.

A program can add (append) arbitrary history by calling app_history(), where s points to the string to be added.

put_history() writes the current history to an output file outstr. If any headline had been set, it will also be written.

ask_history() returns a pointer to a NULL terminated array of strings that contain the full history status.

set_headline() is an old way to add user supplied to the history database. Only one string can be hold here. It is added to the data history when put_history is called.

ask_headline() returns the headline string, which would be output

Filestruct Format

History items are character strings with tagname History, headline items are character strings with tagname Headline. They are both treated equal: if a headline is present, it is also written via put_history.

Files


~/src/kernel/io       history.[ch]
~/inc                    history.h

See Also

getparam(3NEMO) , tsf(1NEMO) , rsf(3NEMO)

Author

Peter Teuben

Update History


9-mar-88    V1.0 created        Peter Teuben
1-jun-88    V1.1 adapted to new filestruct, renamed names    PJT
14-jun-88    V1.3 integrate at IAS, changed _hist to _history    JEB
9-oct-90    V1.8b upgraded manual page    PJT
7-may-92    V1.9 documented name change add_ to app_    PJT


Table of Contents