Skip to content
Browse files

Generate NIF function headers

Use a script to generate the header files for each resource type.
  • Loading branch information...
1 parent b8ccd25 commit 59b842c3d6c5f0932c6bc324d1aa3de72f5092b9 @msantos committed Aug 26, 2012
View
1 .gitignore
@@ -7,3 +7,4 @@ deps
*.gz
*.img
*.so
+c_src/vert_funcs.h
View
7 c_src/vert.c
@@ -31,12 +31,7 @@
*/
#include "vert.h"
#include "vert_util.h"
-#include "vert_connect.h"
-#include "vert_domain.h"
-#include "vert_interface.h"
-#include "vert_network.h"
-#include "vert_nwfilter.h"
-#include "vert_stream.h"
+#include "vert_funcs.h"
#include "vert_func.h"
#include <sys/types.h>
View
3 c_src/vert_connect.c
@@ -31,9 +31,10 @@
*/
#include "vert.h"
#include "vert_util.h"
-#include "vert_connect.h"
+ERL_NIF_TERM vert_connect_res_charp(ErlNifEnv *env, const ERL_NIF_TERM argv[], virConnectPtr (*fp)(const char *));
+
VERT_FUN_INT_RES(virConnectIsEncrypted, VERT_RES_CONNECT)
VERT_FUN_INT_RES(virConnectIsSecure, VERT_RES_CONNECT)
VERT_FUN_INT_RES(virConnectNumOfDomains, VERT_RES_CONNECT)
View
69 c_src/vert_connect.h
@@ -1,69 +0,0 @@
-/* Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-ERL_NIF_TERM vert_virConnectOpen(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectOpenReadOnly(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectGetCapabilities(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectGetHostname(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectGetLibVersion(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectGetMaxVcpus(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNodeGetFreeMemory(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNodeGetInfo(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNodeGetCellsFreeMemory(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectGetType(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectGetVersion(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectGetURI(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectIsEncrypted(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectIsSecure(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNodeGetSecurityModel(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfDomains(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfInterfaces(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfNetworks(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfStoragePools(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfSecrets(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfNWFilters(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfDefinedDomains(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfDefinedInterfaces(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfDefinedNetworks(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectNumOfDefinedStoragePools(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListDomains(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListInterfaces(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListNetworks(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListNWFilters(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListSecrets(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListStoragePools(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListDefinedDomains(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListDefinedInterfaces(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListDefinedNetworks(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virConnectListDefinedStoragePools(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-
-/* Internal functions */
-ERL_NIF_TERM vert_connect_res_charp(ErlNifEnv *env, const ERL_NIF_TERM argv[], virConnectPtr (*fp)(const char *));
View
1 c_src/vert_domain.c
@@ -31,7 +31,6 @@
*/
#include "vert.h"
#include "vert_util.h"
-#include "vert_domain.h"
VERT_FUN_INT_RES(virDomainDestroy, VERT_RES_DOMAIN)
View
71 c_src/vert_domain.h
@@ -1,71 +0,0 @@
-/* Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-ERL_NIF_TERM vert_virDomainCreate(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainDefineXML(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainDestroy(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetAutostart(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetBlockInfo(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetInfo(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetJobInfo(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetMaxMemory(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetMaxVcpus(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetMemoryParameters(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetOSType(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetSchedulerParameters(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetSchedulerType(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetSecurityLabel(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetUUID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetUUIDString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetUUIDString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainGetXMLDesc(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainLookupByID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainLookupByName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainLookupByUUID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainLookupByUUIDString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainOpenConsole(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainRestore(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainResume(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainSave(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainScreenshot(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainSendKey(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainSetAutostart(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainShutdown(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainSuspend(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virDomainUndefine(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-
-ERL_NIF_TERM vert_domain_int_res_int(
- ErlNifEnv *env,
- const ERL_NIF_TERM argv[],
- int (*fp)(virDomainPtr, int)
- );
View
44 c_src/vert_func.h
@@ -32,41 +32,41 @@
ErlNifFunc vert_funcs[] = {
/* connect */
- {"virConnectOpen", 1, vert_virConnectOpen},
- {"virConnectOpenReadOnly", 1, vert_virConnectOpenReadOnly},
{"virConnectGetCapabilities", 1, vert_virConnectGetCapabilities},
{"virConnectGetHostname", 1, vert_virConnectGetHostname},
{"virConnectGetLibVersion", 1, vert_virConnectGetLibVersion},
{"virConnectGetMaxVcpus", 2, vert_virConnectGetMaxVcpus},
- {"virNodeGetFreeMemory", 1, vert_virNodeGetFreeMemory},
- {"virNodeGetInfo", 1, vert_virNodeGetInfo},
- {"virNodeGetCellsFreeMemory", 2, vert_virNodeGetCellsFreeMemory},
{"virConnectGetType", 1, vert_virConnectGetType},
- {"virConnectGetVersion", 1, vert_virConnectGetVersion},
{"virConnectGetURI", 1, vert_virConnectGetURI},
+ {"virConnectGetVersion", 1, vert_virConnectGetVersion},
{"virConnectIsEncrypted", 1, vert_virConnectIsEncrypted},
{"virConnectIsSecure", 1, vert_virConnectIsSecure},
- {"virNodeGetSecurityModel", 1, vert_virNodeGetSecurityModel},
- {"virConnectNumOfDomains", 1, vert_virConnectNumOfDomains},
- {"virConnectNumOfInterfaces", 1, vert_virConnectNumOfInterfaces},
- {"virConnectNumOfNetworks", 1, vert_virConnectNumOfNetworks},
- {"virConnectNumOfStoragePools", 1, vert_virConnectNumOfStoragePools},
- {"virConnectNumOfSecrets", 1, vert_virConnectNumOfSecrets},
- {"virConnectNumOfNWFilters", 1, vert_virConnectNumOfNWFilters},
- {"virConnectNumOfDefinedDomains", 1, vert_virConnectNumOfDefinedDomains},
- {"virConnectNumOfDefinedInterfaces", 2, vert_virConnectNumOfDefinedInterfaces},
- {"virConnectNumOfDefinedNetworks", 1, vert_virConnectNumOfDefinedNetworks},
- {"virConnectNumOfDefinedStoragePools", 1, vert_virConnectNumOfDefinedStoragePools},
+ {"virConnectListDefinedDomains", 2, vert_virConnectListDefinedDomains},
+ {"virConnectListDefinedInterfaces", 2, vert_virConnectListDefinedInterfaces},
+ {"virConnectListDefinedNetworks", 2, vert_virConnectListDefinedNetworks},
+ {"virConnectListDefinedStoragePools", 2, vert_virConnectListDefinedStoragePools},
{"virConnectListDomains", 2, vert_virConnectListDomains},
{"virConnectListInterfaces", 2, vert_virConnectListInterfaces},
{"virConnectListNetworks", 2, vert_virConnectListNetworks},
{"virConnectListNWFilters", 2, vert_virConnectListNWFilters},
{"virConnectListSecrets", 2, vert_virConnectListSecrets},
{"virConnectListStoragePools", 2, vert_virConnectListStoragePools},
- {"virConnectListDefinedDomains", 2, vert_virConnectListDefinedDomains},
- {"virConnectListDefinedInterfaces", 2, vert_virConnectListDefinedInterfaces},
- {"virConnectListDefinedNetworks", 2, vert_virConnectListDefinedNetworks},
- {"virConnectListDefinedStoragePools", 2, vert_virConnectListDefinedStoragePools},
+ {"virConnectNumOfDefinedDomains", 1, vert_virConnectNumOfDefinedDomains},
+ {"virConnectNumOfDefinedInterfaces", 2, vert_virConnectNumOfDefinedInterfaces},
+ {"virConnectNumOfDefinedNetworks", 1, vert_virConnectNumOfDefinedNetworks},
+ {"virConnectNumOfDefinedStoragePools", 1, vert_virConnectNumOfDefinedStoragePools},
+ {"virConnectNumOfDomains", 1, vert_virConnectNumOfDomains},
+ {"virConnectNumOfInterfaces", 1, vert_virConnectNumOfInterfaces},
+ {"virConnectNumOfNetworks", 1, vert_virConnectNumOfNetworks},
+ {"virConnectNumOfNWFilters", 1, vert_virConnectNumOfNWFilters},
+ {"virConnectNumOfSecrets", 1, vert_virConnectNumOfSecrets},
+ {"virConnectNumOfStoragePools", 1, vert_virConnectNumOfStoragePools},
+ {"virConnectOpen", 1, vert_virConnectOpen},
+ {"virConnectOpenReadOnly", 1, vert_virConnectOpenReadOnly},
+ {"virNodeGetCellsFreeMemory", 2, vert_virNodeGetCellsFreeMemory},
+ {"virNodeGetFreeMemory", 1, vert_virNodeGetFreeMemory},
+ {"virNodeGetInfo", 1, vert_virNodeGetInfo},
+ {"virNodeGetSecurityModel", 1, vert_virNodeGetSecurityModel},
/* domain */
{"virDomainCreate", 2, vert_virDomainCreate},
@@ -147,8 +147,8 @@ ErlNifFunc vert_funcs[] = {
{"virStreamAbort", 1, vert_virStreamAbort},
{"virStreamFinish", 1, vert_virStreamFinish},
{"virStreamNew", 2, vert_virStreamNew},
- {"virStreamSend", 2, vert_virStreamSend},
{"virStreamRecv", 2, vert_virStreamRecv},
+ {"virStreamSend", 2, vert_virStreamSend},
{NULL, 0, NULL}
};
View
7 c_src/vert_func.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+awk -F\" '{
+ if ($2 ~ "vir") {
+ print "ERL_NIF_TERM vert_" $2 "(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);"
+ }
+}' $1
View
6 c_src/vert_interface.c
@@ -31,8 +31,12 @@
*/
#include "vert.h"
#include "vert_util.h"
-#include "vert_interface.h"
+ERL_NIF_TERM vert_interface_int_res_uint(
+ ErlNifEnv *env,
+ const ERL_NIF_TERM argv[],
+ int (*fp)(virInterfacePtr, unsigned int)
+ );
VERT_FUN_INT_RES(virInterfaceUndefine, VERT_RES_INTERFACE)
View
55 c_src/vert_interface.h
@@ -1,55 +0,0 @@
-/* Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-ERL_NIF_TERM vert_virInterfaceLookupByName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceLookupByMACString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceGetName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceGetMACString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceGetXMLDesc(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceDefineXML(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceUndefine(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceCreate(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virInterfaceDestroy(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-
-ERL_NIF_TERM vert_interface_res_res_ccharp(
- ErlNifEnv *env,
- const ERL_NIF_TERM argv[],
- virInterfacePtr (*fp)(virConnectPtr, const char *)
- );
-ERL_NIF_TERM vert_interface_ccharp_res_uint(
- ErlNifEnv *env,
- const ERL_NIF_TERM argv[],
- char *(*fp)(virInterfacePtr, unsigned int));
-ERL_NIF_TERM vert_interface_int_res_uint(
- ErlNifEnv *env,
- const ERL_NIF_TERM argv[],
- int (*fp)(virInterfacePtr, unsigned int)
- );
View
1 c_src/vert_network.c
@@ -31,7 +31,6 @@
*/
#include "vert.h"
#include "vert_util.h"
-#include "vert_network.h"
VERT_FUN_INT_RES(virNetworkCreate, VERT_RES_NETWORK)
View
52 c_src/vert_network.h
@@ -1,52 +0,0 @@
-/* Copyright (c) 2010-2012, Michael Santos <michael.santos@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-ERL_NIF_TERM vert_virNetworkCreate(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkDefineXML(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkDestroy(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkGetAutostart(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkGetBridgeName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkGetName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkGetUUID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkGetUUIDString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkGetXMLDesc(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkIsPersistent(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkLookupByName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkLookupByUUID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkLookupByUUIDString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkSetAutostart(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNetworkUndefine(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-
-ERL_NIF_TERM vert_network_res_res_ccharp(
- ErlNifEnv *env,
- const ERL_NIF_TERM argv[],
- virNetworkPtr (*fp)(virConnectPtr, const char *)
- );
View
1 c_src/vert_nwfilter.c
@@ -31,7 +31,6 @@
*/
#include "vert.h"
#include "vert_util.h"
-#include "vert_nwfilter.h"
#ifdef HAVE_NWFILTER
VERT_FUN_INT_RES(virNWFilterUndefine, VERT_RES_NWFILTER)
View
40 c_src/vert_nwfilter.h
@@ -1,40 +0,0 @@
-/* Copyright (c) 2012, Michael Santos <michael.santos@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-ERL_NIF_TERM vert_virNWFilterDefineXML(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterGetName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterGetUUID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterGetUUIDString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterGetXMLDesc(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterLookupByName(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterLookupByUUID(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterLookupByUUIDString(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virNWFilterUndefine(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
View
1 c_src/vert_stream.c
@@ -31,7 +31,6 @@
*/
#include "vert.h"
#include "vert_util.h"
-#include "vert_stream.h"
VERT_FUN_INT_RES(virStreamAbort, VERT_RES_STREAM);
VERT_FUN_INT_RES(virStreamFinish, VERT_RES_STREAM);
View
36 c_src/vert_stream.h
@@ -1,36 +0,0 @@
-/* Copyright (c) 2012, Michael Santos <michael.santos@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * Neither the name of the author nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-ERL_NIF_TERM vert_virStreamAbort(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virStreamNew(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virStreamFinish(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virStreamSend(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM vert_virStreamRecv(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]);
View
6 rebar.config
@@ -6,3 +6,9 @@
{port_specs, [
{"priv/vert.so", ["c_src/*.c"]}
]}.
+
+{pre_hooks, [
+ {compile, "c_src/vert_func.sh c_src/vert_func.h > c_src/vert_funcs.h"}
+ ]}.
+
+{clean_files, ["c_src/vert_funcs.h"]}.

0 comments on commit 59b842c

Please sign in to comment.
Something went wrong with that request. Please try again.