Open Broadcaster Software
Free, open source software for live streaming and recording
decl.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Hugh Bailey <obs.jim@gmail.com>
3
*
4
* Permission to use, copy, modify, and distribute this software for any
5
* purpose with or without fee is hereby granted, provided that the above
6
* copyright notice and this permission notice appear in all copies.
7
*
8
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
*/
16
17
#pragma once
18
19
#include "
calldata.h
"
20
#include "../util/darray.h"
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
26
struct
decl_param
{
27
char
*
name
;
28
enum
call_param_type
type
;
29
uint32_t
flags
;
30
};
31
32
static
inline
void
decl_param_free(
struct
decl_param
*param)
33
{
34
if
(param->
name
)
35
bfree
(param->
name
);
36
memset(param, 0,
sizeof
(
struct
decl_param
));
37
}
38
39
struct
decl_info
{
40
char
*
name
;
41
const
char
*
decl_string
;
42
DARRAY
(
struct
decl_param
) params;
43
};
44
45
static
inline
void
decl_info_free(
struct
decl_info
*decl)
46
{
47
if
(decl) {
48
for
(
size_t
i = 0; i < decl->params.num; i++)
49
decl_param_free(decl->params.array + i);
50
da_free
(decl->params);
51
52
bfree
(decl->
name
);
53
memset(decl, 0,
sizeof
(
struct
decl_info
));
54
}
55
}
56
57
EXPORT
bool
parse_decl_string
(
struct
decl_info
*decl,
const
char
*decl_string);
58
59
#ifdef __cplusplus
60
}
61
#endif
bfree
EXPORT void bfree(void *ptr)
EXPORT
#define EXPORT
Definition:
c99defs.h:37
decl_param::type
enum call_param_type type
Definition:
decl.h:28
da_free
#define da_free(v)
Definition:
darray.h:467
decl_param::flags
uint32_t flags
Definition:
decl.h:29
call_param_type
call_param_type
Definition:
calldata.h:34
decl_info::name
char * name
Definition:
decl.h:40
decl_info::DARRAY
DARRAY(struct decl_param) params
calldata.h
decl_param::name
char * name
Definition:
decl.h:27
decl_param
Definition:
decl.h:26
parse_decl_string
EXPORT bool parse_decl_string(struct decl_info *decl, const char *decl_string)
decl_info::decl_string
const char * decl_string
Definition:
decl.h:41
decl_info
Definition:
decl.h:39
libobs
callback
decl.h
Generated on Sat Sep 26 2020 00:00:00 for Open Broadcaster Software by
1.8.20