[Swfdec] Branch 'as' - 2 commits - doc/swfdec-sections.txt libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
Benjamin Otte
company at kemper.freedesktop.org
Thu Jun 28 10:27:11 PDT 2007
doc/swfdec-sections.txt | 25 +++++++++-
libswfdec/swfdec_as_types.c | 102 +++++++++++++++++++++++++++++++++++++++++++-
libswfdec/swfdec_as_types.h | 2
3 files changed, 125 insertions(+), 4 deletions(-)
New commits:
diff-tree f810682741113c7fb94a6a830233ae0d02833c39 (from 9def436251dc7670dfddb9aaca9d7f866a6e0942)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jun 28 19:27:11 2007 +0200
document the macros
diff --git a/doc/swfdec-sections.txt b/doc/swfdec-sections.txt
index 30ac93b..4d93f11 100644
--- a/doc/swfdec-sections.txt
+++ b/doc/swfdec-sections.txt
@@ -184,10 +184,31 @@ SWFDEC_TYPE_GTK_LOADER
<TITLE>SwfdecAsValue</TITLE>
SwfdecAsValueType
SwfdecAsValue
+SWFDEC_AS_VALUE_SET_UNDEFINED
+SWFDEC_AS_VALUE_GET_BOOLEAN
swfdec_as_value_to_boolean
-swfdec_as_value_to_integer
+SWFDEC_AS_VALUE_SET_BOOLEAN
+SWFDEC_AS_VALUE_GET_NUMBER
swfdec_as_value_to_number
+swfdec_as_value_to_integer
+SWFDEC_AS_VALUE_SET_INT
+SWFDEC_AS_VALUE_SET_NUMBER
+SWFDEC_AS_VALUE_GET_STRING
+swfdec_as_value_to_string
+SWFDEC_AS_VALUE_SET_STRING
+SWFDEC_AS_VALUE_SET_NULL
+SWFDEC_AS_VALUE_GET_OBJECT
swfdec_as_value_to_object
+SWFDEC_AS_VALUE_SET_OBJECT
swfdec_as_value_to_primitive
-swfdec_as_value_to_string
+swfdec_as_double_to_string
+swfdec_as_str_concat
+<SUBSECTION Standard>
+SWFDEC_IS_AS_VALUE
+SWFDEC_AS_VALUE_IS_UNDEFINED
+SWFDEC_AS_VALUE_IS_BOOLEAN
+SWFDEC_AS_VALUE_IS_NUMBER
+SWFDEC_AS_VALUE_IS_STRING
+SWFDEC_AS_VALUE_IS_NULL
+SWFDEC_AS_VALUE_IS_OBJECT
</SECTION>
diff --git a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c
index 6b8f3a5..504245d 100644
--- a/libswfdec/swfdec_as_types.c
+++ b/libswfdec/swfdec_as_types.c
@@ -40,7 +40,7 @@
* @short_description: exchanging values with the Actionscript engine
*
* This section describes how values are handled inside the Actionscript
- * engine. Sice Actionscript is a dynamically typed language, the variable type
+ * engine. Since Actionscript is a dynamically typed language, the variable type
* has to be carried with every value. #SwfdecAsValue accomplishes that. Swfdec
* allows two possible ways of accessing these values: The common method is to
* use the provided functions to explicitly convert the values to a given type
@@ -80,6 +80,106 @@
* <note>If you memset a SwfdecAsValue to 0, it is a valid undefined value.</note>
*/
+/**
+ * SWFDEC_AS_VALUE_SET_UNDEFINED:
+ * @val: value to set as undefined
+ *
+ * Sets @val to the special undefined value. If you create a temporary value,
+ * you can instead use code such as |[ SwfdecAsValue val = { 0, }; ]|
+ */
+
+/**
+ * SWFDEC_AS_VALUE_GET_BOOLEAN:
+ * @val: value to get, the value must reference a boolean
+ *
+ * Gets the boolean associated with value. If you are not sure if the value is
+ * a boolean, use swfdec_as_value_to_boolean () instead.
+ *
+ * Returns: %TRUE or %FALSE
+ */
+
+/**
+ * SWFDEC_AS_VALUE_SET_BOOLEAN:
+ * @val: value to set
+ * @b: boolean value to set, must be either %TRUE or %FALSE
+ *
+ * Sets @val to the specified boolean value.
+ */
+
+/**
+ * SWFDEC_AS_VALUE_GET_NUMBER:
+ * @val: value to get, the value must reference a number
+ *
+ * Gets the number associated with @val. If you are not sure that the value is
+ * a valid number value, consider using swfdec_as_value_to_number() or
+ * swfdec_as_value_to_int() instead.
+ *
+ * Returns: a double. It can be NaN or +-Infinity, but not -0.0
+ */
+
+/**
+ * SWFDEC_AS_VALUE_SET_NUMBER:
+ * @val: value to set
+ * @d: double value to set
+ *
+ * Sets @val to the given value. If you are sure the value is a valid
+ * integer value, use SWFDEC_AS_VALUE_SET_INT() instead.
+ */
+
+/**
+ * SWFDEC_AS_VALUE_SET_INT:
+ * @val: value to set
+ * @d: integer value to set
+ *
+ * Sets @val to the given value. Currently this macro is equivalent to
+ * SWFDEC_AS_VALUE_SET_NUMBER(), but this may change in future versions of
+ * Swfdec.
+ */
+
+/**
+ * SWFDEC_AS_VALUE_GET_STRING:
+ * @val: value to get, the value must reference a string
+ *
+ * Gets the string associated with @val. If you are not sure that the value is
+ * a string value, consider using swfdec_as_value_to_string() instead.
+ *
+ * Returns: a garbage-collected string.
+ */
+
+/**
+ * SWFDEC_AS_VALUE_SET_STRING:
+ * @val: value to set
+ * @s: garbage-collected string to use
+ *
+ * Sets @val to the given string value.
+ */
+
+/**
+ * SWFDEC_AS_VALUE_SET_NULL:
+ * @val: value to set
+ *
+ * Sets @val to the special null value.
+ */
+
+/**
+ * SWFDEC_AS_VALUE_GET_OBJECT:
+ * @val: value to get, the value must reference an object
+ *
+ * Gets the object associated with @val. If you are not sure that the value is
+ * an object value, consider using swfdec_as_value_to_object() instead.
+ *
+ * Returns: a #SwfdecAsObject
+ */
+
+/**
+ * SWFDEC_AS_VALUE_SET_OBJECT:
+ * @val: value to set
+ * @o: garbage-collected #SwfdecAsObject to use
+ *
+ * Sets @val to the given object. The object must have been added to the
+ * garbage collector via swfdec_as_object_add() previously.
+ */
+
/*** actual code ***/
/**
diff-tree 9def436251dc7670dfddb9aaca9d7f866a6e0942 (from afacd9f6211b9b43e2ea1ef808fc612ba92b3cce)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Jun 28 19:27:01 2007 +0200
change macro for better documentation
Probably also improves error messages by some compilers
diff --git a/libswfdec/swfdec_as_types.h b/libswfdec/swfdec_as_types.h
index 757958f..2a8cb79 100644
--- a/libswfdec/swfdec_as_types.h
+++ b/libswfdec/swfdec_as_types.h
@@ -86,7 +86,7 @@ struct _SwfdecAsValue {
(__val)->type = SWFDEC_AS_TYPE_NUMBER; \
} G_STMT_END
-#define SWFDEC_AS_VALUE_SET_INT SWFDEC_AS_VALUE_SET_NUMBER
+#define SWFDEC_AS_VALUE_SET_INT(val,d) SWFDEC_AS_VALUE_SET_NUMBER(val,d)
#define SWFDEC_AS_VALUE_IS_STRING(val) ((val)->type == SWFDEC_AS_TYPE_STRING)
#define SWFDEC_AS_VALUE_GET_STRING(val) ((val)->value.string)
More information about the Swfdec
mailing list