Commit 7313da83 authored by Dafydd Harries's avatar Dafydd Harries

add typedefs for enums

darcs-hash:20070109204149-c9803-66fbb9acf78bb14e0b202f5cef5fd0dadee90cd8.gz
parent e93c256b
...@@ -22,7 +22,7 @@ enum address_type ...@@ -22,7 +22,7 @@ enum address_type
struct _address struct _address
{ {
enum address_type type; AddressType type;
union union
{ {
guint32 addr_ipv4; guint32 addr_ipv4;
...@@ -131,7 +131,7 @@ address_is_private (Address *a) ...@@ -131,7 +131,7 @@ address_is_private (Address *a)
Candidate * Candidate *
candidate_new (enum candidate_type type) candidate_new (CandidateType type)
{ {
Candidate *candidate; Candidate *candidate;
...@@ -158,6 +158,9 @@ candidate_free (Candidate *candidate) ...@@ -158,6 +158,9 @@ candidate_free (Candidate *candidate)
* obtain a candidate for it. If an agent is using both RTP and RTCP, it * obtain a candidate for it. If an agent is using both RTP and RTCP, it
* would end up with 2*K host candidates if an agent has K interfaces. * would end up with 2*K host candidates if an agent has K interfaces.
*/ */
typedef enum component_type ComponentType;
enum component_type enum component_type
{ {
COMPONENT_TYPE_RTP, COMPONENT_TYPE_RTP,
...@@ -169,13 +172,13 @@ typedef struct _component Component; ...@@ -169,13 +172,13 @@ typedef struct _component Component;
struct _component struct _component
{ {
enum component_type type; ComponentType type;
guint id; guint id;
}; };
static Component * static Component *
component_new (enum component_type type) component_new (ComponentType type)
{ {
Component *component; Component *component;
...@@ -199,14 +202,14 @@ typedef struct _stream Stream; ...@@ -199,14 +202,14 @@ typedef struct _stream Stream;
struct _stream struct _stream
{ {
enum media_type type; MediaType type;
/* XXX: streams can have multiple components */ /* XXX: streams can have multiple components */
Component *component; Component *component;
}; };
Stream * Stream *
stream_new (enum media_type type) stream_new (MediaType type)
{ {
Stream *stream; Stream *stream;
...@@ -237,6 +240,8 @@ struct _candidate_pair ...@@ -237,6 +240,8 @@ struct _candidate_pair
}; };
typedef enum check_state CheckState;
/* ICE12 §6.7 (p24) */ /* ICE12 §6.7 (p24) */
enum check_state enum check_state
{ {
...@@ -248,6 +253,8 @@ enum check_state ...@@ -248,6 +253,8 @@ enum check_state
}; };
typedef enum check_list_state CheckListState;
enum check_list_state enum check_list_state
{ {
CHECK_LIST_STATE_RUNNING, CHECK_LIST_STATE_RUNNING,
...@@ -286,7 +293,7 @@ candidate_pair_priority ( ...@@ -286,7 +293,7 @@ candidate_pair_priority (
static Event * static Event *
event_new (enum event_type type) event_new (EventType type)
{ {
Event *ev; Event *ev;
...@@ -378,7 +385,7 @@ ice_agent_push_event (Agent *agent, Event *ev) ...@@ -378,7 +385,7 @@ ice_agent_push_event (Agent *agent, Event *ev)
//void //void
//ice_agent_add_component (enum media_type type) //ice_agent_add_component (MediaType type)
//{ //{
// /* generate candidates for component × local interfaces */ // /* generate candidates for component × local interfaces */
//} //}
...@@ -428,7 +435,7 @@ ice_agent_set_candidate_port (Agent *agent, guint candidate_id, guint port) ...@@ -428,7 +435,7 @@ ice_agent_set_candidate_port (Agent *agent, guint candidate_id, guint port)
void void
ice_agent_add_stream (Agent *agent, enum media_type type) ice_agent_add_stream (Agent *agent, MediaType type)
{ {
Stream *stream; Stream *stream;
GSList *i; GSList *i;
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
#ifndef _AGENT_H #ifndef _AGENT_H
#define _AGENT_H #define _AGENT_H
typedef enum media_type MediaType;
enum media_type enum media_type
{ {
MEDIA_TYPE_AUDIO, MEDIA_TYPE_AUDIO,
...@@ -25,6 +27,7 @@ address_free (Address *addr); ...@@ -25,6 +27,7 @@ address_free (Address *addr);
/*** candidate ***/ /*** candidate ***/
typedef enum candidate_type CandidateType;
enum candidate_type enum candidate_type
{ {
...@@ -39,7 +42,7 @@ typedef struct _candidate Candidate; ...@@ -39,7 +42,7 @@ typedef struct _candidate Candidate;
struct _candidate struct _candidate
{ {
enum candidate_type type; CandidateType type;
guint id; guint id;
Address *addr; Address *addr;
Address *base_addr; Address *base_addr;
...@@ -56,6 +59,8 @@ struct _candidate ...@@ -56,6 +59,8 @@ struct _candidate
/*** event ***/ /*** event ***/
typedef enum event_type EventType;
enum event_type enum event_type
{ {
EVENT_REQUEST_PORT, EVENT_REQUEST_PORT,
...@@ -69,7 +74,7 @@ typedef struct _event Event; ...@@ -69,7 +74,7 @@ typedef struct _event Event;
struct _event struct _event
{ {
enum event_type type; EventType type;
union { union {
struct { struct {
...@@ -112,7 +117,7 @@ ice_agent_pop_event (Agent *agent); ...@@ -112,7 +117,7 @@ ice_agent_pop_event (Agent *agent);
void void
ice_agent_add_local_address (Agent *agent, Address *addr); ice_agent_add_local_address (Agent *agent, Address *addr);
void void
ice_agent_add_stream (Agent *agent, enum media_type type); ice_agent_add_stream (Agent *agent, MediaType type);
void void
ice_agent_set_candidate_port (Agent *agent, guint candidate_id, guint port); ice_agent_set_candidate_port (Agent *agent, guint candidate_id, guint port);
void void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment