libmp3splt
src/pair.c
Go to the documentation of this file.
00001 /**********************************************************
00002  *
00003  * libmp3splt -- library based on mp3splt,
00004  *               for mp3/ogg splitting without decoding
00005  *
00006  * Copyright (c) 2002-2005 M. Trotta - <mtrotta@users.sourceforge.net>
00007  * Copyright (c) 2005-2011 Alexandru Munteanu - io_fx@yahoo.fr
00008  *
00009  * http://mp3splt.sourceforge.net
00010  *
00011  *********************************************************/
00012 
00013 /**********************************************************
00014  *
00015  * This program is free software; you can redistribute it and/or
00016  * modify it under the terms of the GNU General Public License
00017  * as published by the Free Software Foundation; either version 2
00018  * of the License, or (at your option) any later version.
00019  *
00020  * This program is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License
00026  * along with this program; if not, write to the Free Software
00027  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00028  * 02111-1307,
00029  * USA.
00030  *
00031  *********************************************************/
00032 
00037 #include "splt.h"
00038 
00039 splt_pair *splt_pair_new(void *first, void *second)
00040 {
00041   splt_pair *pair = malloc(sizeof(splt_pair));
00042   if (pair == NULL)
00043   {
00044     return NULL;
00045   }
00046 
00047   pair->first = first;
00048   pair->second = second;
00049 
00050   return pair;
00051 }
00052 
00053 void splt_pair_free(splt_pair **pair)
00054 {
00055   if (!pair)
00056   {
00057     return;
00058   }
00059 
00060   if (!*pair)
00061   {
00062     return;
00063   }
00064 
00065   free(*pair);
00066   *pair = NULL;
00067 }
00068 
00069 void *splt_pair_first(splt_pair *pair)
00070 {
00071   return pair->first;
00072 }
00073 
00074 void *splt_pair_second(splt_pair *pair)
00075 {
00076   return pair->second;
00077 }
00078