LCOV - code coverage report
Current view: directory - slv2/src - scalepoint.c (source / functions) Found Hit Coverage
Test: coverage.lcov Lines: 14 14 100.0 %
Date: 2009-05-26 Functions: 4 4 100.0 %

       1                 : /* SLV2
       2                 :  * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
       3                 :  *
       4                 :  * This library is free software; you can redistribute it and/or modify it
       5                 :  * under the terms of the GNU General Public License as published by the Free
       6                 :  * Software Foundation; either version 2 of the License, or (at your option)
       7                 :  * any later version.
       8                 :  *
       9                 :  * This library is distributed in the hope that it will be useful, but WITHOUT
      10                 :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      11                 :  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      12                 :  * for more details.
      13                 :  *
      14                 :  * You should have received a copy of the GNU General Public License along
      15                 :  * with this program; if not, write to the Free Software Foundation, Inc.,
      16                 :  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
      17                 :  */
      18                 : 
      19                 : #define _XOPEN_SOURCE 500
      20                 : 
      21                 : #include <stdlib.h>
      22                 : #include <string.h>
      23                 : #include <assert.h>
      24                 : #include <locale.h>
      25                 : #include <raptor.h>
      26                 : #include "slv2/types.h"
      27                 : #include "slv2/value.h"
      28                 : #include "slv2_internal.h"
      29                 : 
      30                 : 
      31                 : /* private - ownership of value and label is taken */
      32                 : SLV2ScalePoint
      33                 : slv2_scale_point_new(SLV2Value value, SLV2Value label)
      34               2 : {
      35               2 :         SLV2ScalePoint point = (SLV2ScalePoint)malloc(sizeof(struct _SLV2ScalePoint));
      36               2 :         point->value = value;
      37               2 :         point->label= label;
      38               2 :         return point;
      39                 : }
      40                 : 
      41                 : 
      42                 : /* private */
      43                 : void
      44                 : slv2_scale_point_free(SLV2ScalePoint point)
      45               2 : {
      46               2 :         slv2_value_free(point->value);
      47               2 :         slv2_value_free(point->label);
      48               2 :         free(point);
      49               2 : }
      50                 : 
      51                 : 
      52                 : SLV2Value
      53                 : slv2_scale_point_get_value(SLV2ScalePoint p)
      54               2 : {
      55               2 :         return p->value;
      56                 : }
      57                 : 
      58                 : 
      59                 : SLV2Value
      60                 : slv2_scale_point_get_label(SLV2ScalePoint p)
      61               2 : {
      62               2 :         return p->label;
      63                 : }
      64                 : 

Generated by: LCOV version 1.7