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
PASTE (3T) (AT&T UNIX PC only ) PASTE ( 3T ) Pb_empty empties the paste buffer file and closes it, It is intended to be called after the paste buffer file has been read, Pb_name returns a pointer to a static area containing the name of the paste buffer file. Pb_puts appends a null terminated text string to the paste buffer �, file in ADF format. It has the same interface as [puts . Pb_weof writes an end of file code to the paste buffer file, and closes the file. It is intended to be called after the paste buffer file has been written. Pb_gets reads the next string from the paste buffer file and converts it to text. It has the same interface as [g ets . Pb_gets always returns EOF after 511 bytes have been read. To read larger blocks of text, pb_gbuf must be used. Pb_gbuf reads a paste buffer file entry and converts it to text. It puts the results into the buffer passed to it. Pb_gbuf calls the passed function to store the buffer at the end of the paste entry, or when the buffer becomes full. When this function is called, it is passed the buffer address, and the number of bytes in the buffer. This function should return a negative value on error. If a NULL pointer is passed in place of the function, then pb_gbuf returns a null-terminated string, stored in the passed buffer. Note that pb_gbuf can only be called once, and the paste buffer file should be marked empty after the call. The three functions ad/_gtwrd, ad/_gtxcd, and ad/_gttok are utilities used by pb_gbuf to interpret the ADF format. Applications that wish to access the ADF formatted files directly might use them. ad/_gtwrd scans the input string pointed to by sptr and pulls out the next word. It stores this word (null-terminated) to the buffer pointed to by dptr, and returns an updated input pointer. Ad/_gtxcd pulls out the embedded text code from the input string pointed to by sptr , and also returns an updated input pointer. This text code is stored null-terminated in the buffer pointed to by dptr . Ad/_gtxcd should be called when a "\" is encountered in the input line in a text field, and sptr should be pointing to the character following the "\." Ad/_gttok converts a word (a null-terminated string) to a token (integer) and returns the token. The conversion is driven by the passed keyword table. The keyword table structure is defined in the include file pbf.h. EXAMPLE To implement the cut operation: paste_file = pb_open (); if (paste_file == NULL) message (MT_ERROR, "wp.hlp", "Paste", "Unable to open or create paste buffer file"); - 2-
PASTE ( 3T ) ( AT&T UNIX PC only ) PASTE ( 3T ) SEE ALSO else { chr = Enter; if (pb_check (paste_file )) { chr = message (MT_QUIT, "wp.hlp", "Paste", "Paste buffer contains an entry - \ do you wish to overwrite?"); } if (chr == Enter) { ... I* Paste file is empty, or is OK to *I ... /* overwrite, write the paste file using *I ... /* fwrite, fprintf, etc. } fclose (paste_file ); } To implement the paste operation: paste_file = pb_open (); if (paste_file == NULL) message (MT_ERROR, "wp.hlp", "Paste", "Unable to open or create paste buffer file"); else { if (pb_check (paste_file )) { /* Paste file exists and is non empty, *I I* Read the paste file using fread, *I /* fscanf, etc. } else message (MT_ERROR, "wp.hlp", "Paste", "Paste buffer is empty"); pb_empty (paste_file ); } adf(4), message(3T), tam(3T). DIAGNOSTICS Pb_open returns a NULL pointer on failure. Pb_gets returns a NULL pointer at end of file. Pb_puts returns EOF on failure. - 3-
- Page 893: LDFHREAD ( 3X ) LDFHREAD ( 3X ) NAM
- Page 897 and 898: LDLSEEK ( 3X ) LDLSEEK ( 3X ) NAME
- Page 899 and 900: LDOHSEEK ( 3X ) (not on PDP-11) LDO
- Page 901 and 902: LDOPEN{3X) LDOPEN { 3X) NAME ldopen
- Page 903 and 904: LDRSEEK ( 3X ) LDRSEEK ( 3X ) NAME
- Page 905: LDSHREAD ( 3X ) LDSHREAD ( 3X ) NAM
- Page 908 and 909: ,ry
- Page 910 and 911: � '"'"--
- Page 912 and 913: I!) r) ·--... .._ _ .. .
- Page 914 and 915: y I
- Page 916 and 917: LOCKF (3C) LOCKF (3C) F _LOCK and F
- Page 918 and 919: I� ' .... ._ .·
- Page 920 and 921: LSEARCH ( 3C ) LSEARCH ( 3C ) unsig
- Page 922 and 923: MALLOC (3C) MALLOC (3C) M_NLBLKS Se
- Page 924 and 925: MA THERR (3M) MATHERR (3M) } BESSEL
- Page 926 and 927: () . -�
- Page 928 and 929: MEMORY (3C} MEMORY (3C) Character m
- Page 930 and 931: MENU (3T) (AT&T UNIX PC only ) MENU
- Page 932 and 933: MENU (3T) (AT&T UNIX PC only ) mite
- Page 934 and 935: MENU (3T) (AT&T UNIX PC only ) FILE
- Page 936 and 937: MESSAGE ( 3T ) ( AT&T UNIX PC only
- Page 939: MONITOR ( 3C ) MONITOR ( 3C ) NAME
- Page 943: PASTE (3T) (AT&T UNIX PC only ) PAS
- Page 947: PERROR (3C) PERROR (3C) NAME perror
- Page 950 and 951: (� / I I I I I I I I I I I I I I
- Page 952 and 953: PRINTF (3S) PRINTF (3S) A field wid
- Page 955 and 956: PUTC ( 3S ) PUTC ( 3S ) NAME putc,
- Page 957: PUTENV (3C) PUTENV (3C) NAME putenv
- Page 960 and 961: ···- ·
- Page 962 and 963: I� ·-.---·
- Page 964 and 965: ' ' .} ' 1 . ' .____.,.:
- Page 966 and 967: � ·�
- Page 968 and 969: REGCMP {3X) REGCMP {3X) ( . . . ) P
- Page 970 and 971: SCANF(3S) u 0 X SCANF(3S) an unsign
- Page 973 and 974: � I SETBUF (3S) SETBUF (3S) NAME
- Page 975 and 976: SETJMP (3C) SETJMP ( 3C ) NAME setj
- Page 977 and 978: SINII ( 3M ) SINH ( 3M ) NAME sinh,
- Page 979 and 980: SLEEP (3C) SLEEP ( 3C ) NAME sleep
- Page 981: SPUTL ( 3X ) SPUTL ( 3X ) NAME sput
- Page 985: STDI0 ( 3S ) ( AT&T UNIX PC Only )
- Page 989 and 990: STRING ( 3C ) STRING (3C) NAME strc
- Page 991 and 992: STRTOD (3C) STRTOD (3C) NAME strtod
- Page 993: STRTOL ( 3C ) STRTOL ( 3C ) NAME st
PASTE ( 3T ) ( AT&T UNIX PC only ) PASTE ( 3T )<br />
SEE ALSO<br />
else<br />
{<br />
chr = Enter;<br />
if (pb_check (paste_file ))<br />
{<br />
chr = message (MT_QUIT, "wp.hlp", "Paste",<br />
"Paste buffer contains an entry - \ do you<br />
wish to overwrite?");<br />
}<br />
if (chr == Enter)<br />
{<br />
... I* Paste file is empty, or is OK to *I<br />
... /* overwrite, write the paste file using *I<br />
... /* fwrite, fprintf, etc.<br />
}<br />
fclose (paste_file );<br />
}<br />
To implement the paste 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 />
else<br />
{<br />
if (pb_check (paste_file ))<br />
{<br />
/* Paste file exists and is non empty, *I<br />
I* Read the paste file using fread, *I<br />
/* fscanf, etc.<br />
}<br />
else<br />
message (MT_ERROR, "wp.hlp", "Paste",<br />
"Paste buffer is empty");<br />
pb_empty (paste_file );<br />
}<br />
adf(4), message(3T), tam(3T).<br />
DIAGNOSTICS<br />
Pb_open returns a NULL pointer on failure. Pb_gets returns a<br />
NULL pointer at end of file. Pb_puts returns EOF on failure.<br />
- 3-