line_alloc.c

来自「操作系统SunOS 4.1.3版本的源码」· C语言 代码 · 共 33 行

C
33
字号
#ifndef lintstatic	char sccsid[] = "@(#)line_alloc.c 1.1 92/07/30 SMI"; /* from S5R2 1.1 */#endif#include "curses.ext"/* * _line_alloc returns a pointer to a new line structure. */struct line *_line_alloc (){	register struct line   *rv = SP->freelist;	char *calloc();#ifdef DEBUG	if(outf) fprintf(outf, "mem: _line_alloc (), prev SP->freelist %x\n", SP->freelist);#endif	if (rv) {		SP->freelist = rv -> next;	} else {#ifdef NONSTANDARD		_ec_quit("No lines available in line_alloc", "");#else		rv = (struct line *) calloc (1, sizeof *rv);		rv -> body = (chtype *) calloc (columns, sizeof (chtype));#endif	}	rv -> length = 0;	rv -> hash = 0;	return rv;}

⌨️ 快捷键说明

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