PreviousUpNext

15.3.483  src/lib/std/src/nj/at.api

## at.api

# Compiled by:
#     src/lib/std/src/standard-core.sublib



#

# at initialization or termination time.  We define five distinct contexts
# for a hook:
#
#       FORK_TO_DISK    just prior to exporting a heap image (fork_to_disk).
#       SPAWN_TO_DISK   exit because of spawn_to_disk.
#       SHUTDOWN                normal program exit.
#       STARTUP         initialization of a program that was generated by fork_to_disk.
#       APP_STARTUP     initialization of a program that was generated by spawn_to_disk.




###                   "The man who is a pessimist before forty-eight knows too much;
###                     if he is an optimist after it, he knows too little."
###
###                                               -- Mark Twain


api At {

    When
        = FORK_TO_DISK
        | SPAWN_TO_DISK
        | SHUTDOWN
        | STARTUP
        | APP_STARTUP;

    all:  List( When );
        #  At all times 

    #  Add a named at-function.
    #  This returns the previous definition, or NULL:
    #
    schedule
        :
        ( String,               # Arbitrary string label for at-function.
          List( When ),         # Times at which to execute it.
          When -> Void          # The function itself.
        )
        ->
        Null_Or ((List( When ), (When -> Void)));

    # Remove and return the named at-function.
    # Return NULL if it is not found:
    #
    deschedule
        :
        String
        ->
        Null_Or ((List( When ), When -> Void));

    # Run the at-functions for the specified time.
    #
    # NB: This function should only be called if you
    #     really know what you are doing!!
    #
    run_functions_scheduled_to_run:  When -> Void;

}; #  At




## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2012,
## released under Gnu Public Licence version 3.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext