english
version "1.0"
identify "xyz"

#: Copyright (c) 1997-2005 by Wayne C. Gramlich.
#, All rights reserved.

#: This procedure implements a "file descriptor set".  It is basically
#, a bit set that is constrained by the max. file descriptor number
#, allowed by the system.

module file_set

define file_set				#: A set of file descriptors
    external


#: {file_set} procedures:

procedure address_get@file_set
    takes
	file_set file_set
    returns address
    external file_set__address_get

    #: This procedure will return the {address} of {file_set}.



procedure and@file_set
    takes
	to_file_set file_set
	from_file_set1 file_set
	from_file_set2 file_set
    returns_nothing
    external file_set__and

    #: This procedure will store into {to_file_set} the result of bitwise
    #, AND'ing {from_file_set1} and {from_file_set2}.



procedure create@file_set
    takes_nothing
    returns file_set
    external file_set__create

    #: This procedure will create and return an empty {file_set} object.

    

procedure clear@file_set
    takes
	file_set file_set
    returns_nothing
    external file_set__clear

    #: This procedure will clear the contents of {file_set}.



procedure contents_copy@file_set
    takes
	to_file_set file_set
	from_file_set file_set
    returns_nothing
    external file_set__contents_copy

    #: This procedure will copy the file set in {from_file_set} to
    #, {to_file_set}.



procedure enter@file_set
    takes
	file_set file_set
	file_descriptor_number unsigned
    returns_nothing
    external file_set__enter

    #: This procedure will add {file_descriptor_number} to {file_set}.



procedure identical@file_set
    takes
	file_set1 file_set
	file_set2 file_set
    returns logical

    #: This procedure will return the {true}@{logical} if {file_set1}
    #, is identical to {file_set2} and {false} otherwise.


procedure is_in@file_set
    takes
	file_set file_set
	file_descriptor_number unsigned
    returns logical
    external file_set__is_in

    #: This procedure will return {true} if {file_descriptor_number}
    #, is in {file_set} and {false} otherwise.



procedure maximum@file_set
    takes
	file_set file_set
    returns integer
    external file_set__maximum

    #: This procedure will return the maximum file descriptor number
    #, in {file_set}.  If no file descriptor numbers are in {file_set},
    #, -1 is returned.



procedure maximum_possible@file_set
    takes_nothing
    returns unsigned
    external file_set__maximum_possible

    #: This procedure returns the maximum possible number that can be set
    #, in a {file_set} object



procedure print@file_set
    takes
	file_set file_set
	out_stream out_stream
    returns_nothing

    #: This procedure will print {file_set} to {out_stream}.


procedure remove@file_set
    takes
	file_set file_set
	file_descriptor_number unsigned
    returns_nothing
    external file_set__remove

    #: This procedure will remove {file_descriptor_number} from {file_set}.