size_logrec.c

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

C
48
字号
/*===========================================================================*//* DMC interim out |       size_logrec.c                   |  Utility        *//*===========================================================================*//*	Name:		size_logrec.c	Purpose:	determine size of blockettes when padded to logical records	Usage:			Input:			Output:		number of bytes, number of records	Externals:		Warnings:		Errors:			Fatals:	Called by:		Calls to:		Algorithm:		Notes:			Problems:		References:		Language:		Revisions:	mm/dd/yy  pgmr name  change*/#include "output.h"int size_logrec( blockette_size, lrecl, padded_size )int		blockette_size;			/* current blockette size */int		lrecl;					/* logical record size */int		*padded_size;			/* total size of padded blockettes */{/* * blockettes will be copied into this chunk size: the size of the data area */	int	user_data = lrecl-sizeof(struct hdr_logrec);	/* seed header stuff *//* * if the current total size is within ENDPAD of a logical record boundary, * then we must round up the "currect padded size" to the next record boundary * and in any case, then add the new data size itself. */	if( user_data - (*padded_size % user_data) <= ENDPAD )	{		*padded_size = ( (*padded_size+user_data-1) / user_data) * user_data;	}	*padded_size += blockette_size;	return( (*padded_size+user_data-1) / user_data );}

⌨️ 快捷键说明

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