Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

SETBUF(3S)

��������
setbuf, setvbuf - ���������� ������� ��� ������

���������

	#include <stdio.h>
	
	void setbuf (stream, buf)
	FILE *stream;
	char *buf;
	
	void setvbuf (stream, buf, type, size)
	FILE *stream;
	char *buf;
	int type, size;

��������
������� setbuf ����� ���� ������������ ����� �������� ������, �� ����� ���, ��� ��������� ������ �� �������� �����/������. ��� ���� ������, �� ������� ��������� �������� buf, ����� �������������� ������ ������������� ����������� �������. ���� �������� buf ����� NULL, ����/����� ����� ��������� ����������������.

��������� ������ ������ ������������ ���������� BUFSIZ, �������� �� ���������� ����� <stdio.h>:

	char buf [BUFSIZ];

������� setvbuf ����� ����� ���� ������������ ����� ����� �������� ������, �� ����� ���, ��� ��������� ������ �� �������� �����/������. �������� type ���������� ��� �����������. ��������� ��������� ���� �����������, ��������� � <stdio.h>:

_IOFBF
������ ����������� �����/������.

_IOLBF
�������� ����������� ������; ����� ������ ������������� ��� ������ ������� �������� ������, ���������� ������ ��� ������� �� ����.

_IONBF
������ ���������� ����������� �����/������.

���� �������� buf �� ����� NULL, ������, �� ������� ��������� buf, ����� �������������� ������ ������������� ����������� �������. �������� size ������ ������ ������������� ������. ��������� BUFSIZ, ������������ �� ���������� ����� <stdio.h>, �������� �������� ��������� ��� ������� ������. ���� ����/����� �������������, �� ��������� buf � size ������������.

�� ��������� ����� �� �������� �������� ������� ��������������, � ���� ��������� ����/����� ������������ ���������.

��. �����
fopen(3S), getc(3S), malloc(3C), putc(3S), stdio(3S).

�����������
���� ������� ������������ �������� ��� ���������� type ��� size, �� ������� setvbuf ���������� ��������� ��������. � ��������� ������ ��������� ����� 0.

����������
���������������� ������� �������� ��������� ��� ����� ��������� ���������� ����� ��� �������� ������ ��� ������ �� �����.
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT