1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-12-04 14:46:31 -05:00
icecast-common/include/igloo/interface.h
2019-06-27 12:36:16 +00:00

67 lines
2.0 KiB
C

/* Copyright (C) 2019 Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _LIBIGLOO__INTERFACE_H_
#define _LIBIGLOO__INTERFACE_H_
/**
* @file
* Put a good description of this file here
*/
#ifdef __cplusplus
extern "C" {
#endif
/* Put stuff here */
#include "ro.h"
/* Basic arguments that should be passed to all interface functions */
#define igloo_INTERFACE_BASIC_ARGS igloo_ro_t self, igloo_ro_t *backend_object, void **backend_userdata
/* Basic free callback.
* If this does not set *backend_object to igloo_RO_NULL
* backend_object will be freed by calling igloo_ro_unref().
* If this does not set *backend_userdata to NULL
*
*/
typedef int (*igloo_interface_free_t)(igloo_INTERFACE_BASIC_ARGS);
#define igloo_INTERFACE_DESCRIPTION_BASE__VERSION 1
typedef struct {
size_t base_length;
int base_version;
size_t description_length;
igloo_interface_free_t free;
} igloo_interface_base_ifdesc_t;
#define igloo_INTERFACE_DESCRIPTION_BASE(type, ...) \
.__base = { \
.base_length = sizeof(igloo_interface_base_ifdesc_t), \
.base_version = igloo_INTERFACE_DESCRIPTION_BASE__VERSION, \
.description_length = sizeof(type) \
, ## __VA_ARGS__ \
}
#ifdef __cplusplus
}
#endif
#endif /* ! _LIBIGLOO__INTERFACE_H_ */