gst: sprinkle some G_GNUC_INTERNAL for internal functions
[platform/upstream/gstreamer.git] / gst / parse / types.h
index 205a755..749803c 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <glib-object.h>
 #include "../gstelement.h"
+#include "../gstparse.h"
 
 typedef struct {
   GstElement *src;
@@ -27,6 +28,8 @@ struct _graph_t {
   chain_t *chain; /* links are supposed to be done now */
   GSList *links;
   GError **error;
+  GstParseContext *ctx; /* may be NULL */
+  GstParseFlags flags;
 };
 
 
@@ -41,12 +44,12 @@ struct _graph_t {
 #endif
 
 #ifdef __GST_PARSE_TRACE
-gchar  *__gst_parse_strdup (gchar *org);
-void   __gst_parse_strfree (gchar *str);
-link_t *__gst_parse_link_new ();
-void   __gst_parse_link_free (link_t *data);
-chain_t *__gst_parse_chain_new ();
-void   __gst_parse_chain_free (chain_t *data);
+G_GNUC_INTERNAL  gchar  *__gst_parse_strdup (gchar *org);
+G_GNUC_INTERNAL  void  __gst_parse_strfree (gchar *str);
+G_GNUC_INTERNAL  link_t *__gst_parse_link_new ();
+G_GNUC_INTERNAL  void  __gst_parse_link_free (link_t *data);
+G_GNUC_INTERNAL  chain_t *__gst_parse_chain_new ();
+G_GNUC_INTERNAL  void  __gst_parse_chain_free (chain_t *data);
 #  define gst_parse_strdup __gst_parse_strdup
 #  define gst_parse_strfree __gst_parse_strfree
 #  define gst_parse_link_new __gst_parse_link_new
@@ -66,14 +69,25 @@ 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 == '\\')
+    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++;
@@ -81,4 +95,9 @@ gst_parse_unescape (gchar *str)
   *str = '\0';
 }
 
+G_GNUC_INTERNAL GstElement *priv_gst_parse_launch (const gchar      * str,
+                                                   GError          ** err,
+                                                   GstParseContext  * ctx,
+                                                   GstParseFlags      flags);
+
 #endif /* __GST_PARSE_TYPES_H__ */