tbuffer.h

来自「Software Development in C: A Practical A」· C头文件 代码 · 共 84 行

H
84
字号
//---------------------------------------------------------
/*
File name:	Tbuffer.h
Comments:	This file contains the definitions needed to 
			use the text_buffer type.
*/


#ifndef TBUFFER_H
#define TBUFFER_H

//---------------------------------------------------------
// Include files

#include "Tstring.h"

// End include files
//---------------------------------------------------------



//---------------------------------------------------------
// Constants

#define TEXT_BUFFER_LENGTH 50

// End constants
//---------------------------------------------------------



//---------------------------------------------------------
// Enumerated types

typedef enum
{
	TBE_NO_ERROR = 0,

	TBE_FIRST_ERROR = 1000,
	TBE_BUFFER_FULL,
	TBE_INDEX_OUT_OF_RANGE,
	TBE_INVALID_CHARACTER
} text_buffer_error;

// End enumerated types
//---------------------------------------------------------



//---------------------------------------------------------
// Type definitions

/* This defines the text_buffer type as an array of 
TEXT_BUFFER_LENGTH strings. */
typedef text_string text_buffer[TEXT_BUFFER_LENGTH];

// End type definitions
//---------------------------------------------------------



//---------------------------------------------------------
// Prototypes

text_buffer_error TextBufferSetRow(text_buffer buffer,
								   int row,
								   text_string theString);
void TextBufferGetRow(text_buffer buffer,int row,text_string theString);

text_buffer_error TextBufferSetCharacter(text_buffer buffer,
										 int row,int column,
										 char theCharacter);
int TextBufferGetCharacter(text_buffer buffer,
						   int row,int column);

// End prototypes
//---------------------------------------------------------



#endif

// End Tbuffer.h
//---------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?