renamed functions, changed livido header file to pass function pointers to livido_setup_f

git-svn-id: svn://code.dyne.org/veejay/trunk@483 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
Niels Elburg
2005-11-18 23:25:33 +00:00
parent cd2f5be0e5
commit 388258ac3a
13 changed files with 266 additions and 25845 deletions

24573
vevo-mpool/configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -3,11 +3,12 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <include/libvevo.h>
#include <include/livido.h>
#include "../include/vevo.h"
#include "../include/livido.h"
#include "../src/livido-utils.c"
//#include "../src/livido-utils.c"
/*
int verbose = 1; int verbose = 1;
int errorcount = 0; int errorcount = 0;
@@ -172,7 +173,7 @@ int deep_filter_api_version(livido_port_t *port, char *propname)
int deep_channel_templates(livido_port_t *port, char *propname) int deep_channel_templates(livido_port_t *port, char *propname)
{ {
int numtemplates = livido_property_num_elements(port, propname); int numtemplates = vevo_property_num_elements(port, propname);
int error; int error;
livido_port_t **ports = (livido_port_t **) livido_get_portptr_array (port, propname, &error); livido_port_t **ports = (livido_port_t **) livido_get_portptr_array (port, propname, &error);
for (int i = 0; i < numtemplates; i++) for (int i = 0; i < numtemplates; i++)
@@ -186,7 +187,7 @@ int deep_channel_templates(livido_port_t *port, char *propname)
int deep_parameter_templates(livido_port_t *port, char *propname) int deep_parameter_templates(livido_port_t *port, char *propname)
{ {
int numtemplates = livido_property_num_elements(port, propname); int numtemplates = vevo_property_num_elements(port, propname);
int error; int error;
livido_port_t **ports = (livido_port_t **) livido_get_portptr_array (port, propname, &error); livido_port_t **ports = (livido_port_t **) livido_get_portptr_array (port, propname, &error);
for (int i = 0; i < numtemplates; i++) for (int i = 0; i < numtemplates; i++)
@@ -227,7 +228,7 @@ int deep_parameter_templates(livido_port_t *port, char *propname)
int deep_plugininfo_filters(livido_port_t *port, char *propname) int deep_plugininfo_filters(livido_port_t *port, char *propname)
{ {
int numfilters = livido_property_num_elements(port, propname); int numfilters = vevo_property_num_elements(port, propname);
int error; int error;
livido_port_t **ports = (livido_port_t **) livido_get_portptr_array (port, propname, &error); livido_port_t **ports = (livido_port_t **) livido_get_portptr_array (port, propname, &error);
for (int i = 0; i < numfilters; i++) for (int i = 0; i < numfilters; i++)
@@ -240,18 +241,9 @@ int deep_plugininfo_filters(livido_port_t *port, char *propname)
return 0; return 0;
} }
// Implementation of default malloc/free/memset/memcpy
void *livido_malloc_f (size_t size) { return malloc(size); }
void livido_free_f (void *ptr) { free(ptr); }
void *livido_memset_f (void *s, int c, size_t n) { return memset(s, c, n); }
void *livido_memcpy_f (void *dest, const void *src, size_t n) { return memcpy( dest, src, n); }
int check_property_mandatory (livido_port_t *port, char *propname, char *propdesc) int check_property_mandatory (livido_port_t *port, char *propname, char *propdesc)
{ {
int error = livido_property_get(port, propname, 0, NULL); int error = vevo_property_get(port, propname, 0, NULL);
if (error) if (error)
{ {
printf("ERROR: Missing mandatory property \'\'%s\'\' of port %s, code: %i\n", propname, propdesc, error); printf("ERROR: Missing mandatory property \'\'%s\'\' of port %s, code: %i\n", propname, propdesc, error);
@@ -262,10 +254,10 @@ int check_property_mandatory (livido_port_t *port, char *propname, char *propdes
} }
int check_property_type (livido_port_t *port, char *propname, int atom_type, char *propdesc) int check_property_type (livido_port_t *port, char *propname, int atom_type, char *propdesc)
{ {
int error = livido_property_get(port, propname, 0, NULL); int error = vevo_property_get(port, propname, 0, NULL);
if (!error) if (!error)
{ {
int real_atomtype = livido_property_atom_type(port, propname); int real_atomtype = vevo_property_atom_type(port, propname);
if (real_atomtype != atom_type) if (real_atomtype != atom_type)
{ {
printf("ERROR: Type of property %s is %i, must be: %i\n", propdesc, real_atomtype, atom_type); printf("ERROR: Type of property %s is %i, must be: %i\n", propdesc, real_atomtype, atom_type);
@@ -288,7 +280,7 @@ int check_property_type_mandatory_one (livido_port_t *port, char *propname, int
int retval = check_property_type_mandatory(port, propname, atom_type, propdesc); int retval = check_property_type_mandatory(port, propname, atom_type, propdesc);
if (retval) if (retval)
return retval; return retval;
if (livido_property_num_elements(port, propname) != 1) if (vevo_property_num_elements(port, propname) != 1)
return -1; return -1;
return 0; return 0;
} }
@@ -349,7 +341,7 @@ int test_port (livido_port_t *port, property_desc_t *properties, int porttype, c
{ {
char *propname = standard_property->name; char *propname = standard_property->name;
// check existence // check existence
int error = livido_property_get(port, propname, 0, NULL); int error = vevo_property_get(port, propname, 0, NULL);
if (error == LIVIDO_ERROR_NOSUCH_PROPERTY) // we ignore no such element property here, we deal with that later! if (error == LIVIDO_ERROR_NOSUCH_PROPERTY) // we ignore no such element property here, we deal with that later!
{ {
// property does not exist // property does not exist
@@ -360,9 +352,9 @@ int test_port (livido_port_t *port, property_desc_t *properties, int porttype, c
} }
continue; continue;
} }
printf("Property %s, %d\n", propname, error); // printf("Property %s, %d\n", propname, vevo_property_element_size(port,propname,0));
// Property exists, check type // Property exists, check type
int atomtype = livido_property_atom_type(port, propname); int atomtype = vevo_property_atom_type(port, propname);
if (standard_property->atomtype >= 0 && standard_property->atomtype != atomtype) if (standard_property->atomtype >= 0 && standard_property->atomtype != atomtype)
{ {
printf("ERROR: Type of property \'\'%s\'\' (of port %s) is %i, must be: %i\n", propname, portdesc, atomtype, standard_property->atomtype); printf("ERROR: Type of property \'\'%s\'\' (of port %s) is %i, must be: %i\n", propname, portdesc, atomtype, standard_property->atomtype);
@@ -370,7 +362,7 @@ int test_port (livido_port_t *port, property_desc_t *properties, int porttype, c
continue; continue;
} }
// Property exists and has right type, check if array is properly laid out // Property exists and has right type, check if array is properly laid out
int numelements = livido_property_num_elements(port, propname); int numelements = vevo_property_num_elements(port, propname);
if (standard_property->minc >= 0 && standard_property->minc > numelements) if (standard_property->minc >= 0 && standard_property->minc > numelements)
{ {
printf("ERROR: Property \'\'%s\'\' (of port %s) has %i elements, which is less than minimum of %i\n", propname, portdesc, numelements, standard_property->minc); printf("ERROR: Property \'\'%s\'\' (of port %s) has %i elements, which is less than minimum of %i\n", propname, portdesc, numelements, standard_property->minc);
@@ -392,7 +384,7 @@ int test_port (livido_port_t *port, property_desc_t *properties, int porttype, c
return 0; return 0;
} }
*/
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
@@ -415,17 +407,43 @@ int main(int argc, char **argv)
livido_setup = (livido_setup_f) dlsym(handle, "livido_setup"); livido_setup = (livido_setup_f) dlsym(handle, "livido_setup");
if (!livido_setup) { printf("FATAL: function livido_setup not found in %s\n", name); return 1; }; if (!livido_setup) { printf("FATAL: function livido_setup not found in %s\n", name); return 1; };
plugin_info = livido_setup(); livido_setup_t *setup = (livido_setup_t*) malloc(sizeof(livido_setup_t));
setup->livido_port_free_f = vevo_port_free;
setup->livido_port_new_f = vevo_port_new;
setup->livido_property_get_f = vevo_property_get;
setup->livido_property_set_f = vevo_property_set;
setup->livido_property_num_elements_f = vevo_property_num_elements;
setup->livido_property_atom_type_f = vevo_property_atom_type;
setup->livido_property_element_size_f = vevo_property_element_size;
setup->livido_list_properties_f = vevo_list_properties;
setup->livido_malloc_f = malloc;
setup->livido_memset_f = memset;
setup->livido_memcpy_f = memcpy;
setup->livido_free_f = free;
plugin_info = livido_setup(setup,100);
if (!plugin_info) { printf("FATAL: livido_setup() did not return a pointer to livido port, finishing\n"); return 1; }; if (!plugin_info) { printf("FATAL: livido_setup() did not return a pointer to livido port, finishing\n"); return 1; };
printf("CHECKPOINT: Loading of plugin and running livido_setup() successeful\n"); printf("CHECKPOINT: Loading of plugin and running livido_setup() successeful\n");
test_port(plugin_info, port_plugininfo_desc, LIVIDO_PORT_TYPE_PLUGIN_INFO, "returned by livido_setup()"); // test_port(plugin_info, port_plugininfo_desc, LIVIDO_PORT_TYPE_PLUGIN_INFO, "returned by livido_setup()");
char **list = vevo_list_properties( plugin_info );
int i = 0;
if(list)
while( list[i] != NULL )
{
printf("%s\n", list[i]);
free(list[i]);
i++;
}
dlclose(handle); dlclose(handle);
printf("\nPlugin %s has produced %i errors and %i warnings\n", name, errorcount, warningcount); // printf("\nPlugin %s has produced %i errors and %i warnings\n", name, errorcount, warningcount);
// FIXME: Do the freeing of the all template ports // FIXME: Do the freeing of the all template ports

View File

@@ -25,20 +25,42 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef __LIBVEVO_H__
#define __LIBVEVO_H__
# ifndef VEVO_H_INCLUDED #ifdef __cplusplus
# define VEVO_H_INCLUDED extern "C" {
#endif /* __cplusplus */
#include <stdio.h> #include <sys/types.h>
#include <stdint.h>
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifndef HAVE_LIVIDO_PORT_T
#define HAVE_LIVIDO_PORT_T #define HAVE_LIVIDO_PORT_T
typedef void livido_port_t; typedef void livido_port_t;
# endif #endif
#include <include/livido.h>
extern void vevo_port_free(livido_port_t * port);
extern livido_port_t *vevo_port_new(int port_type);
extern int vevo_property_set(livido_port_t * port, const char *key,
int atom_type, int num_elems,
void *value);
extern int vevo_property_get(livido_port_t * port, const char *key,
int idx, void *value);
extern int vevo_property_num_elements(livido_port_t * port,
const char *key);
extern int vevo_property_atom_type(livido_port_t * port,
const char *key);
extern size_t vevo_property_element_size(livido_port_t * port,
const char *key,
const int idx);
extern char **vevo_list_properties(livido_port_t * port);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // #ifndef __LIBVEVO_H__

View File

@@ -16,23 +16,14 @@
LiViDO is developed by: LiViDO is developed by:
Niels Elburg - http://veejay.sf.net Niels Elburg - http://veejay.sf.net
Gabriel "Salsaman" Finch - http://lives.sourceforge.net Gabriel "Salsaman" Finch - http://lives.sourceforge.net
Denis "Jaromil" Rojo - http://freej.dyne.org Denis "Jaromil" Rojo - http://freej.dyne.org
Tom Schouten - http://zwizwa.fartit.com Tom Schouten - http://zwizwa.fartit.com
Andraz Tori - http://cvs.cinelerra.org Andraz Tori - http://cvs.cinelerra.org
reviewed with suggestions and contributions from: reviewed with suggestions and contributions from:
Silvano "Kysucix" Galliani - http://freej.dyne.org Silvano "Kysucix" Galliani - http://freej.dyne.org
Kentaro Fukuchi - http://megaui.net/fukuchi Kentaro Fukuchi - http://megaui.net/fukuchi
Jun Iio - http://www.malib.net Jun Iio - http://www.malib.net
Carlo Prelz - http://www2.fluido.as:8080/ Carlo Prelz - http://www2.fluido.as:8080/
*/ */
@@ -40,18 +31,24 @@
#define __LIVIDO_H__ #define __LIVIDO_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { #define LIVIDO_BEGIN_DECLS extern "C" {
#endif /* __cplusplus */ #define LIVIDO_END_DECLS }
#else
#define LIVIDO_BEGIN_DECLS
#define LIVIDO_END_DECLS
#endif
/* for size_t */ #ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
LIVIDO_BEGIN_DECLS
#include <sys/types.h> #include <sys/types.h>
/* API version * 100 */
#define LIVIDO_API_VERSION 100 #define LIVIDO_API_VERSION 100
/* Palette types */
#
/* RGB palettes */
#define LIVIDO_PALETTE_RGB888 1 #define LIVIDO_PALETTE_RGB888 1
#define LIVIDO_PALETTE_RGB24 1 #define LIVIDO_PALETTE_RGB24 1
#define LIVIDO_PALETTE_BGR888 2 #define LIVIDO_PALETTE_BGR888 2
@@ -63,150 +60,54 @@ extern "C" {
#define LIVIDO_PALETTE_RGBFLOAT 5 #define LIVIDO_PALETTE_RGBFLOAT 5
#define LIVIDO_PALETTE_ARGBFLOAT 6 #define LIVIDO_PALETTE_ARGBFLOAT 6
#define LIVIDO_PALETTE_RGB565 7 #define LIVIDO_PALETTE_RGB565 7
/* YUV palettes */
#define LIVIDO_PALETTE_YUV422P 513 #define LIVIDO_PALETTE_YUV422P 513
#define LIVIDO_PALETTE_YV16 513 #define LIVIDO_PALETTE_YV16 513
/*
LIVIDO_PALETTE_YUV422P LIVIDO_PALETTE_YV16
[Official name 'YV16', 8 bit Y plane followed by 8
bit 2x1 subsampled V and U planes. Planar.]
*/
/*
LIVIDO_PALETTE_YUV420P LIVIDO_PALETTE_YV12
[8 bit Y plane followed by 8 bit 2x2 subsampled V and U planes. Planar
(Official name YV12)]
*/
#define LIVIDO_PALETTE_YUV420P 514 #define LIVIDO_PALETTE_YUV420P 514
#define LIVIDO_PALETTE_YV12 514 #define LIVIDO_PALETTE_YV12 514
/*
LIVIDO_PALETTE_YVU420P LIVIDO_PALETTE_I420
[Same as YUV420P , but U and V are swapped. Planar.]
*/
#define LIVIDO_PALETTE_YVU420P 515 #define LIVIDO_PALETTE_YVU420P 515
#define LIVIDO_PALETTE_I420 515 #define LIVIDO_PALETTE_I420 515
/*
LIVIDO_PALETTE_YUV444P
[Unofficial , 8 bit Y plane followed by 8 bit U and V planes, no
subsampling. Planar.]
*/
#define LIVIDO_PALETTE_YUV444P 516 #define LIVIDO_PALETTE_YUV444P 516
/*
LIVIDO_PALETTE_YUVA4444P LIVIDO_PALETTE_YUV4444P
[Unofficial, like YUV444P but with Alpha. Planar.]
*/
#define LIVIDO_PALETTE_YUV4444P 517 #define LIVIDO_PALETTE_YUV4444P 517
/*
LIVIDO_PALETTE_YUYV8888
[Like YUV 4:2:2 but with different component ordering within the
u_int32 macropixel. Packed.]
*/
#define LIVIDO_PALETTE_YUYV8888 518 #define LIVIDO_PALETTE_YUYV8888 518
/*
LIVIDO_PALETTE_YUYV8888
[Like YUV 4:2:2 but with different component ordering within the
u_int32 macropixel. Packed.]
*/
#define LIVIDO_PALETTE_UYVY8888 519 #define LIVIDO_PALETTE_UYVY8888 519
/*
LIVIDO_PALETTE_UYVY8888
[YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second
pixel horizontally on each line). A macropixel contains 2 pixels in 1
u_int32. Packed.]
*/
#define LIVIDO_PALETTE_YUV411 520 #define LIVIDO_PALETTE_YUV411 520
/*
LIVIDO_PALETTE_YUV411
[IEEE 1394 Digital Camera 1.04 spec. Is packed YUV format
with a 6 pixel macroblock structure containing 4 pixels.
Ordering is U2 Y0 Y1 V2 Y2 Y3. Uses same bandwith as YUV420P
Only used for SMPTE DV NTSC.]
*/
/* Pending: PALETTE YUV888, YUVA888 needed in cinerella */
#define LIVIDO_PALETTE_YUV888 521 #define LIVIDO_PALETTE_YUV888 521
#define LIVIDO_PALETTE_YUVA8888 522 #define LIVIDO_PALETTE_YUVA8888 522
/* Alpha palettes */
/*
Alpha palettes have two uses: 1) for masks, 2) to split colour inputs into single colour channels, or to combine single colour channels into a combined channel. The order of colour channels is the same as the order in the combined channel. For example if an input in RGB24 palette is split into 3 non-mask alpha channels, then the alpha channels will be in the order: Red, Green, Blue. A single non-mask alpha channel would represent the luminance.
*/
#define LIVIDO_PALETTE_A1 1025 #define LIVIDO_PALETTE_A1 1025
#define LIVIDO_PALETTE_A8 1026 #define LIVIDO_PALETTE_A8 1026
#define LIVIDO_PALETTE_AFLOAT 1027 #define LIVIDO_PALETTE_AFLOAT 1027
/* Filter flags */
#define LIVIDO_FILTER_NON_REALTIME (1<<0) #define LIVIDO_FILTER_NON_REALTIME (1<<0)
#define LIVIDO_FILTER_CAN_DO_INPLACE (1<<1) #define LIVIDO_FILTER_CAN_DO_INPLACE (1<<1)
#define LIVIDO_FILTER_STATELESS (1<<2) #define LIVIDO_FILTER_STATELESS (1<<2)
#define LIVIDO_FILTER_IS_CONVERTOR (1<<3) #define LIVIDO_FILTER_IS_CONVERTOR (1<<3)
/* Channel flags */
#define LIVIDO_CHANNEL_CHANGE_UNADVISED (1<<0) #define LIVIDO_CHANNEL_CHANGE_UNADVISED (1<<0)
/*
LIVIDO_CHANNEL_CHANGE_UNADVISED
plugin MAY use this flag to tell the host, that changing of channel size causes possibly unwanted behaviour of the filter. Unwanted behaviour can for example be reseting the accumulated values which causes the visual result of filter to change in unexpected way or maybe the next call to process function will take disproportional amount of time due to reinitialization. Host is safe to ignore the flag and plugin MUST still be useful, though functionality may suffer.
*/
#define LIVIDO_CHANNEL_PALETTE_UNADVISED (1<<1) #define LIVIDO_CHANNEL_PALETTE_UNADVISED (1<<1)
/*
LIVIDO_CHANNEL_PALETTE_UNADVISED
plugin MAY use this flag to tell the host, that changing of channel palette causes possibly unwanted behaviour of the filter. Unwanted behaviour can for example be reseting the accumulated values which causes the visual result of filter to change in unexpected way or maybe the next call to process function will take disproportional amount of time due to reinitialization. Host is safe to ignore the flag and plugin MUST still be useful, though functionality may suffer.
*/
/* Parameter flags */
#define LIVIDO_PARAMETER_CHANGE_UNADVISED (1<<0) #define LIVIDO_PARAMETER_CHANGE_UNADVISED (1<<0)
/*
plugin MAY use this flag to tell the host, that changing of this parameter causes possibly unwanted behaviour of the filter. Unwanted behaviour can for example be reseting the accumulated values which causes the visual result of filter to change in unexpected way or maybe the next call to process function will take disproportional amount of time due to reinitialization. Host is safe to ignore the flag and plugin MUST still be useful, though functionality may suffer.
*/
/* Property flags */
#define LIVIDO_PROPERTY_READONLY (1<<0) #define LIVIDO_PROPERTY_READONLY (1<<0)
/* YUV sampling types */
#define LIVIDO_YUV_SAMPLING_NONE 0 #define LIVIDO_YUV_SAMPLING_NONE 0
#define LIVIDO_YUV_SAMPLING_SMPTE 1 #define LIVIDO_YUV_SAMPLING_SMPTE 1
#define LIVIDO_YUV_SAMPLING_JPEG 2 #define LIVIDO_YUV_SAMPLING_JPEG 2
#define LIVIDO_YUV_SAMPLING_MPEG2 3 #define LIVIDO_YUV_SAMPLING_MPEG2 3
#define LIVIDO_YUV_SAMPLING_DVPAL 4 #define LIVIDO_YUV_SAMPLING_DVPAL 4
#define LIVIDO_YUV_SAMPLING_DVNTSC 5 #define LIVIDO_YUV_SAMPLING_DVNTSC 5
/* Interlace types */
#define LIVIDO_INTERLACE_NONE 0 #define LIVIDO_INTERLACE_NONE 0
#define LIVIDO_INTERLACE_TOPFIRST 1 #define LIVIDO_INTERLACE_TOPFIRST 1
#define LIVIDO_INTERLACE_BOTTOMFIRST 2 #define LIVIDO_INTERLACE_BOTTOMFIRST 2
#define LIVIDO_INTERLACE_PROGRESSIVE 3 #define LIVIDO_INTERLACE_PROGRESSIVE 3
/* Livido errors */
/* Core errors */
#define LIVIDO_NO_ERROR 0 #define LIVIDO_NO_ERROR 0
#define LIVIDO_ERROR_MEMORY_ALLOCATION 1 #define LIVIDO_ERROR_MEMORY_ALLOCATION 1
#define LIVIDO_ERROR_PROPERTY_READONLY 2 #define LIVIDO_ERROR_PROPERTY_READONLY 2
#define LIVIDO_ERROR_NOSUCH_ELEMENT 3 #define LIVIDO_ERROR_NOSUCH_ELEMENT 3
#define LIVIDO_ERROR_NOSUCH_PROPERTY 4 #define LIVIDO_ERROR_NOSUCH_PROPERTY 4
#define LIVIDO_ERROR_WRONG_ATOM_TYPE 5 #define LIVIDO_ERROR_WRONG_ATOM_TYPE 5
/* Plugin errors */
#define LIVIDO_ERROR_TOO_MANY_INSTANCES 6 #define LIVIDO_ERROR_TOO_MANY_INSTANCES 6
#define LIVIDO_ERROR_HARDWARE 7 #define LIVIDO_ERROR_HARDWARE 7
/* Atom types */
/* Fundamental atoms */
#define LIVIDO_ATOM_TYPE_INT 1 #define LIVIDO_ATOM_TYPE_INT 1
#define LIVIDO_ATOM_TYPE_DOUBLE 2 #define LIVIDO_ATOM_TYPE_DOUBLE 2
#define LIVIDO_ATOM_TYPE_BOOLEAN 3 #define LIVIDO_ATOM_TYPE_BOOLEAN 3
#define LIVIDO_ATOM_TYPE_STRING 4 #define LIVIDO_ATOM_TYPE_STRING 4
/* Pointer atoms */
#define LIVIDO_ATOM_TYPE_VOIDPTR 65 #define LIVIDO_ATOM_TYPE_VOIDPTR 65
#define LIVIDO_ATOM_TYPE_PORTPTR 66 #define LIVIDO_ATOM_TYPE_PORTPTR 66
/* Port types */
#define LIVIDO_PORT_TYPE_PLUGIN_INFO 1 #define LIVIDO_PORT_TYPE_PLUGIN_INFO 1
#define LIVIDO_PORT_TYPE_FILTER_CLASS 2 #define LIVIDO_PORT_TYPE_FILTER_CLASS 2
#define LIVIDO_PORT_TYPE_FILTER_INSTANCE 3 #define LIVIDO_PORT_TYPE_FILTER_INSTANCE 3
@@ -215,66 +116,75 @@ plugin MAY use this flag to tell the host, that changing of this parameter cause
#define LIVIDO_PORT_TYPE_CHANNEL 6 #define LIVIDO_PORT_TYPE_CHANNEL 6
#define LIVIDO_PORT_TYPE_PARAMETER 7 #define LIVIDO_PORT_TYPE_PARAMETER 7
#define LIVIDO_PORT_TYPE_GUI 8 #define LIVIDO_PORT_TYPE_GUI 8
/*
A port is a set of one or more properties
Each port has a mandatory property called "type" (see below), depending upon "type" property port has other mandatory and optional properties.
"type" can be one of:
* LIVIDO_PORT_TYPE_PLUGIN_INFO : Information about plugin and list of filter classes it includes
* LIVIDO_PORT_TYPE_FILTER_CLASS : Descriptive information about single filter class
* LIVIDO_PORT_TYPE_CHANNEL_TEMPLATE : Information about what kinds of channels filter accepts
* LIVIDO_PORT_TYPE_PARAMETER_TEMPLATE : Information about what kinds of parameters filter has
* LIVIDO_PORT_TYPE_FILTER_INSTANCE : All data about an instance
* LIVIDO_PORT_TYPE_CHANNEL : Instantination of a channel
* LIVIDO_PORT_TYPE_PARAMETER : Instantination of a parameter
* LIVIDO_PORT_TYPE_GUI : described in the separate livido GUI extension (TODO)
"type" is a single valued property with atom_type LIVIDO_ATOM_TYPE_INT.
The host should provide its own mediation layer for providing a datacontainer for its port.
This host uses the mediation layer, where a new port is defined.
*/
#ifndef HAVE_LIVIDO_PORT_T #ifndef HAVE_LIVIDO_PORT_T
#define HAVE_LIVIDO_PORT_T #define HAVE_LIVIDO_PORT_T
typedef void livido_port_t; typedef void livido_port_t;
#endif #endif
extern void livido_port_free(livido_port_t * port);
extern livido_port_t *livido_port_new(int port_type);
extern int livido_property_set(livido_port_t * port, const char *key, typedef int (*livido_init_f) (livido_port_t * filter_instance);
int atom_type, int num_elems, typedef int (*livido_process_f) (livido_port_t * filter_instance,
void *value); double timestamp);
extern int livido_property_get(livido_port_t * port, const char *key, typedef int (*livido_deinit_f) (livido_port_t * filter_instance);
int idx, void *value);
extern int livido_property_num_elements(livido_port_t * port, typedef struct {
const char *key); void *(*livido_malloc_f) (size_t size);
extern int livido_property_atom_type(livido_port_t * port, void (*livido_free_f) (void *ptr);
const char *key); void *(*livido_memset_f) (void *s, int c, size_t n);
extern size_t livido_property_element_size(livido_port_t * port, void *(*livido_memcpy_f) (void *dest, const void *src, size_t n);
const char *key,
const int idx);
extern char **livido_list_properties(livido_port_t * port);
extern void *livido_malloc_f(size_t size); livido_port_t *(*livido_port_new_f) (int);
extern void livido_free_f(void *ptr); void (*livido_port_free_f) (livido_port_t * port);
extern void *livido_memset_f(void *s, int c, size_t n);
extern void *livido_memcpy_f(void *dest, const void *src, size_t n);
typedef livido_port_t *(*livido_setup_f) (void); int (*livido_property_set_f) (livido_port_t *, const char *, int, int,
typedef int (*livido_init_f) (livido_port_t * filter_instance); void *);
typedef int (*livido_process_f) (livido_port_t * filter_instance, int (*livido_property_get_f) (livido_port_t *, const char *, int,
double timestamp); void *);
typedef int (*livido_deinit_f) (livido_port_t * filter_instance);
#ifdef __cplusplus int (*livido_property_num_elements_f) (livido_port_t *, const char *);
size_t(*livido_property_element_size_f) (livido_port_t *,
const char *, const int);
int (*livido_property_atom_type_f) (livido_port_t *, const char *);
char **(*livido_list_properties_f) (livido_port_t *);
livido_port_t *extensions; // Extensions, port that holds voidptr to extension functions
} livido_setup_t;
typedef livido_port_t *(*livido_setup_f) (const livido_setup_t * list,
int version);
#define LIVIDO_PLUGIN \
static livido_port_t *(*livido_port_new) (int) = 0;\
static void (*livido_port_free) (livido_port_t * port) = 0;\
static int (*livido_property_set) (livido_port_t * port,const char *key, int atom_type, int num_elems, void *value) = 0;\
static int (*livido_property_get) (livido_port_t * port,const char *key, int idx, void *value) = 0;\
static int (*livido_property_num_elements) (livido_port_t * port,const char *key) = 0;\
static int (*livido_property_atom_type) (livido_port_t * port,const char *key) = 0;\
static size_t(*livido_property_element_size) (livido_port_t * port,const char *key, const int idx) = 0;\
static char **(*livido_list_properties) (livido_port_t * port) = 0;\
static void *(*livido_malloc) (size_t size) = 0;\
static void (*livido_free) (void *ptr) = 0;\
static void *(*livido_memset) (void *s, int c, size_t n) = 0;\
static void *(*livido_memcpy) (void *dest, const void *src, size_t n) = 0;\
#define LIVIDO_IMPORT(list) \
{\
livido_malloc = list->livido_malloc_f;\
livido_free = list->livido_free_f;\
livido_memset = list->livido_memset_f;\
livido_memcpy = list->livido_memcpy_f;\
livido_port_free = list->livido_port_free_f;\
livido_port_new = list->livido_port_new_f;\
livido_property_set = list->livido_property_set_f;\
livido_property_get = list->livido_property_get_f;\
livido_property_num_elements = list->livido_property_num_elements_f;\
livido_property_atom_type = list->livido_property_atom_type_f;\
livido_property_element_size = list->livido_property_element_size_f;\
livido_list_properties = list->livido_list_properties_f;\
} }
#endif /* __cplusplus */
LIVIDO_END_DECLS
#endif // #ifndef __LIVIDO_H__ #endif // #ifndef __LIVIDO_H__

View File

@@ -1,8 +1,11 @@
#include <stddef.h> #include <stddef.h>
#include "stdio.h" #include <stdio.h>
#include "../include/livido.h" #include <include/livido.h>
LIVIDO_PLUGIN
#include "livido-utils.c"
#include "../src/livido-utils.c"
#define num_palettes 5 #define num_palettes 5
@@ -34,11 +37,15 @@ livido_process_f process_frame( livido_port_t *my_instance,
livido_port_t *livido_setup(void) livido_port_t *livido_setup(livido_setup_t *list, int vversion)
{ {
livido_port_t *info; livido_port_t *info;
livido_port_t *filter1; livido_port_t *filter1;
livido_port_t *in_chann, *out_chann, *in_param, *out_param; livido_port_t *in_chann, *out_chann, *in_param, *out_param;
LIVIDO_IMPORT( list );
info = livido_port_new(LIVIDO_PORT_TYPE_PLUGIN_INFO); info = livido_port_new(LIVIDO_PORT_TYPE_PLUGIN_INFO);
livido_set_string_value(info, "maintainer", "Andraz Tori"); livido_set_string_value(info, "maintainer", "Andraz Tori");
livido_set_string_value(info, "version", "1.0"); livido_set_string_value(info, "version", "1.0");

View File

@@ -42,6 +42,10 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <stdlib.h>
#include <include/livido.h>
int livido_has_property (livido_port_t *port, const char *key) { int livido_has_property (livido_port_t *port, const char *key) {
if (livido_property_get(port,key,0,NULL)==LIVIDO_ERROR_NOSUCH_PROPERTY) return 0; if (livido_property_get(port,key,0,NULL)==LIVIDO_ERROR_NOSUCH_PROPERTY) return 0;
return 1; return 1;
@@ -131,12 +135,12 @@ char *livido_get_string_value (livido_port_t *port, const char *key, int *error)
*error=LIVIDO_ERROR_WRONG_ATOM_TYPE; *error=LIVIDO_ERROR_WRONG_ATOM_TYPE;
return NULL; return NULL;
} }
if ((retval=(char *)livido_malloc_f(livido_property_element_size(port,key,0)+1))==NULL) { if ((retval=(char *)livido_malloc(livido_property_element_size(port,key,0)+1))==NULL) {
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
return NULL; return NULL;
} }
if ((*error=livido_get_value (port,key,&retval))!=LIVIDO_NO_ERROR) { if ((*error=livido_get_value (port,key,&retval))!=LIVIDO_NO_ERROR) {
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
return retval; return retval;
@@ -177,14 +181,14 @@ int *livido_get_int_array (livido_port_t *port, const char *key, int *error) {
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL; if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
if ((retval=(int *)livido_malloc_f(num_elems*sizeof(int)))==NULL) { if ((retval=(int *)livido_malloc(num_elems*sizeof(int)))==NULL) {
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
return NULL; return NULL;
} }
for (i=0;i<num_elems;i++) { for (i=0;i<num_elems;i++) {
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) { if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
} }
@@ -202,14 +206,14 @@ double *livido_get_double_array (livido_port_t *port, const char *key, int *erro
} }
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL; if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
if ((retval=(double *)livido_malloc_f(num_elems*sizeof(double)))==NULL) { if ((retval=(double *)livido_malloc(num_elems*sizeof(double)))==NULL) {
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
return NULL; return NULL;
} }
for (i=0;i<num_elems;i++) { for (i=0;i<num_elems;i++) {
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) { if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
} }
@@ -228,14 +232,14 @@ int *livido_get_boolean_array (livido_port_t *port, const char *key, int *error)
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL; if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
if ((retval=(int *)livido_malloc_f(num_elems*sizeof(int)))==NULL) { if ((retval=(int *)livido_malloc(num_elems*sizeof(int)))==NULL) {
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
return NULL; return NULL;
} }
for (i=0;i<num_elems;i++) { for (i=0;i<num_elems;i++) {
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) { if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
} }
@@ -254,21 +258,21 @@ char **livido_get_string_array (livido_port_t *port, const char *key, int *error
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL; if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
if ((retval=(char **)livido_malloc_f(num_elems*sizeof(char *)))==NULL) { if ((retval=(char **)livido_malloc(num_elems*sizeof(char *)))==NULL) {
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
return NULL; return NULL;
} }
for (i=0;i<num_elems;i++) { for (i=0;i<num_elems;i++) {
if ((retval[i]=(char *)livido_malloc_f(livido_property_element_size(port,key,i)+1))==NULL) { if ((retval[i]=(char *)livido_malloc(livido_property_element_size(port,key,i)+1))==NULL) {
for (--i;i>=0;i--) livido_free_f(retval[i]); for (--i;i>=0;i--) livido_free(retval[i]);
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) { if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
for (--i;i>=0;i--) livido_free_f(retval[i]); for (--i;i>=0;i--) livido_free(retval[i]);
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
} }
@@ -287,14 +291,14 @@ void **livido_get_voidptr_array (livido_port_t *port, const char *key, int *erro
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL; if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
if ((retval=(void **)livido_malloc_f(num_elems*sizeof(void *)))==NULL) { if ((retval=(void **)livido_malloc(num_elems*sizeof(void *)))==NULL) {
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
return NULL; return NULL;
} }
for (i=0;i<num_elems;i++) { for (i=0;i<num_elems;i++) {
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) { if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
} }
@@ -313,14 +317,14 @@ livido_port_t **livido_get_portptr_array (livido_port_t *port, const char *key,
if ((num_elems=livido_property_num_elements (port,key))==0) return NULL; if ((num_elems=livido_property_num_elements (port,key))==0) return NULL;
if ((retval=(livido_port_t **)livido_malloc_f(num_elems*sizeof(livido_port_t *)))==NULL) { if ((retval=(livido_port_t **)livido_malloc(num_elems*sizeof(livido_port_t *)))==NULL) {
*error=LIVIDO_ERROR_MEMORY_ALLOCATION; *error=LIVIDO_ERROR_MEMORY_ALLOCATION;
return NULL; return NULL;
} }
for (i=0;i<num_elems;i++) { for (i=0;i<num_elems;i++) {
if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) { if ((*error=livido_property_get(port, key, i, &retval[i]))!=LIVIDO_NO_ERROR) {
livido_free_f (retval); livido_free (retval);
return NULL; return NULL;
} }
} }

View File

@@ -1,6 +1,6 @@
CC = gcc CC = gcc
LINKER = ld LINKER = ld
CFLAGS = -I. -I../include -I ../ -Wall -g $(shell vevo-config --cflags) CFLAGS = -I. -I../include -I ../ -Wall -g
all: all:
# vevo - veejay video objects # vevo - veejay video objects
# #
@@ -13,9 +13,9 @@ all:
# export LD_LIBRARY_PATH=`pwd` # export LD_LIBRARY_PATH=`pwd`
# host <plugin.so> # host <plugin.so>
plugins: fade_plugin.so plugins: fade_plugin.so example_plugin.so
example.so: example_plugin.o
fade.so: fade_plugin.o fade.so: fade_plugin.o
clean: clean:

View File

@@ -1,474 +0,0 @@
# Makefile.in generated by automake 1.9.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
SOURCES = $(libvevo_la_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(libdir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
libvevo_la_LIBADD =
am_libvevo_la_OBJECTS = hash.lo pool.lo vevo.lo
libvevo_la_OBJECTS = $(am_libvevo_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libvevo_la_SOURCES)
DIST_SOURCES = $(libvevo_la_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
INCLUDES = -I$(top_srcdir)/include -I$(includedir)
VEVO_LIB_FILE = libvevo.la
VEVO_ALL_LIB_OPTS = \
-version-info $(LT_AGE):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE) \
-export-dynamic
lib_LTLIBRARIES = $(VEVO_LIB_FILE)
libvevo_la_SOURCES = hash.c pool.c vevo.c
libvevo_la_LDFLAGS = $(VEVO_ALL_LIB_OPTS)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
$(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libvevo.la: $(libvevo_la_OBJECTS) $(libvevo_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libvevo_la_LDFLAGS) $(libvevo_la_OBJECTS) $(libvevo_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vevo.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES)
installdirs:
for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-libLTLIBRARIES
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am \
install-libLTLIBRARIES install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-info-am \
uninstall-libLTLIBRARIES
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,5 +1,5 @@
LIBVEVO_2_2_0 LIBVEVO_2_2_0
{ {
global: livido_*; global: vevo_*;
local: *; local: *;
}; };

View File

@@ -31,11 +31,9 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <include/lowlevel.h>
#include <include/vevo.h>
#include <include/livido.h>
#include <include/hash.h> #include <include/hash.h>
#include <include/lowlevel.h>
#include <include/libvevo.h>
/* If defined, dont expect a major performance improvment. */ /* If defined, dont expect a major performance improvment. */
#ifdef VEVO_MEMPOOL #ifdef VEVO_MEMPOOL
@@ -220,7 +218,7 @@ static inline int hash_key_code(const char *key)
return hash; return hash;
} }
static int livido_property_finalize(livido_port_t * p, const char *key) static int vevo_property_finalize(livido_port_t * p, const char *key)
{ {
vevo_port_t *port = (vevo_port_t *) p; vevo_port_t *port = (vevo_port_t *) p;
int hash_key = hash_key_code(key); int hash_key = hash_key_code(key);
@@ -484,7 +482,7 @@ static inline int key_compare(const void *key1, const void *key2)
Livido API implementation, public functions follow below Livido API implementation, public functions follow below
*/ */
int livido_property_num_elements(livido_port_t * p, const char *key) int vevo_property_num_elements(livido_port_t * p, const char *key)
{ {
#ifdef STRICT_CHECKING #ifdef STRICT_CHECKING
assert(p != NULL); assert(p != NULL);
@@ -509,7 +507,7 @@ int livido_property_num_elements(livido_port_t * p, const char *key)
return -1; return -1;
} }
int livido_property_atom_type(livido_port_t * p, const char *key) int vevo_property_atom_type(livido_port_t * p, const char *key)
{ {
#ifdef STRICT_CHECKING #ifdef STRICT_CHECKING
assert(p != NULL); assert(p != NULL);
@@ -542,8 +540,8 @@ int livido_property_atom_type(livido_port_t * p, const char *key)
} }
size_t size_t
livido_property_element_size(livido_port_t * p, const char *key, vevo_property_element_size(livido_port_t * p, const char *key,
const int idx) const int idx)
{ {
#ifdef STRICT_CHECKING #ifdef STRICT_CHECKING
assert(p != NULL); assert(p != NULL);
@@ -572,7 +570,8 @@ livido_property_element_size(livido_port_t * p, const char *key,
if ((node = property_exists(port, hash_key)) != NULL) { if ((node = property_exists(port, hash_key)) != NULL) {
livido_storage_t *stor = (livido_storage_t *) hnode_get(node); livido_storage_t *stor = (livido_storage_t *) hnode_get(node);
#ifdef STRICT_CHECKING #ifdef STRICT_CHECKING
assert(idx < stor->num_elements); if (idx > 0)
assert(idx < stor->num_elements);
#endif #endif
//todo: sum all element sizes for index of -1 //todo: sum all element sizes for index of -1
if (stor->num_elements == 1) { if (stor->num_elements == 1) {
@@ -589,7 +588,7 @@ livido_property_element_size(livido_port_t * p, const char *key,
return -1; return -1;
} }
livido_port_t *livido_port_new(int port_type) livido_port_t *vevo_port_new(int port_type)
{ {
vevo_port_t *port = (vevo_port_t *) malloc(sizeof(vevo_port_t)); vevo_port_t *port = (vevo_port_t *) malloc(sizeof(vevo_port_t));
@@ -619,11 +618,11 @@ livido_port_t *livido_port_new(int port_type)
port->pool = NULL; port->pool = NULL;
#endif #endif
livido_property_set(port, "type", LIVIDO_ATOM_TYPE_INT, 1, &port_type); vevo_property_set(port, "type", LIVIDO_ATOM_TYPE_INT, 1, &port_type);
livido_property_finalize(port, "type"); vevo_property_finalize(port, "type");
#ifdef STRICT_CHECKING #ifdef STRICT_CHECKING
assert(livido_property_set assert(vevo_property_set
(port, "type", LIVIDO_ATOM_TYPE_INT, 1, &port_type) (port, "type", LIVIDO_ATOM_TYPE_INT, 1, &port_type)
!= LIVIDO_PROPERTY_READONLY); != LIVIDO_PROPERTY_READONLY);
#endif #endif
@@ -631,7 +630,7 @@ livido_port_t *livido_port_new(int port_type)
return (livido_port_t *) port; return (livido_port_t *) port;
} }
void livido_port_free(livido_port_t * p) void vevo_port_free(livido_port_t * p)
{ {
vevo_port_t *port = (vevo_port_t *) p; vevo_port_t *port = (vevo_port_t *) p;
@@ -685,9 +684,9 @@ void livido_port_free(livido_port_t * p)
} }
int int
livido_property_set(livido_port_t * p, vevo_property_set(livido_port_t * p,
const char *key, const char *key,
int atom_type, int num_elements, void *src) int atom_type, int num_elements, void *src)
{ {
#ifdef STRICT_CHECKING #ifdef STRICT_CHECKING
assert(p != NULL); assert(p != NULL);
@@ -766,7 +765,7 @@ livido_property_set(livido_port_t * p,
} }
int int
livido_property_get(livido_port_t * p, const char *key, int idx, void *dst) vevo_property_get(livido_port_t * p, const char *key, int idx, void *dst)
{ {
#ifdef STRICT_CHECKING #ifdef STRICT_CHECKING
assert(p != NULL); assert(p != NULL);
@@ -800,7 +799,7 @@ livido_property_get(livido_port_t * p, const char *key, int idx, void *dst)
return LIVIDO_ERROR_NOSUCH_PROPERTY; return LIVIDO_ERROR_NOSUCH_PROPERTY;
} }
char **livido_list_properties(livido_port_t * p) char **vevo_list_properties(livido_port_t * p)
{ {
vevo_port_t *port = (vevo_port_t *) p; vevo_port_t *port = (vevo_port_t *) p;

View File

@@ -1,490 +0,0 @@
# Makefile.in generated by automake 1.9.4 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
SOURCES = $(vevobench_SOURCES) $(vevotest_SOURCES) $(vevoutils_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
bin_PROGRAMS = $(am__EXEEXT_1)
subdir = test
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__EXEEXT_1 = vevotest$(EXEEXT) vevobench$(EXEEXT) vevoutils$(EXEEXT)
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_vevobench_OBJECTS = vevobenchmark.$(OBJEXT)
vevobench_OBJECTS = $(am_vevobench_OBJECTS)
am__DEPENDENCIES_1 = $(top_builddir)/src/libvevo.la
vevobench_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_vevotest_OBJECTS = vevotest.$(OBJEXT)
vevotest_OBJECTS = $(am_vevotest_OBJECTS)
vevotest_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_vevoutils_OBJECTS = vevoutilstest.$(OBJEXT)
vevoutils_OBJECTS = $(am_vevoutils_OBJECTS)
vevoutils_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(vevobench_SOURCES) $(vevotest_SOURCES) \
$(vevoutils_SOURCES)
DIST_SOURCES = $(vevobench_SOURCES) $(vevotest_SOURCES) \
$(vevoutils_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
INCLUDES = -I$(top_srcdir)/include \
-I$(top_srcdir) -I$(includedir) \
-DG_LOG_DOMAIN=\"libvido\" -DLIBVIDO_VERSION=\"$(VERSION)\"
LIBVEVO = $(top_builddir)/src/libvevo.la
# *********************************************************************
# The tools themselves
EXAMPLES_BIN = vevotest vevobench vevoutils
vevotest_SOURCES = vevotest.c
vevotest_LDADD = $(LIBVEVO) -ldl
vevobench_SOURCES = vevobenchmark.c
vevobench_LDADD = $(LIBVEVO) -ldl
vevoutils_SOURCES = vevoutilstest.c
vevoutils_LDADD = $(LIBVEVO) -ldl
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu test/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
vevobench$(EXEEXT): $(vevobench_OBJECTS) $(vevobench_DEPENDENCIES)
@rm -f vevobench$(EXEEXT)
$(LINK) $(vevobench_LDFLAGS) $(vevobench_OBJECTS) $(vevobench_LDADD) $(LIBS)
vevotest$(EXEEXT): $(vevotest_OBJECTS) $(vevotest_DEPENDENCIES)
@rm -f vevotest$(EXEEXT)
$(LINK) $(vevotest_LDFLAGS) $(vevotest_OBJECTS) $(vevotest_LDADD) $(LIBS)
vevoutils$(EXEEXT): $(vevoutils_OBJECTS) $(vevoutils_DEPENDENCIES)
@rm -f vevoutils$(EXEEXT)
$(LINK) $(vevoutils_LDFLAGS) $(vevoutils_OBJECTS) $(vevoutils_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vevobenchmark.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vevotest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vevoutilstest.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -3,8 +3,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <include/vevo.h> #include <include/libvevo.h>
#include <include/livido.h>
#include <sys/time.h> #include <sys/time.h>
static struct { static struct {
int32_t iv; int32_t iv;
@@ -26,13 +25,13 @@ static int stats[2] = { 0, 0 };
int test_fundemental_atoms(livido_port_t * port) int test_fundemental_atoms(livido_port_t * port)
{ {
livido_property_set(port, "int_value", LIVIDO_ATOM_TYPE_INT, 1, vevo_property_set(port, "int_value", LIVIDO_ATOM_TYPE_INT, 1,
&(fundementals[fundemental_index].iv)); &(fundementals[fundemental_index].iv));
livido_property_set(port, "double_value", LIVIDO_ATOM_TYPE_DOUBLE, 1, vevo_property_set(port, "double_value", LIVIDO_ATOM_TYPE_DOUBLE, 1,
&(fundementals[fundemental_index].dv)); &(fundementals[fundemental_index].dv));
livido_property_set(port, "string_value", LIVIDO_ATOM_TYPE_STRING, 1, vevo_property_set(port, "string_value", LIVIDO_ATOM_TYPE_STRING, 1,
&(fundementals[fundemental_index].sv)); &(fundementals[fundemental_index].sv));
livido_property_set(port, "bool_value", LIVIDO_ATOM_TYPE_INT, 1, vevo_property_set(port, "bool_value", LIVIDO_ATOM_TYPE_INT, 1,
&(fundementals[fundemental_index].bv)); &(fundementals[fundemental_index].bv));
fundemental_index++; fundemental_index++;
stats[0] += 4; stats[0] += 4;
@@ -42,10 +41,10 @@ int test_fundemental_atoms(livido_port_t * port)
long get_work_size(livido_port_t * port) long get_work_size(livido_port_t * port)
{ {
long mem_size = 0; long mem_size = 0;
mem_size += livido_property_element_size(port, "int_value", 0); mem_size += vevo_property_element_size(port, "int_value", 0);
mem_size += livido_property_element_size(port, "double_value", 0); mem_size += vevo_property_element_size(port, "double_value", 0);
mem_size += livido_property_element_size(port, "string_value", 0); mem_size += vevo_property_element_size(port, "string_value", 0);
mem_size += livido_property_element_size(port, "bool_value", 0); mem_size += vevo_property_element_size(port, "bool_value", 0);
return mem_size; return mem_size;
} }
@@ -58,14 +57,14 @@ void dump_port(livido_port_t * port)
int32_t bool_value = FALSE; int32_t bool_value = FALSE;
livido_property_get(port, "int_value", 0, &int_value); vevo_property_get(port, "int_value", 0, &int_value);
livido_property_get(port, "double_value", 0, &double_value); vevo_property_get(port, "double_value", 0, &double_value);
string_value = string_value =
(char *) (char *)
malloc(livido_property_element_size(port, "string_value", 0)); malloc(vevo_property_element_size(port, "string_value", 0));
livido_property_get(port, "string_value", 0, &string_value); vevo_property_get(port, "string_value", 0, &string_value);
livido_property_get(port, "bool_value", 0, &bool_value); vevo_property_get(port, "bool_value", 0, &bool_value);
free(string_value); free(string_value);
stats[1] += 4; stats[1] += 4;
} }
@@ -88,7 +87,7 @@ int main(int argc, char *argv[])
max = atoi(argv[1]); max = atoi(argv[1]);
if (argc >= 3 ) if (argc >= 3 )
type = atoi( argv[2] ); type = atoi( argv[2] );
livido_port_t *port = livido_port_new(type); livido_port_t *port = vevo_port_new(type);
gettimeofday(&start, NULL); gettimeofday(&start, NULL);
for (i = 0; i < max; i++) // get and set 16 properties per cycle for (i = 0; i < max; i++) // get and set 16 properties per cycle
@@ -108,7 +107,7 @@ int main(int argc, char *argv[])
float seconds = (float) tv.tv_sec; float seconds = (float) tv.tv_sec;
seconds += (tv.tv_usec / 1000000.0); seconds += (tv.tv_usec / 1000000.0);
livido_port_free(port); vevo_port_free(port);
printf("Bench: %ld Atoms put and get in %4.4f seconds\n", (stats[0] + stats[1]), seconds ); printf("Bench: %ld Atoms put and get in %4.4f seconds\n", (stats[0] + stats[1]), seconds );
printf("\t %ld Atoms per second\n", (long)( (float) stats[0]/seconds )); printf("\t %ld Atoms per second\n", (long)( (float) stats[0]/seconds ));

View File

@@ -3,8 +3,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#include <include/vevo.h> #include <include/libvevo.h>
#include <include/livido.h>
static struct { static struct {
int32_t iv; int32_t iv;
@@ -45,13 +44,13 @@ static int fundemental_index = 0;
int test_fundemental_atoms(livido_port_t * port) int test_fundemental_atoms(livido_port_t * port)
{ {
livido_property_set(port, "int_value", LIVIDO_ATOM_TYPE_INT, 1, vevo_property_set(port, "int_value", LIVIDO_ATOM_TYPE_INT, 1,
&(fundementals[fundemental_index].iv)); &(fundementals[fundemental_index].iv));
livido_property_set(port, "double_value", LIVIDO_ATOM_TYPE_DOUBLE, 1, vevo_property_set(port, "double_value", LIVIDO_ATOM_TYPE_DOUBLE, 1,
&(fundementals[fundemental_index].dv)); &(fundementals[fundemental_index].dv));
livido_property_set(port, "string_value", LIVIDO_ATOM_TYPE_STRING, 1, vevo_property_set(port, "string_value", LIVIDO_ATOM_TYPE_STRING, 1,
&(fundementals[fundemental_index].sv)); &(fundementals[fundemental_index].sv));
livido_property_set(port, "bool_value", LIVIDO_ATOM_TYPE_BOOLEAN, 1, vevo_property_set(port, "bool_value", LIVIDO_ATOM_TYPE_BOOLEAN, 1,
&(fundementals[fundemental_index].bv)); &(fundementals[fundemental_index].bv));
fundemental_index++; fundemental_index++;
@@ -60,54 +59,54 @@ int test_fundemental_atoms(livido_port_t * port)
void test_arrays(livido_port_t * port) void test_arrays(livido_port_t * port)
{ {
livido_property_set(port, "int_values", LIVIDO_ATOM_TYPE_INT, 4, vevo_property_set(port, "int_values", LIVIDO_ATOM_TYPE_INT, 4,
&(arrays[array_index].iv)); &(arrays[array_index].iv));
livido_property_set(port, "double_values", LIVIDO_ATOM_TYPE_DOUBLE, 4, vevo_property_set(port, "double_values", LIVIDO_ATOM_TYPE_DOUBLE, 4,
&(arrays[array_index].dv)); &(arrays[array_index].dv));
livido_property_set(port, "string_values", LIVIDO_ATOM_TYPE_STRING, 4, vevo_property_set(port, "string_values", LIVIDO_ATOM_TYPE_STRING, 4,
&(arrays[array_index].sv)); &(arrays[array_index].sv));
livido_property_set(port, "bool_values", LIVIDO_ATOM_TYPE_BOOLEAN, 4, vevo_property_set(port, "bool_values", LIVIDO_ATOM_TYPE_BOOLEAN, 4,
&(arrays[array_index].bv)); &(arrays[array_index].bv));
array_index++; array_index++;
} }
void test_store_empty_atoms(livido_port_t * port) void test_store_empty_atoms(livido_port_t * port)
{ {
livido_property_set(port, "empty_double", LIVIDO_ATOM_TYPE_DOUBLE, 0 , NULL ); vevo_property_set(port, "empty_double", LIVIDO_ATOM_TYPE_DOUBLE, 0 , NULL );
livido_property_set(port, "empty_string", LIVIDO_ATOM_TYPE_STRING,0, NULL ); vevo_property_set(port, "empty_string", LIVIDO_ATOM_TYPE_STRING,0, NULL );
livido_property_set(port, "empty_bool", LIVIDO_ATOM_TYPE_BOOLEAN, 0, NULL ); vevo_property_set(port, "empty_bool", LIVIDO_ATOM_TYPE_BOOLEAN, 0, NULL );
livido_property_set(port, "empty_int", LIVIDO_ATOM_TYPE_INT,0, NULL ); vevo_property_set(port, "empty_int", LIVIDO_ATOM_TYPE_INT,0, NULL );
livido_property_set(port, "empty_array", LIVIDO_ATOM_TYPE_PORTPTR,0,NULL); vevo_property_set(port, "empty_array", LIVIDO_ATOM_TYPE_PORTPTR,0,NULL);
} }
void dump_empty_atoms(livido_port_t * port) void dump_empty_atoms(livido_port_t * port)
{ {
if (livido_property_get(port, "ghost", 0, NULL) == LIVIDO_NO_ERROR) { if (vevo_property_get(port, "ghost", 0, NULL) == LIVIDO_NO_ERROR) {
printf("\tEmpty property 'ghost' exists\n"); printf("\tEmpty property 'ghost' exists\n");
} }
if( livido_property_get(port , "empty_string", 0,NULL ) == LIVIDO_NO_ERROR ) if( vevo_property_get(port , "empty_string", 0,NULL ) == LIVIDO_NO_ERROR )
printf("\tProperty '%s' exists\n", "empty_string" ); printf("\tProperty '%s' exists\n", "empty_string" );
if( livido_property_get(port , "empty_bool", 0,NULL ) == LIVIDO_NO_ERROR ) if( vevo_property_get(port , "empty_bool", 0,NULL ) == LIVIDO_NO_ERROR )
printf("\tProperty '%s' exists\n", "empty_bool" ); printf("\tProperty '%s' exists\n", "empty_bool" );
if( livido_property_get(port , "empty_int", 0,NULL ) == LIVIDO_NO_ERROR ) if( vevo_property_get(port , "empty_int", 0,NULL ) == LIVIDO_NO_ERROR )
printf("\tProperty '%s' exists\n", "empty_int" ); printf("\tProperty '%s' exists\n", "empty_int" );
if( livido_property_get(port , "empty_double", 0,NULL ) == LIVIDO_NO_ERROR ) if( vevo_property_get(port , "empty_double", 0,NULL ) == LIVIDO_NO_ERROR )
printf("\tProperty '%s' exists\n", "empty_double" ); printf("\tProperty '%s' exists\n", "empty_double" );
int i; int i;
for(i =0; i < 4; i ++ ) for(i =0; i < 4; i ++ )
{ {
if( livido_property_get(port , "empty_array", 0,NULL ) == LIVIDO_NO_ERROR ) if( vevo_property_get(port , "empty_array", 0,NULL ) == LIVIDO_NO_ERROR )
printf("\tProperty '%s' exists , element %d has size %d\n", "empty_array", printf("\tProperty '%s' exists , element %d has size %d\n", "empty_array",
i, livido_property_element_size( port, "empty_array", 0) ); i, vevo_property_element_size( port, "empty_array", 0) );
} }
} }
@@ -125,21 +124,21 @@ void dump_arrays(livido_port_t * port)
/* allocate space for string list */ /* allocate space for string list */
int j; int j;
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
livido_property_get(port, "int_values", j, &int_value); vevo_property_get(port, "int_values", j, &int_value);
printf("\tElement %d of int_values has value %d\n", j, int_value); printf("\tElement %d of int_values has value %d\n", j, int_value);
livido_property_get(port, "double_values", j, &double_value); vevo_property_get(port, "double_values", j, &double_value);
printf("\tElement %d of double_values has value %g\n", j, printf("\tElement %d of double_values has value %g\n", j,
double_value); double_value);
int ssize = livido_property_element_size(port, "string_values", j); int ssize = vevo_property_element_size(port, "string_values", j);
string_value = (char *) malloc(sizeof(char) * ssize); string_value = (char *) malloc(sizeof(char) * ssize);
livido_property_get(port, "string_values", j, &string_value); vevo_property_get(port, "string_values", j, &string_value);
printf("\tElement %d of string_values has value '%s'\n", j, printf("\tElement %d of string_values has value '%s'\n", j,
string_value); string_value);
free(string_value); free(string_value);
livido_property_get(port, "bool_values", j, &bool_value); vevo_property_get(port, "bool_values", j, &bool_value);
printf("\tElement %d of bool_values has value %d\n", j, printf("\tElement %d of bool_values has value %d\n", j,
bool_value); bool_value);
} }
@@ -149,15 +148,15 @@ void dump_port(livido_port_t * port)
int32_t int_value = 0; int32_t int_value = 0;
double double_value = 0.0; double double_value = 0.0;
int32_t bool_value = FALSE; int32_t bool_value = FALSE;
livido_property_get(port, "int_value", 0, &int_value); vevo_property_get(port, "int_value", 0, &int_value);
livido_property_get(port, "double_value", 0, &double_value); vevo_property_get(port, "double_value", 0, &double_value);
char *string_value = char *string_value =
(char *) (char *)
malloc(livido_property_element_size(port, "string_value", 0)); malloc(vevo_property_element_size(port, "string_value", 0));
livido_property_get(port, "string_value", 0, &string_value); vevo_property_get(port, "string_value", 0, &string_value);
livido_property_get(port, "bool_value", 0, &bool_value); vevo_property_get(port, "bool_value", 0, &bool_value);
printf("\tProperty int_value has value %d\n", int_value); printf("\tProperty int_value has value %d\n", int_value);
printf("\tProperty double_value has value %g\n", double_value); printf("\tProperty double_value has value %g\n", double_value);
@@ -172,12 +171,12 @@ void dump_ptr_port(livido_port_t * port)
int i; int i;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
uint8_t *plane; uint8_t *plane;
livido_property_get(port, "pixeldata", i, &plane); vevo_property_get(port, "pixeldata", i, &plane);
printf("\tProperty pixeldata by index %d = %p\n", i, plane); printf("\tProperty pixeldata by index %d = %p\n", i, plane);
} }
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
void *p = NULL; void *p = NULL;
livido_property_get(port, "ports", i, &p); vevo_property_get(port, "ports", i, &p);
printf("\tProperty ports by index %d = %p\n", i, p); printf("\tProperty ports by index %d = %p\n", i, p);
} }
} }
@@ -185,7 +184,7 @@ void dump_ptr_port(livido_port_t * port)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
void *port = livido_port_new(0); void *port = vevo_port_new(0);
printf("Testing fundementals\n"); printf("Testing fundementals\n");
while (fundementals[fundemental_index].sv != NULL) { while (fundementals[fundemental_index].sv != NULL) {
test_fundemental_atoms(port); test_fundemental_atoms(port);
@@ -206,9 +205,9 @@ int main(int argc, char *argv[])
printf("\tport__data %p, %p, %p, %p\n", (void *) port, (void *) port, printf("\tport__data %p, %p, %p, %p\n", (void *) port, (void *) port,
(void *) port, (void *) port); (void *) port, (void *) port);
livido_property_set(port, "pixeldata", LIVIDO_ATOM_TYPE_VOIDPTR, 4, vevo_property_set(port, "pixeldata", LIVIDO_ATOM_TYPE_VOIDPTR, 4,
&pixel_data); &pixel_data);
livido_property_set(port, "ports", LIVIDO_ATOM_TYPE_PORTPTR, 4, vevo_property_set(port, "ports", LIVIDO_ATOM_TYPE_PORTPTR, 4,
&ports); &ports);
dump_ptr_port(port); dump_ptr_port(port);
@@ -226,9 +225,9 @@ int main(int argc, char *argv[])
printf("Freeing port %p\n", port); printf("Freeing port %p\n", port);
printf("Dumping properties in port %p\n", port); printf("Dumping properties in port %p\n", port);
char **list = livido_list_properties(port); char **list = vevo_list_properties(port);
livido_port_free(port); vevo_port_free(port);
for (i = 0; list[i] != NULL; i++) { for (i = 0; list[i] != NULL; i++) {
printf("\tproperty %s\n", list[i]); printf("\tproperty %s\n", list[i]);