PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/calendar - dow.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 5 5 100.0 %
Date: 2014-04-10 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : 
       2             : /* $selId: dow.c,v 2.0 1995/10/24 01:13:06 lees Exp $
       3             :  * Copyright 1993-1995, Scott E. Lee, all rights reserved.
       4             :  * Permission granted to use, copy, modify, distribute and sell so long as
       5             :  * the above copyright and this permission statement are retained in all
       6             :  * copies.  THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
       7             :  */
       8             : 
       9             : /**************************************************************************
      10             :  *
      11             :  * These are the externally visible components of this file:
      12             :  *
      13             :  *     int
      14             :  *     DayOfWeek(
      15             :  *         long int sdn);
      16             :  *
      17             :  * Convert a SDN to a day-of-week number (0 to 6).  Where 0 stands for
      18             :  * Sunday, 1 for Monday, etc. and 6 stands for Saturday.
      19             :  *
      20             :  *     char *DayNameShort[7];
      21             :  *
      22             :  * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to
      23             :  * the abbreviated (three character) name of the day.
      24             :  *
      25             :  *     char *DayNameLong[7];
      26             :  *
      27             :  * Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to
      28             :  * the name of the day.
      29             :  *
      30             :  **************************************************************************/
      31             : 
      32             : #include "sdncal.h"
      33             : 
      34         102 : int DayOfWeek(
      35             :                                  long int sdn)
      36             : {
      37             :         int dow;
      38             : 
      39         102 :         dow = (sdn + 1) % 7;
      40         102 :         if (dow >= 0) {
      41          81 :                 return (dow);
      42             :         } else {
      43          21 :                 return (dow + 7);
      44             :         }
      45             : }
      46             : 
      47             : char *DayNameShort[7] =
      48             : {
      49             :         "Sun",
      50             :         "Mon",
      51             :         "Tue",
      52             :         "Wed",
      53             :         "Thu",
      54             :         "Fri",
      55             :         "Sat"
      56             : };
      57             : 
      58             : char *DayNameLong[7] =
      59             : {
      60             :         "Sunday",
      61             :         "Monday",
      62             :         "Tuesday",
      63             :         "Wednesday",
      64             :         "Thursday",
      65             :         "Friday",
      66             :         "Saturday"
      67             : };
      68             : 
      69             : /*
      70             :  * Local variables:
      71             :  * tab-width: 4
      72             :  * c-basic-offset: 4
      73             :  * End:
      74             :  * vim600: sw=4 ts=4 fdm=marker
      75             :  * vim<600: sw=4 ts=4
      76             :  */

Generated by: LCOV version 1.10

Generated at Thu, 10 Apr 2014 08:53:47 +0000 (6 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.