#include "set_mark.h" #include "varext.h" void main_tim(void) { double lin_day; list_m_h *ptr; static list_m_h *endptr=NULL; TimeDate td_mt; lin_day=(double)((main_h.main_time%86400L)*(main_h.line_frequ)); if (lmh_start==NULL){ if ((lmh_start=malloc(sizeof(list_m_h)))==NULL){ printf(" malloc failed in main_tim\n"); exit(0); } ptr=lmh_start; endptr=ptr; memcpy(&(ptr->m_h),&main_h,SIZE_MAINH_4); ptr->line=lin_day; GetDayTime(lin_day,&td_mt); ptr->nr=0; ptr->next=NULL; ptr->pred=NULL; } else{ for (ptr=lmh_start;ptr!=NULL;ptr=ptr->next){ if (lin_day<=ptr->line){ if (memcmp(&ptr->m_h,&main_h,SIZE_MAINH_4)==0){return;} else{ printf("\n\n neg. time jump ?!?!?! \n"); exit(0); } } } if ((ptr=malloc(sizeof(list_m_h)))==NULL){ printf(" malloc failed in main_tim\n"); exit(0); } memcpy(&(ptr->m_h),&main_h,SIZE_MAINH_4); ptr->line=lin_day; ptr->nr=1+endptr->nr; ptr->next=NULL; ptr->pred=endptr; ptr->pred->next=ptr; endptr=ptr; } }