Reciever
Author(s): Christian Giménez.Usage and interface
- Library usage:
:- use_module(library(pc_reciever)). - Exports:
- Other modules used:
- System library modules:
dynamic_rt, iso_byte_char. - Internal (engine) modules:
term_basic, arithmetic, atomic_basic, attributes, basic_props, basiccontrol, data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic, system_info, term_compare, term_typing, hiord_rt, debugger_support.
- System library modules:
Documentation on exports
The predicate is of type data.
The predicate is of type dynamic.
Usage: enter_recieved(+Char)
- Description: A dynamic predicate that is asserted(is t) iff it has recieved the 10 or 13 character first.
Next it is supposed to recieve another 10 or 13 if it have to finish reading, so it will be asserted the predicate enter_recieved_twice/0.
Read set_recieve_again/1 and recieve_again/0 for more information.
The predicate is of type dynamic.
Usage:
- Description: Read enter_recieved/0 for understanding what this predicate does.
Usage: recieve_request(+Stream,-L)
- Description: Is t iff what is recieved up to contiguous two enters(13 or 10 characters) from Stream is instantiated to L.
Usage: recieve_request2(+Stream,-L)
- Description: Auxiliary predicate for recieve_request/2, The idea is the same, but here it doesn't initialize the enter_recieved/0 and enter_recieved_twice/0 dynamic predicate into false.
Usage: set_recieve_again(+Char)
- Description: Is t iff Char is an enter and enter_recieved/0 is asserted, OR we have recieved two enter contiguous and enter_recieved_twice is asserted.
In other words, set if we have to recieve again so recieve_again/0 returs t or false accordingly.
Usage:
- Description: t iff we have to recieve another character, false in other case.
In other words, if we have recieved two enters, return false(we have to stop recieving!!!).
Usage: recieve_first_thing(+Stream,-X)
- Description: t iff we can recieve another character and match it in X from Stream. False if we are in big troubles!
Usage:
- Description: This is a test predicate, you must edit pc_reciever.pl and do the following:
- add the debug package if you want to use it.
- uncomment some lines marked inside the body of the predicate pc_recieved_prueba.
Remember to restore the file in its original state if you want to use it as usual.
Is t iff debugging the module, opening the n.txt text file and reading(or recieving) all the text file up to two enters is true as well. n.txt file can have this:
hola jorojojo para cuando joven? :P jaja :D sisi se terminó :)
Documentation on multifiles
The predicate is multifile.
The predicate is of type data.