*.h: Revert indentation changes.
[platform/upstream/gstreamer.git] / gst / parse / types.h
1 #ifndef __GST_PARSE_TYPES_H__
2 #define __GST_PARSE_TYPES_H__
3
4 #include <glib-object.h>
5 #include "../gstelement.h"
6
7 #ifdef HAVE_CONFIG_H
8 #  include "config.h"
9 #endif
10
11 typedef struct
12 {
13   GstElement *src;
14   GstElement *sink;
15   gchar *src_name;
16   gchar *sink_name;
17   GSList *src_pads;
18   GSList *sink_pads;
19   GstCaps *caps;
20 }
21 link_t;
22
23 typedef struct
24 {
25   GSList *elements;
26   GstElement *first;
27   GstElement *last;
28   link_t *front;
29   link_t *back;
30 }
31 chain_t;
32
33 typedef struct _graph_t graph_t;
34 struct _graph_t
35 {
36   chain_t *chain;               /* links are supposed to be done now */
37   GSList *links;
38   GError **error;
39 };
40
41
42 /* 
43  * Memory checking. Should probably be done with gsttrace stuff, but that 
44  * doesn't really work.
45  * This is not safe from reentrance issues, but that doesn't matter as long as
46  * we lock a mutex before parsing anyway.
47  */
48 #ifdef GST_DEBUG_ENABLED
49 #  define __GST_PARSE_TRACE
50 #endif
51
52 #ifdef __GST_PARSE_TRACE
53 gchar *__gst_parse_strdup (gchar * org);
54 void __gst_parse_strfree (gchar * str);
55 link_t *__gst_parse_link_new ();
56 void __gst_parse_link_free (link_t * data);
57 chain_t *__gst_parse_chain_new ();
58 void __gst_parse_chain_free (chain_t * data);
59
60 #  define gst_parse_strdup __gst_parse_strdup
61 #  define gst_parse_strfree __gst_parse_strfree
62 #  define gst_parse_link_new __gst_parse_link_new
63 #  define gst_parse_link_free __gst_parse_link_free
64 #  define gst_parse_chain_new __gst_parse_chain_new
65 #  define gst_parse_chain_free __gst_parse_chain_free
66 #else /* __GST_PARSE_TRACE */
67 #  define gst_parse_strdup g_strdup
68 #  define gst_parse_strfree g_free
69 #  define gst_parse_link_new() g_new0 (link_t, 1)
70 #  define gst_parse_link_free g_free
71 #  define gst_parse_chain_new() g_new0 (chain_t, 1)
72 #  define gst_parse_chain_free g_free
73 #endif /* __GST_PARSE_TRACE */
74
75 static inline void
76 gst_parse_unescape (gchar * str)
77 {
78   gchar *walk;
79
80   g_return_if_fail (str != NULL);
81
82   walk = str;
83
84   while (*walk) {
85     if (*walk == '\\')
86       walk++;
87     *str = *walk;
88     str++;
89     walk++;
90   }
91   *str = '\0';
92 }
93
94 #endif /* __GST_PARSE_TYPES_H__ */