#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <unistd.h>
#include <cmml.h>
Defines | |
#define | DEFAULT_DURATION "00:30" |
#define | DEFAULT_ENCODING "UTF-8" |
#define | DEFAULT_SHORT_COMMAND "fortune -s -n 80" |
#define | DEFAULT_LONG_COMMAND "fortune -l" |
#define | BUFSIZE 10000 |
Functions | |
void | PrintUsage (char *prog) |
char * | get_fortune (char *command) |
int | main (int argc, char *argv[]) |
Usage: cmml-fortune [options] Generate a random CMML file using an external program to provide text (fortune cookies by default). Possible options: -d timespec, --duration timespec Specify the duration of the generated CMML file ('00:30' by default) -e encoding, --encoding encoding Specify the encoding of the generated CMML file ('UTF-8' by default) -o filename, --output filename Specify the output filename. The file is written to standard output by default. -s command, --short-command command Specify the command to use to generate short text for the title and anchors ('fortune -s -n 80' by default) -l command, --long-command command Specify the command to use to generate long text for descriptions ('fortune -l' by default) -h, --help Display this help and exit -v, --version Display version information and exit
|
DEFAULT_DURATION: default duration of created CMML file |
|
DEFAULT_ENCODING: default encoding format of created CMML file |
|
DEFAULT_SHORT_COMMAND: default command to create short descriptions |
|
DEFAULT_LONG_COMMAND: default command to create long descriptions |
|
BUFSIZE: default buffer size for printing |
|
PrintUsage: prints out help on how to use this program
|
|
get_fortune: generates random text using the given command
|
|
main function of cmml-fortune, which opens the CMML file, seeks to any given offsets, registers the callbacks, and then steps through the file in chunks of BUFSIZE size, during which the callbacks get activated as the relevant elements get parsed. |