grammar.y: fix childproxy code
[platform/upstream/gstreamer.git] / gst / parse / types.h
index f992198..3b2e4fd 100644 (file)
@@ -3,10 +3,7 @@
 
 #include <glib-object.h>
 #include "../gstelement.h"
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
+#include "../gstparse.h"
 
 typedef struct {
   GstElement *src;
@@ -31,11 +28,13 @@ struct _graph_t {
   chain_t *chain; /* links are supposed to be done now */
   GSList *links;
   GError **error;
+  GstParseContext *ctx; /* may be NULL */
+  GstParseFlags flags;
 };
 
 
-/*
- * Memory checking. Should probably be done with gsttrace stuff, but that 
+/*
+ * Memory checking. Should probably be done with gsttrace stuff, but that
  * doesn't really work.
  * This is not safe from reentrance issues, but that doesn't matter as long as
  * we lock a mutex before parsing anyway.
@@ -66,4 +65,37 @@ void __gst_parse_chain_free (chain_t *data);
 #  define gst_parse_chain_free g_free
 #endif /* __GST_PARSE_TRACE */
 
+static inline void
+gst_parse_unescape (gchar *str)
+{
+  gchar *walk;
+  gboolean in_quotes;
+
+  g_return_if_fail (str != NULL);
+
+  walk = str;
+  in_quotes = FALSE;
+
+  while (*walk) {
+    if (*walk == '\\' && !in_quotes) {
+      walk++;
+      /* make sure we don't read beyond the end of the string */
+      if (*walk == '\0')
+        break;
+    } else if (*walk == '"' && (!in_quotes || (in_quotes
+                && (*(walk - 1) != '\\')))) {
+      /* don't unescape inside quotes and don't switch
+       * state with escaped quoted inside quotes */
+      in_quotes = !in_quotes;
+    }
+    *str = *walk;
+    str++;
+    walk++;
+  }
+  *str = '\0';
+}
+
+GstElement *priv_gst_parse_launch (const gchar *, GError **,
+    GstParseContext *, GstParseFlags);
+
 #endif /* __GST_PARSE_TYPES_H__ */