AcePerl

 view release on metacpan or  search on metacpan

acelib/helpsubs.c  view on Meta::CPAN

	       "(%s)",
	       helpGetDir(),
	       messSysErrorText());
      
      return FALSE;
    }
  
  helpFilename = helpSubjectGetFilename(subject);
  /* may be NULL if file could not be found,
     the registered helpOnRoutine has to cope
     with this case and may decide to display an 
     index instead */
  
  if (helpOnRoutine)
    return ((*helpOnRoutine)(helpFilename));


  return (helpPrint (helpFilename)); /* textual help as default */
} /* helpOn */
/************************************************************/

acelib/messubs.c  view on Meta::CPAN

#else
  mess = printToBuf(&errmess[0], ERRBUFSIZE, SYSERR_FORMAT, errno, strerror(errno)) ;
#endif

  return mess ;
  }


/************************* message formatting ********************************/
/* This routine does the formatting of the message string using vsprintf,    */
/* it copes with the format string accidentally being our internal buffer.   */
/*                                                                           */
/* This routine does its best to check that the vsprintf is successful, if   */
/* not the routine bombs out with an error message. Note that num_bytes is   */
/* the return value from vsprintf.                                           */
/* Failures trapped:                                                         */
/*              num_bytes < 0  =>  vsprintf failed, reason is reported.      */
/*    num_bytes + 1 > BUFSIZE  =>  our internal buffer size was exceeded.    */
/*                                 (vsprintf returns number of bytes written */
/*                                  _minus_ terminating NULL)                */
/*                                                                           */

acelib/timesubs.c  view on Meta::CPAN

    1 = isGreaterThan

   times can easily be compared, if they both specify the
   same level of detail, e.g.
        1996-03 < 1997-04        -> TRUE
     1998-06-07 = 1998-06-12     -> FALSE

   Complications occur, if the level of detail given varies in both dates :-

        1998-06 < 1998-07-09_09:51:23 -> TRUE
         the "lessthan" fact is decided on the months

           1990 = 1990-05-02   -> TRUE
     in case of equality the comparison asks if the lesser detailed date 
     is completely contained within the other, and the above 
     comparison evaluates TRUE, because May 2nd 1990 is in the year 1990

         1998-07 < 1998-07-09   -> FALSE
     because one date gives a specific day in July 1998, but as the
     first date misses the day, we can't decide whether it is earlier.
      
     Example: the movie City Hall was released on 1996-02-16.
        
       select m->Title, m->Released from m in class Movie where m->Released < `1996-02
       select m->Title, m->Released from m in class Movie where m->Released > `1996-02

     will BOTH EXnclude the movie 'City Hall', whereas
     
       select m->Title, m->Released from m in class Movie where m->Released < `1996-02-17
       select m->Title, m->Released from m in class Movie where m->Released <= `1996-02

acelib/timesubs.c  view on Meta::CPAN

  if (yearDiff > 0)
    return (op < 0) ;

  if (yearDiff < 0)
    return (op > 0) ;

  /* yearDiff == 0 */
  /********************/
  /* month difference */
  if (!timeDiffMonths (timeLeft, timeRight, &monthDiff))
    /* can't decide on months */
    return (op == 0) ;

  if (monthDiff > 0)
    return (op < 0) ;

  if (monthDiff < 0) 
    return  (op > 0) ;

  /* monthDiff == 0 */
  /******************/
  /* day difference */
  if (!timeDiffDays (timeLeft, timeRight, &dayDiff))
    /* can't decide on days */
    return (op == 0) ;

  if (dayDiff > 0)
    return (op < 0) ;    

  if (dayDiff < 0)
    return  (op > 0) ;
	  
  /* dayDiff == 0 */
  /*******************/
  /* hour difference */
  if (!timeDiffHours (timeLeft, timeRight, &hourDiff))
    /* can't decide on hours */
    return (op == 0) ;

  if (hourDiff > 0)
    return (op < 0) ; 

  if (hourDiff < 0)
    return  (op > 0) ;
	  
  /*  hourDiff == 0 */
  /*********************/
  /* minute difference */
  if (!timeDiffMins (timeLeft, timeRight, &minDiff))
    /* can't decide on minutes */
    return (op == 0) ;

  if (minDiff > 0)
    return (op < 0) ; 

  if (minDiff < 0)
    return  (op > 0) ;
	  
  /* minDiff == 0 */
  /*********************/
  /* second difference */
  if (!timeDiffSecs (timeLeft, timeRight, &secDiff))
    /* can't decide on seconds */
    return (op == 0) ;

  if (secDiff > 0)
    return (op < 0) ; 

  if (secDiff < 0)
    return  (op > 0) ;
	  
  /* secDiff == 0 */
  /*********************/
    /* can't decide on 1/10 of second */
  return (op == 0) ;
} /* timeComparison */

/*************************************************************/

char *timeDiffShow (mytime_t t1, mytime_t t2) 
{
  static char buf[25] ;
  struct tm ts1, ts2;
  BOOL wantMonth1, wantDay1, wantHours1, wantMins1, wantSecs1;



( run in 0.352 second using v1.01-cache-2.11-cpan-de7293f3b23 )