Fixed forgotten PID file removal during "Stop".
[udpgate.git] / configure.ac
index d6cc911..5fc889d 100644 (file)
@@ -121,6 +121,42 @@ AH_BOTTOM([
 #define G_LOG_DOMAIN ((const gchar *)"UDPForward")
 
 /**
+ * udpforward_newn:
+ * @objp: Variable with the pointer to the objects wished to be allocated.
+ * Original value is discarded.
+ * @n: Numbers of objects to be allocated. Value %0 is permitted (%NULL assignment effect).
+ *
+ * Macro to allocate @n objects of type *@objp and to assign the resulting pointer to @objp.
+ * Allocated memory may contain garbage.
+ *
+ * @Returns: Initialized @objp value as the memory of size #sizeof(typeof(*objp))*n.
+ * Value %NULL is returned iff @n==%0;
+ */
+#define udpforward_newn(objp,n) ((objp)=g_new(typeof(*(objp)),(n)))
+
+/**
+ * udpforward_new:
+ * @objp: Variable with the pointer to the object wished to be allocated.
+ * Original value is discarded.
+ *
+ * Macro to allocate one object of type *@objp and to assign the resulting pointer to @objp.
+ * Allocated memory may contain garbage. Equivalent to udpforward_newn(objp,1) call.
+ *
+ * @Returns: Initialized @objp value as the memory of size #sizeof(typeof(*objp)).
+ * Value %NULL is never returned.
+ */
+#define udpforward_new(objp) (udpforward_newn((objp),1))
+
+/**
+ * UDPFORWARD_MEMZERO:
+ * @objp: Pointer to the variable to be cleared.
+ *
+ * Clears the sizeof(*@objp) bytes of the given pointer with memset().
+ * Pass _pointer_ to the object to be cleared.
+ */
+#define UDPFORWARD_MEMZERO(objp) (memset((objp),0,sizeof(*(objp))))
+
+/**
  * udpforward_printf_alloca:
  * @format: Format string. See the sprintf() documentation.
  * @args...: Arguments for @format. See the sprintf() documentation.