[xiph-commits] r2879 - liboggplay/trunk/plugin
laser13 at svn.annodex.net
laser13 at svn.annodex.net
Fri Jun 8 01:30:15 PDT 2007
Author: laser13
Date: 2007-06-08 01:30:14 -0700 (Fri, 08 Jun 2007)
New Revision: 2879
Removed:
liboggplay/trunk/plugin/playlist.c
liboggplay/trunk/plugin/playlist.h
Log:
Remove playlist files. Will be added with change names in next commit.
Deleted: liboggplay/trunk/plugin/playlist.c
===================================================================
--- liboggplay/trunk/plugin/playlist.c 2007-06-08 06:02:23 UTC (rev 2878)
+++ liboggplay/trunk/plugin/playlist.c 2007-06-08 08:30:14 UTC (rev 2879)
@@ -1,154 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Initial Developer of the Original Code is
- * CSIRO
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Marcin Lubonski
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#include "playlist.h"
-
-
-/**
- * Private functions for management of list elements
- */
-void
-shift_up(PluginPlaylist *playlist, unsigned int start_pos, unsigned int end_pos) {
- unsigned int i, j;
- if (playlist->data == NULL)
- return;
-
- if ((start_pos < 1) || (end_pos > playlist->length))
- return;
-
- for (j = 0, i = end_pos - 1; j < end_pos - start_pos; i--, j++) {
- playlist->data[i] = playlist->data[i - 1];
- }
-}
-
-void
-shift_down(PluginPlaylist *playlist, unsigned int start_pos, unsigned int end_pos) {
- unsigned int i, j;
- if (playlist->data == NULL)
- return;
-
- if ((start_pos < 1) || (end_pos > playlist->length))
- return;
-
- for (j = 0, i = start_pos - 1; j < end_pos - start_pos; j++, i++) {
- playlist->data[i] = playlist->data[i + 1];
- }
-}
-
-/**
- * Playlist public interface
- */
-void
-init(PluginPlaylist *playlist) {
- playlist->data = NULL;
- playlist->length = 0;
-}
-
-/*
- * \brief - Append new element at the end of the list
- */
-void
-append(PluginPlaylist * playlist, void * elem) {
-
- if (playlist->data == NULL) {
- playlist->data = (void**)malloc(sizeof(void*));
- playlist->length = 1;
- }
- else
- {
- playlist->data = realloc(playlist->data, (playlist->length + 1) * sizeof(void *));
- playlist->length += 1;
- }
-
- playlist->data[playlist->length-1] = elem;
- return;
-}
-/*
- * \brief - Add new element at position list_pos
- */
-void
-insert_at(PluginPlaylist* playlist, void * elem, unsigned int list_pos) {
-
- if (playlist->data == NULL) {
- if (list_pos > 1)
- return;
- playlist->data = (void **)malloc(sizeof(void *));
- playlist->length = 1;
- } else {
- if (list_pos > playlist->length + 1)
- return;
- playlist->data = realloc(playlist->data, (playlist->length + 1) * sizeof(void *));
- playlist->length += 1;
- }
-
- if (playlist->length > 1) {
- // if the existing element require shifting up
- if (list_pos < playlist->length) {
- shift_up(playlist, list_pos, playlist->length);
- }
- }
- playlist->data[list_pos-1] = elem;
- return;
-}
-
-/*
- * \brief Removes element of the playlist
- */
-void
-remove_at(PluginPlaylist* playlist, unsigned int list_pos) {
-
- if (playlist->data == NULL)
- return;
-
- if ((list_pos <= 0) || (list_pos > playlist->length))
- return;
-
- shift_down(playlist, list_pos, playlist->length);
- playlist->data = realloc(playlist->data, (playlist->length - 1) * sizeof(void *));
- playlist->length -= 1;
-
- return;
-}
-
-void
-show(PluginPlaylist* playlist) {
- unsigned int i;
- if (playlist != NULL) {
- for (i = 0; i < playlist->length; i++) {
- printf("Playlist entry [%d] is : %s\n", i + 1, playlist->data[i]);
- }
- }
- return;
-}
Deleted: liboggplay/trunk/plugin/playlist.h
===================================================================
--- liboggplay/trunk/plugin/playlist.h 2007-06-08 06:02:23 UTC (rev 2878)
+++ liboggplay/trunk/plugin/playlist.h 2007-06-08 08:30:14 UTC (rev 2879)
@@ -1,63 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Initial Developer of the Original Code is
- * CSIRO
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Shane Stephens, Michael Martin
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __PLUGIN_PLAYLIST__
-#define __PLUGIN_PLAYLIST__
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#define PLAYLIST_ELEM_TYPE char*
-
-typedef struct {
- void ** data;
- unsigned int length;
-} PluginPlaylist;
-
-void
-init(PluginPlaylist * playlist);
-
-void
-append(PluginPlaylist * playlist, void * elem);
-
-void
-insert_at(PluginPlaylist* playlist, void * elem, unsigned int list_pos);
-
-void
-remove_at(PluginPlaylist* playlist, unsigned int list_pos);
-
-void
-show(PluginPlaylist* playlist);
-
-#endif //__PLUGIN_PLAYLIST__
\ No newline at end of file
More information about the commits
mailing list