LCOV - code coverage report
Current view: directory - frmts/ceos2 - link.c (source / functions) Found Hit Coverage
Test: gdal_filtered.info Lines: 19 13 68.4 %
Date: 2011-12-18 Functions: 4 3 75.0 %

       1                 : /******************************************************************************
       2                 :  * $Id: link.c 10645 2007-01-18 02:22:39Z warmerdam $
       3                 :  *
       4                 :  * Project:  ASI CEOS Translator
       5                 :  * Purpose:  Link list function replacements.
       6                 :  * Author:   Frank Warmerdam, warmerda@home.com
       7                 :  *
       8                 :  ******************************************************************************
       9                 :  * Copyright (c) 2000, Atlantis Scientific Inc
      10                 :  *
      11                 :  * Permission is hereby granted, free of charge, to any person obtaining a
      12                 :  * copy of this software and associated documentation files (the "Software"),
      13                 :  * to deal in the Software without restriction, including without limitation
      14                 :  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      15                 :  * and/or sell copies of the Software, and to permit persons to whom the
      16                 :  * Software is furnished to do so, subject to the following conditions:
      17                 :  *
      18                 :  * The above copyright notice and this permission notice shall be included
      19                 :  * in all copies or substantial portions of the Software.
      20                 :  *
      21                 :  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
      22                 :  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      23                 :  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
      24                 :  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      25                 :  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
      26                 :  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
      27                 :  * DEALINGS IN THE SOFTWARE.
      28                 :  ****************************************************************************/
      29                 : 
      30                 : #include "ceos.h"
      31                 : 
      32                 : CPL_CVSID("$Id: link.c 10645 2007-01-18 02:22:39Z warmerdam $");
      33                 : 
      34                 : 
      35                 : /************************************************************************/
      36                 : /*                             ceos2CreateLink()                             */
      37                 : /************************************************************************/
      38                 : 
      39              26 : Link_t *ceos2CreateLink( void *pObject )
      40                 : 
      41                 : {
      42              26 :     Link_t  *psLink = (Link_t *) CPLCalloc(sizeof(Link_t),1);
      43                 : 
      44              26 :     psLink->object = pObject;
      45                 : 
      46              26 :     return psLink;
      47                 : }
      48                 : 
      49                 : /************************************************************************/
      50                 : /*                            DestroyList()                             */
      51                 : /************************************************************************/
      52                 : 
      53               2 : void DestroyList( Link_t * psList )
      54                 : 
      55                 : {
      56              30 :     while( psList != NULL )
      57                 :     {
      58              26 :         Link_t  *psNext = psList->next;
      59                 : 
      60              26 :         CPLFree( psList );
      61              26 :         psList = psNext;
      62                 :     }
      63               2 : }
      64                 : 
      65                 : /************************************************************************/
      66                 : /*                             InsertLink()                             */
      67                 : /************************************************************************/
      68                 : 
      69              24 : Link_t *InsertLink( Link_t *psList, Link_t *psLink )
      70                 : 
      71                 : {
      72              24 :     psLink->next = psList;
      73                 : 
      74              24 :     return psLink;
      75                 : }
      76                 : 
      77                 : /************************************************************************/
      78                 : /*                              AddLink()                               */
      79                 : /************************************************************************/
      80                 : 
      81               0 : Link_t *AddLink( Link_t *psList, Link_t *psLink )
      82                 : 
      83                 : {
      84                 :     Link_t  *psNode;
      85                 : 
      86               0 :     if( psList == NULL )
      87               0 :         return psLink;
      88                 : 
      89               0 :     for( psNode = psList; psNode->next != NULL; psNode = psNode->next ) {}
      90                 : 
      91               0 :     psNode->next = psLink;
      92                 : 
      93               0 :     return psList;
      94                 : }

Generated by: LCOV version 1.7