本文整理汇总了C++中RB_INIT函数的典型用法代码示例。如果您正苦于以下问题:C++ RB_INIT函数的具体用法?C++ RB_INIT怎么用?C++ RB_INIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RB_INIT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: nwGtpv1uInitialize
NwGtpv1uRcT
nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t stackType)
{
NwGtpv1uRcT rc = NW_GTPV1U_FAILURE;
NwGtpv1uStackT *thiz;
thiz = (NwGtpv1uStackT *) malloc( sizeof(NwGtpv1uStackT));
memset(thiz, 0, sizeof(NwGtpv1uStackT));
if(thiz) {
thiz->id = (NwPtrT)thiz;
thiz->stackType = stackType;
thiz->seq = (uint16_t) ((uint32_t)thiz) ; // FIXME interesting casts... don't know what this is good for...
RB_INIT(&(thiz->outstandingTxSeqNumMap));
RB_INIT(&(thiz->outstandingRxSeqNumMap));
RB_INIT(&(thiz->sessionMap));
RB_INIT(&(thiz->teidMap));
if (0 == 1) {
nwGtpv1uDisplayBanner();
}
rc = NW_GTPV1U_OK;
} else {
rc = NW_GTPV1U_FAILURE;
}
*hGtpuStackHandle = (NwGtpv1uStackHandleT) thiz;
return rc;
}
开发者ID:awesome-security,项目名称:openairinterface5g,代码行数:31,代码来源:NwGtpv1u.c
示例2: idnode_init
void
idnode_init(void)
{
RB_INIT(&idnodes);
RB_INIT(&idclasses);
RB_INIT(&idrootclasses);
}
开发者ID:2crazyzgb,项目名称:tvheadend,代码行数:7,代码来源:idnode.c
示例3: uv__loop_init
int uv__loop_init(uv_loop_t* loop, int default_loop) {
#if HAVE_KQUEUE
int flags = EVBACKEND_KQUEUE;
#else
int flags = EVFLAG_AUTO;
#endif
memset(loop, 0, sizeof(*loop));
RB_INIT(&loop->ares_handles);
RB_INIT(&loop->timer_handles);
ngx_queue_init(&loop->active_reqs);
ngx_queue_init(&loop->idle_handles);
ngx_queue_init(&loop->async_handles);
ngx_queue_init(&loop->check_handles);
ngx_queue_init(&loop->prepare_handles);
ngx_queue_init(&loop->handle_queue);
loop->closing_handles = NULL;
loop->channel = NULL;
loop->time = uv_hrtime() / 1000000;
loop->async_pipefd[0] = -1;
loop->async_pipefd[1] = -1;
loop->ev = (default_loop ? ev_default_loop : ev_loop_new)(flags);
ev_set_userdata(loop->ev, loop);
eio_channel_init(&loop->uv_eio_channel, loop);
#if __linux__
RB_INIT(&loop->inotify_watchers);
loop->inotify_fd = -1;
#endif
#if HAVE_PORTS_FS
loop->fs_fd = -1;
#endif
return 0;
}
开发者ID:reid,项目名称:node,代码行数:35,代码来源:loop.c
示例4: uv_loop_init
static void uv_loop_init(uv_loop_t* loop) {
/* Create an I/O completion port */
loop->iocp = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 1);
if (loop->iocp == NULL) {
uv_fatal_error(GetLastError(), "CreateIoCompletionPort");
}
loop->refs = 0;
uv_update_time(loop);
loop->pending_reqs_tail = NULL;
loop->endgame_handles = NULL;
RB_INIT(&loop->timers);
RB_INIT(&loop->uv_ares_handles_);
loop->check_handles = NULL;
loop->prepare_handles = NULL;
loop->idle_handles = NULL;
loop->next_prepare_handle = NULL;
loop->next_check_handle = NULL;
loop->next_idle_handle = NULL;
loop->ares_active_sockets = 0;
loop->ares_chan = NULL;
loop->active_tcp_streams = 0;
loop->active_udp_streams = 0;
loop->last_err = uv_ok_;
}
开发者ID:mobius,项目名称:libuv,代码行数:34,代码来源:core.c
示例5: s1ap_eNB_handle_register_eNB
void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB)
{
s1ap_eNB_instance_t *new_instance;
uint8_t index;
DevAssert(s1ap_register_eNB != NULL);
/* Look if the provided instance already exists */
new_instance = s1ap_eNB_get_instance(instance);
if (new_instance != NULL) {
/* Checks if it is a retry on the same eNB */
DevCheck(new_instance->eNB_id == s1ap_register_eNB->eNB_id, new_instance->eNB_id, s1ap_register_eNB->eNB_id, 0);
DevCheck(new_instance->cell_type == s1ap_register_eNB->cell_type, new_instance->cell_type, s1ap_register_eNB->cell_type, 0);
DevCheck(new_instance->tac == s1ap_register_eNB->tac, new_instance->tac, s1ap_register_eNB->tac, 0);
DevCheck(new_instance->mcc == s1ap_register_eNB->mcc, new_instance->mcc, s1ap_register_eNB->mcc, 0);
DevCheck(new_instance->mnc == s1ap_register_eNB->mnc, new_instance->mnc, s1ap_register_eNB->mnc, 0);
DevCheck(new_instance->mnc_digit_length == s1ap_register_eNB->mnc_digit_length, new_instance->mnc_digit_length, s1ap_register_eNB->mnc_digit_length, 0);
DevCheck(new_instance->default_drx == s1ap_register_eNB->default_drx, new_instance->default_drx, s1ap_register_eNB->default_drx, 0);
} else {
new_instance = calloc(1, sizeof(s1ap_eNB_instance_t));
DevAssert(new_instance != NULL);
RB_INIT(&new_instance->s1ap_ue_head);
RB_INIT(&new_instance->s1ap_mme_head);
/* Copy usefull parameters */
new_instance->instance = instance;
new_instance->eNB_name = s1ap_register_eNB->eNB_name;
new_instance->eNB_id = s1ap_register_eNB->eNB_id;
new_instance->cell_type = s1ap_register_eNB->cell_type;
new_instance->tac = s1ap_register_eNB->tac;
new_instance->mcc = s1ap_register_eNB->mcc;
new_instance->mnc = s1ap_register_eNB->mnc;
new_instance->mnc_digit_length = s1ap_register_eNB->mnc_digit_length;
new_instance->default_drx = s1ap_register_eNB->default_drx;
/* Add the new instance to the list of eNB (meaningfull in virtual mode) */
s1ap_eNB_insert_new_instance(new_instance);
S1AP_INFO("Registered new eNB[%d] and %s eNB id %u\n",
instance,
s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home",
s1ap_register_eNB->eNB_id);
}
DevCheck(s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS,
S1AP_MAX_NB_MME_IP_ADDRESS, s1ap_register_eNB->nb_mme, 0);
/* Trying to connect to provided list of MME ip address */
for (index = 0; index < s1ap_register_eNB->nb_mme; index++) {
s1ap_eNB_register_mme(new_instance,
&s1ap_register_eNB->mme_ip_address[index],
&s1ap_register_eNB->enb_ip_address,
s1ap_register_eNB->sctp_in_streams,
s1ap_register_eNB->sctp_out_streams);
}
}
开发者ID:ShibinMathew36,项目名称:OAI-step,代码行数:59,代码来源:s1ap_eNB.c
示例6: idnode_init
void
idnode_init(void)
{
idnode_queue = NULL;
RB_INIT(&idnodes);
RB_INIT(&idclasses);
RB_INIT(&idrootclasses);
pthread_mutex_init(&idnode_mutex, NULL);
pthread_cond_init(&idnode_cond, NULL);
tvhthread_create(&idnode_tid, NULL, idnode_thread, NULL);
}
开发者ID:Jalle19,项目名称:tvheadend,代码行数:11,代码来源:idnode.c
示例7: up_down
void
up_down(struct rde_peer *peer)
{
up_clear(&peer->updates, &peer->withdraws);
up_clear(&peer->updates6, &peer->withdraws6);
RB_INIT(&peer->up_prefix);
RB_INIT(&peer->up_attrs);
peer->up_pcnt = 0;
peer->up_acnt = 0;
peer->up_nlricnt = 0;
peer->up_wcnt = 0;
}
开发者ID:Cougar,项目名称:openbgpd-linux-port,代码行数:14,代码来源:rde_update.c
示例8: up_init
void
up_init(struct rde_peer *peer)
{
TAILQ_INIT(&peer->updates);
TAILQ_INIT(&peer->withdraws);
TAILQ_INIT(&peer->updates6);
TAILQ_INIT(&peer->withdraws6);
RB_INIT(&peer->up_prefix);
RB_INIT(&peer->up_attrs);
peer->up_pcnt = 0;
peer->up_acnt = 0;
peer->up_nlricnt = 0;
peer->up_wcnt = 0;
}
开发者ID:Cougar,项目名称:openbgpd-linux-port,代码行数:14,代码来源:rde_update.c
示例9: stp_btm_reset_btm_wq
INT32 stp_btm_reset_btm_wq(MTKSTP_BTM_T *stp_btm)
{
UINT32 i = 0;
osal_lock_unsleepable_lock(&(stp_btm->wq_spinlock));
RB_INIT(&stp_btm->rFreeOpQ, STP_BTM_OP_BUF_SIZE);
RB_INIT(&stp_btm->rActiveOpQ, STP_BTM_OP_BUF_SIZE);
osal_unlock_unsleepable_lock(&(stp_btm->wq_spinlock));
/* Put all to free Q */
for (i = 0; i < STP_BTM_OP_BUF_SIZE; i++) {
osal_signal_init(&(stp_btm->arQue[i].signal));
_stp_btm_put_op(stp_btm, &stp_btm->rFreeOpQ, &(stp_btm->arQue[i]));
}
return 0;
}
开发者ID:John677,项目名称:Kernal_k3note,代码行数:15,代码来源:btm_core.c
示例10: wf2q_init
/*
* This function initializes a wf2q structure
*/
void
wf2q_init(struct wf2q_t *pwf2q)
{
RB_INIT(&pwf2q->wf2q_augtree);
pwf2q->wf2q_virtual_time = 0;
pwf2q->wf2q_tdio_count = 0;
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:10,代码来源:wf2q.c
示例11: ct_file_on_server
/*
* return boolean whether or not the last ctfile_list contained
* filename.
*/
int
ct_file_on_server(struct ct_global_state *state, char *filename)
{
struct ctfile_list_tree results;
struct ctfile_list_file *file = NULL;
char *filelist[2];
int exists = 0;
RB_INIT(&results);
filelist[0] = filename;
filelist[1] = NULL;
ctfile_list_complete(&state->ctfile_list_files, CT_MATCH_GLOB,
filelist, NULL, &results);
/* Check to see if we already have a secrets file on the server */
if (RB_MIN(ctfile_list_tree, &results) != NULL) {
exists = 1;
}
while ((file = RB_ROOT(&results)) != NULL) {
RB_REMOVE(ctfile_list_tree, &results, file);
e_free(&file);
}
return (exists);
}
开发者ID:carriercomm,项目名称:cyphertite,代码行数:29,代码来源:ct_ctfile_remote.c
示例12: watch_set_init
/**
* Initialize the watch set.
*
* @param[in] ws A pointer to the watch set.
**/
void
watch_set_init (watch_set *ws)
{
assert (ws != NULL);
RB_INIT (ws);
}
开发者ID:dmatveev,项目名称:libinotify-kqueue,代码行数:12,代码来源:watch-set.c
示例13: vardb_init
int vardb_init(struct vardb *v)
{
RB_INIT(&v->root);
v->count = 0;
v->external_vardb = NULL;
return 0;
}
开发者ID:naudhr,项目名称:tup,代码行数:7,代码来源:vardb.c
示例14: hammer_clear_undo_history
void
hammer_clear_undo_history(hammer_mount_t hmp)
{
RB_INIT(&hmp->rb_undo_root);
TAILQ_INIT(&hmp->undo_lru_list);
hmp->undo_alloc = 0;
}
开发者ID:wan721,项目名称:DragonFlyBSD,代码行数:7,代码来源:hammer_undo.c
示例15: uv_loop_init
static void uv_loop_init() {
/* Create an I/O completion port */
LOOP->iocp = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 1);
if (LOOP->iocp == NULL) {
uv_fatal_error(GetLastError(), "CreateIoCompletionPort");
}
LOOP->refs = 0;
uv_update_time();
LOOP->pending_reqs_tail = NULL;
LOOP->endgame_handles = NULL;
RB_INIT(&LOOP->timers);
LOOP->check_handles = NULL;
LOOP->prepare_handles = NULL;
LOOP->idle_handles = NULL;
LOOP->next_prepare_handle = NULL;
LOOP->next_check_handle = NULL;
LOOP->next_idle_handle = NULL;
LOOP->last_error = uv_ok_;
LOOP->err_str = NULL;
}
开发者ID:FugueNation,项目名称:node,代码行数:29,代码来源:core.c
示例16: set_defaults
static void
set_defaults(void)
{
u_int8_t *buf;
u_int32_t t = htonl(DEFAULT_LEASE_TIME);
/* Initialize some default timers essential for many clients. */
if ((buf = malloc(1 + sizeof t)) == NULL)
goto nomem;
buf[0] = sizeof t;
memcpy(buf + 1, &t, sizeof t);
default_group.options[DHCP_OPT_ADDR_LEASETIME] = buf;
/* Initialize the default group and shared_network. */
default_group.refcnt = 1;
strlcpy(default_group.name, "default", sizeof "default");
RB_INSERT(group_tree, &groups, &default_group);
default_shared_network.name = "default";
default_shared_network.group = group_use(&default_group);
RB_INIT(&default_shared_network.hosts);
RB_INSERT(shared_network_tree, &shared_networks,
&default_shared_network);
return;
nomem:
fatalx("out of memory really quite soon");
}
开发者ID:gduchene,项目名称:dhcpd,代码行数:29,代码来源:dhcpd.c
示例17: lka_session
void
lka_session(uint64_t id, struct envelope *envelope)
{
struct lka_session *lks;
struct expandnode xn;
if (init == 0) {
init = 1;
tree_init(&sessions);
}
lks = xcalloc(1, sizeof(*lks), "lka_session");
lks->id = id;
RB_INIT(&lks->expand.tree);
TAILQ_INIT(&lks->deliverylist);
tree_xset(&sessions, lks->id, lks);
lks->envelope = *envelope;
TAILQ_INIT(&lks->nodes);
bzero(&xn, sizeof xn);
xn.type = EXPAND_ADDRESS;
xn.u.mailaddr = lks->envelope.rcpt;
lks->expand.rule = NULL;
lks->expand.queue = &lks->nodes;
expand_insert(&lks->expand, &xn);
lka_resume(lks);
}
开发者ID:alexander-naumov,项目名称:OpenSMTPD,代码行数:28,代码来源:lka_session.c
示例18: uvm_objinit
/*
* uvm_objinit: initialise a uvm object.
*/
void
uvm_objinit(struct uvm_object *uobj, struct uvm_pagerops *pgops, int refs)
{
uobj->pgops = pgops;
RB_INIT(&uobj->memt);
uobj->uo_npages = 0;
uobj->uo_refs = refs;
}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:11,代码来源:uvm_object.c
示例19: osal_unsleepable_lock_init
MTKSTP_BTM_T *stp_btm_init(void)
{
INT32 i = 0x0;
INT32 ret =-1;
osal_unsleepable_lock_init(&stp_btm->wq_spinlock);
osal_event_init(&stp_btm->STPd_event);
stp_btm->wmt_notify = wmt_lib_btm_cb;
RB_INIT(&stp_btm->rFreeOpQ, STP_BTM_OP_BUF_SIZE);
RB_INIT(&stp_btm->rActiveOpQ, STP_BTM_OP_BUF_SIZE);
/* Put all to free Q */
for (i = 0; i < STP_BTM_OP_BUF_SIZE; i++)
{
osal_signal_init(&(stp_btm->arQue[i].signal));
_stp_btm_put_op(stp_btm, &stp_btm->rFreeOpQ, &(stp_btm->arQue[i]));
}
/*Generate PSM thread, to servie STP-CORE for packet retrying and core dump receiving*/
stp_btm->BTMd.pThreadData = (VOID *)stp_btm;
stp_btm->BTMd.pThreadFunc = (VOID *)_stp_btm_proc;
osal_memcpy(stp_btm->BTMd.threadName, BTM_THREAD_NAME , osal_strlen(BTM_THREAD_NAME));
ret = osal_thread_create(&stp_btm->BTMd);
if (ret < 0)
{
STP_BTM_ERR_FUNC("osal_thread_create fail...\n");
goto ERR_EXIT1;
}
/* Start STPd thread*/
ret = osal_thread_run(&stp_btm->BTMd);
if(ret < 0)
{
STP_BTM_ERR_FUNC("osal_thread_run FAILS\n");
goto ERR_EXIT1;
}
return stp_btm;
ERR_EXIT1:
return NULL;
}
开发者ID:Lesozav25,项目名称:Newman-N1-JB-Kernel-3.4.11,代码行数:46,代码来源:btm_core.c
示例20: uvm_objinit
/*
* uvm_objinit: initialise a uvm object.
*/
void
uvm_objinit(struct uvm_object *uobj, struct uvm_pagerops *pgops, int refs)
{
uobj->pgops = pgops;
RB_INIT(&uobj->memt);
mtx_init(&uobj->vmobjlock, IPL_NONE);
uobj->uo_npages = 0;
uobj->uo_refs = refs;
}
开发者ID:appleorange1,项目名称:bitrig,代码行数:12,代码来源:uvm_object.c
注:本文中的RB_INIT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论