01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PASTE (3T) (AT&T UNIX PC only ) PASTE ( 3T )<br />

Pb_empty empties the paste buffer file and closes it, It is intended<br />

to be called after the paste buffer file has been read,<br />

Pb_name returns a pointer to a static area containing the name of<br />

the paste buffer file.<br />

Pb_puts appends a null terminated text string to the paste buffer �,<br />

file in ADF format. It has the same interface as [puts .<br />

Pb_weof writes an end of file code to the paste buffer file, and<br />

closes the file. It is intended to be called after the paste buffer file<br />

has been written.<br />

Pb_gets reads the next string from the paste buffer file and converts<br />

it to text. It has the same interface as [g ets . Pb_gets<br />

always returns EOF after 511 bytes have been read. To read<br />

larger blocks of text, pb_gbuf must be used.<br />

Pb_gbuf reads a paste buffer file entry and converts it to text. It<br />

puts the results into the buffer passed to it. Pb_gbuf calls the<br />

passed function to store the buffer at the end of the paste entry,<br />

or when the buffer becomes full. When this function is called, it is<br />

passed the buffer address, and the number of bytes in the buffer.<br />

This function should return a negative value on error.<br />

If a NULL pointer is passed in place of the function, then<br />

pb_gbuf returns a null-terminated string, stored in the passed<br />

buffer. Note that pb_gbuf can only be called once, and the paste<br />

buffer file should be marked empty after the call.<br />

The three functions ad/_gtwrd, ad/_gtxcd, and ad/_gttok are utilities<br />

used by pb_gbuf to interpret the ADF format. Applications<br />

that wish to access the ADF formatted files directly might use<br />

them.<br />

ad/_gtwrd scans the input string pointed to by sptr and pulls out<br />

the next word. It stores this word (null-terminated) to the buffer<br />

pointed to by dptr, and returns an updated input pointer.<br />

Ad/_gtxcd pulls out the embedded text code from the input string<br />

pointed to by sptr , and also returns an updated input pointer.<br />

This text code is stored null-terminated in the buffer pointed to by<br />

dptr . Ad/_gtxcd should be called when a "\" is encountered in<br />

the input line in a text field, and sptr should be pointing to the<br />

character following the "\."<br />

Ad/_gttok converts a word (a null-terminated string) to a token<br />

(integer) and returns the token. The conversion is driven by the<br />

passed keyword table. The keyword table structure is defined in<br />

the include file pbf.h.<br />

EXAMPLE<br />

To implement the cut operation:<br />

paste_file = pb_open ();<br />

if (paste_file == NULL)<br />

message (MT_ERROR, "wp.hlp", "Paste",<br />

"Unable to open or create paste buffer file");<br />

- 2-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!