Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
d8c887aa
Commit
d8c887aa
authored
Oct 11, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: Added comments about the API
parent
a242f0f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
src/refobject.h
src/refobject.h
+36
-0
No files found.
src/refobject.h
View file @
d8c887aa
...
...
@@ -37,6 +37,15 @@
* as the operation is only defined for it's members.
* REFOBJECT_TO_TYPE(type,x)
* This casts the refobject (x) to the type (type).
* REFOBJECT_FROM_TYPE(x)
* Converts an object to a (refobject_t). This is the inverse of REFOBJECT_TO_TYPE().
* REFOBJECT_GET_TYPENAME(x)
* Get the name of the type of the object.
* REFOBJECT_IS_VALID(x,type)
* This returns true if x is not NULL and of type type.
* REFOBJECT_GET_BASE(x)
* REFOBJECT_GET_TYPE(x)
* Not to be used by the user.
*/
#ifdef HAVE_TYPE_ATTRIBUTE_TRANSPARENT_UNION
#define REFOBJECT_NULL ((refobject_t)(refobject_base_t*)NULL)
...
...
@@ -57,6 +66,33 @@
#define REFOBJECT_IS_VALID(x,type) (!REFOBJECT_IS_NULL((x)) && REFOBJECT_GET_TYPE((x)) == (refobject_type__ ## type))
/* The following macros are used to define types.
*
* REFOBJECT_FORWARD_TYPE(type)
* Adds a forward decleration for the type. This is useful for non private types.
* REFOBJECT_DEFINE_TYPE(type,extras...)
* This defines a public type. One or more of the EXTRA macros be used.
* REFOBJECT_DEFINE_PRIVATE_TYPE(type,extras...)
* Same as REFOBJECT_DEFINE_TYPE() but defines private type.
*
* EXTRA Marcos:
* REFOBJECT_DEFINE_TYPE_FREE(cb)
* This defines a callback to be called when the object is freed.
* cb must be of type refobject_free_t.
* REFOBJECT_DEFINE_TYPE_NEW(cb)
* This defines a callback to be called when a new object is created.
* cb must be of type refobject_new_t.
* REFOBJECT_DEFINE_TYPE_NEW_NOOP()
* This installs a dummy callback for creation. This allows the type
* to be created using refobject_new(type) as with REFOBJECT_DEFINE_TYPE_NEW().
* This is useful for types that do not need to be initialized more than what
* refobject_new() already does.
*
* Other Macros:
* REFOBJECT_CONTROL_VERSION
* REFOBJECT_DEFINE_TYPE__RAW()
* Not to be used by the user.
*/
#define REFOBJECT_CONTROL_VERSION 1
#define REFOBJECT_FORWARD_TYPE(type) extern const refobject_type_t * refobject_type__ ## type;
#define REFOBJECT_DEFINE_TYPE__RAW(type, ...) \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment