make_blk72.c

来自「seed格式数据解压程序,地震分析人员必备」· C语言 代码 · 共 50 行

C
50
字号
/*===========================================================================*//* UTIG DMC        |            make_blk72.c               | Utility         *//*===========================================================================*//*	Name:		make_blk72.c	Purpose:	allocate and link a timespan node	Usage:		struct blk72_list *make_blk72( head, tail )	Input:		struct	blk72_list	**head				struct	blk72_list	**tail	Output:		pointer to created node	Externals:		Warnings:		Errors:			Fatals:		calloc returns no space	Called by:		Calls to:	error_handler()	Algorithm:	If the list is empty, then both head and tail will be null.				(eg *head = NULL). If there are any nodes on the list, the				*head and *tail point to the ends; a node is linked in				in either case.	Notes:			Problems:		References:		Language:		Revisions:	03/10/89	mark wiederspahn	written*/#include "output.h"struct blk72_list *make_blk72( head )struct	blk72_list	**head;{	while (*head != NULL) *head = (*head)->next;/* * if this is the first node, point both head and tail to new node * else add one onto the existing list at the end. */	*head = 		(struct blk72_list *)calloc( 1, sizeof(struct blk72_list) );	if( *head == NULL )		error_handler( FATAL,"[make_blk72] no space" );	else		(*head)->next = NULL;	return( *head );}

⌨️ 快捷键说明

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