Bläddra i källkod

libobs/callback: Add calldata_create and calldata_destroy

These functions aren't particularly useful in C/C++, but these functions
are necessary to allow creating/destroying a calldata_t object via
script.
jp9000 7 år sedan
förälder
incheckning
e3d19c5b16
1 ändrade filer med 11 tillägg och 0 borttagningar
  1. 11 0
      libobs/callback/calldata.h

+ 11 - 0
libobs/callback/calldata.h

@@ -88,6 +88,17 @@ static inline void calldata_clear(struct calldata *data)
 	}
 }
 
+static inline calldata_t *calldata_create(void)
+{
+	return (calldata_t*)bzalloc(sizeof(struct calldata));
+}
+
+static inline void calldata_destroy(calldata_t *cd)
+{
+	calldata_free(cd);
+	bfree(cd);
+}
+
 /* ------------------------------------------------------------------------- */
 /* NOTE: 'get' functions return true only if parameter exists, and is the
  *       same type.  They return false otherwise. */