Create A New Program

fml 8 tutorial
Prev |  | Next

# Chapter 30. Create A New Program

# Create A Program (CUI)

Firstly, prepare a new module in FML::Process class. See FML::Process::Calendar as the least functional model and see FML::Process::Distribute for the most complicated class.

See FML::Process::Flow::ProcessStart() for mandatory methods to implement. FML::Process::Flow::ProcessStart() kicks off several methods sequentially. At 2002/07, these methods are mandatory.

    new()
    prepare()
    verify_request()
    run()
    finish()

            FML::Process::Kernel
                    |       uses-a FML::Process::{Flow,Utils} FML::Parse ...
                    |
                    A
            FML::Process::MODULE
                            uses-a FML::Something
                            uses-a CPAN module
                            uses-a ...

If you have prepared FML::Process::MODULE, define relation between the program name and the module at fml/etc/modules. Also, define available command line options at fml/etc/command_line_options if needed.

After it is prepared, symlink the loader and the new program name. For example,

    % ls -l /usr/local/libexec/fml
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 command@ -> loader
    drwxr-xr-x  2 root  wheel   512 Apr 14 18:25 current-20030414/
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 digest@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 distribute@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 error@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fml@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fml.pl@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fmladdr@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fmlalias@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fmlconf@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fmldoc@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fmlhtmlify@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fmlsch@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 fmlserv@ -> loader
    -rwxr-xr-x  1 root  wheel  6863 Apr 14 18:24 loader*
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 makefml@ -> loader
    lrwxr-xr-x  1 root  wheel     6 Apr 14 18:25 mead@ -> loader

As a test, you symlink it explicitly. For the canonical programs, fml installer symlinks them according to fml/etc/install.cf. You need to define the program as $bin_programs or $exec_programs in install.cf.in (configure generates install.cf).

Prev | Home | Next
Recipes | Up | Create A Program (CGI)

fml 8.0 (fml-devel) project homepage is www.fml.org/software/fml8/.
fml 4.0 project homepage is www.fml.org/software/fml4/.
about one floppy bsd routers, see www.bsdrouter.org/.
other free softwares are found at www.fml.org/software/.

author's homepage is www.fml.org/home/fukachan/.
Also, visit nuinui's world :) at www.nuinui.net.

For questions about FML, e-mail <fml-bugs@fml.org>.