📄 is_new_volume.c
字号:
/*===========================================================================*//* DMC interim out | is_newvolume.c | Main *//*===========================================================================*//* Name: is_new_volume Purpose: to determine if the current request is beyond the current volume Usage: yesno = is_new_volume( next_volume, request ) Input: struct input_time next_volume struct DMC_request request Output: TRUE if a new volume should be started or FALSE Externals: Warnings: Errors: Fatals: Called by: Calls to: Algorithm: Notes: if the request time is within .0001 of next_volume, this routine returns TRUE. See cmp_longtime for reasons. For example, if all higher order chunks are the same, it returns: .0003 .0001 false .0002 .0001 true <- this might be unexpected. .0001 .0001 true .0000 .0001 true Usually, a precision of better than a millisecond is not likely to occur in the field, anyway. Problems: References: Language: Author: 03/13/89 mark wiederspahn Revisions: mm/dd/yy pgmr name change 04/26/89 kevin mackenzie set reqtime == max(start,reqstart) so volumes can be less than 1 day*/#include "output.h"is_new_volume( next_volume, request )struct input_time next_volume;struct DMC_request request;{ struct input_time dattime; /* time of the current data start */ struct input_time reqtime; /* time of the current request */ int result; /* eventual true/false result */ if( Debug >= D_MIN ) fprintf( D_OUT,"[is_new_volume] start\n" ); dattime = asc_to_input_time( request.entry.start ); reqtime = asc_to_input_time( request.reqstart ); if( cmp_longtime( reqtime, dattime ) < 0 ) reqtime = dattime; result = (cmp_longtime( reqtime, next_volume ) >= 0) ? TRUE : FALSE; if( Debug >= D_MED && result ) fprintf( D_OUT,"[is_new_volume] YES!\n" ); if( Debug >= D_MIN ) fprintf( D_OUT,"[is_new_volume] end\n" ); return( result );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -