本文整理汇总了C++中pqueue_free函数的典型用法代码示例。如果您正苦于以下问题:C++ pqueue_free函数的具体用法?C++ pqueue_free怎么用?C++ pqueue_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pqueue_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dtls1_new
int dtls1_new(SSL *s) {
DTLS1_STATE *d1;
if (!ssl3_new(s)) {
return 0;
}
d1 = OPENSSL_malloc(sizeof *d1);
if (d1 == NULL) {
ssl3_free(s);
return 0;
}
memset(d1, 0, sizeof *d1);
d1->buffered_messages = pqueue_new();
d1->sent_messages = pqueue_new();
if (!d1->buffered_messages || !d1->sent_messages) {
pqueue_free(d1->buffered_messages);
pqueue_free(d1->sent_messages);
OPENSSL_free(d1);
ssl3_free(s);
return 0;
}
s->d1 = d1;
/* Set the version to the highest version for DTLS. This controls the initial
* state of |s->enc_method| and what the API reports as the version prior to
* negotiation.
*
* TODO(davidben): This is fragile and confusing. */
s->version = DTLS1_2_VERSION;
return 1;
}
开发者ID:gotomypc,项目名称:tiny-webrtc-gw,代码行数:34,代码来源:d1_lib.c
示例2: DTLS_RECORD_LAYER_new
int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)
{
DTLS_RECORD_LAYER *d;
if ((d = OPENSSL_malloc(sizeof(*d))) == NULL) {
SSLerr(SSL_F_DTLS_RECORD_LAYER_NEW, ERR_R_MALLOC_FAILURE);
return 0;
}
rl->d = d;
d->unprocessed_rcds.q = pqueue_new();
d->processed_rcds.q = pqueue_new();
d->buffered_app_data.q = pqueue_new();
if (d->unprocessed_rcds.q == NULL || d->processed_rcds.q == NULL
|| d->buffered_app_data.q == NULL) {
pqueue_free(d->unprocessed_rcds.q);
pqueue_free(d->processed_rcds.q);
pqueue_free(d->buffered_app_data.q);
OPENSSL_free(d);
rl->d = NULL;
return 0;
}
return 1;
}
开发者ID:Ana06,项目名称:openssl,代码行数:27,代码来源:rec_layer_d1.c
示例3: dtls1_new
int dtls1_new(SSL *ssl) {
DTLS1_STATE *d1;
if (!ssl3_new(ssl)) {
return 0;
}
d1 = OPENSSL_malloc(sizeof *d1);
if (d1 == NULL) {
ssl3_free(ssl);
return 0;
}
memset(d1, 0, sizeof *d1);
d1->buffered_messages = pqueue_new();
d1->sent_messages = pqueue_new();
if (!d1->buffered_messages || !d1->sent_messages) {
pqueue_free(d1->buffered_messages);
pqueue_free(d1->sent_messages);
OPENSSL_free(d1);
ssl3_free(ssl);
return 0;
}
ssl->d1 = d1;
/* Set the version to the highest supported version.
*
* TODO(davidben): Move this field into |s3|, have it store the normalized
* protocol version, and implement this pre-negotiation quirk in |SSL_version|
* at the API boundary rather than in internal state. */
ssl->version = DTLS1_2_VERSION;
return 1;
}
开发者ID:jianglei12138,项目名称:boringssl,代码行数:34,代码来源:d1_lib.c
示例4: DTLS_RECORD_LAYER_new
int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)
{
DTLS_RECORD_LAYER *d;
if ((d = OPENSSL_malloc(sizeof(*d))) == NULL)
return (0);
rl->d = d;
d->unprocessed_rcds.q = pqueue_new();
d->processed_rcds.q = pqueue_new();
d->buffered_app_data.q = pqueue_new();
if (d->unprocessed_rcds.q == NULL || d->processed_rcds.q == NULL
|| d->buffered_app_data.q == NULL) {
pqueue_free(d->unprocessed_rcds.q);
pqueue_free(d->processed_rcds.q);
pqueue_free(d->buffered_app_data.q);
OPENSSL_free(d);
rl->d = NULL;
return (0);
}
return 1;
}
开发者ID:hydnoracoin,项目名称:Open-Source-Cryptocurrency-Exchange,代码行数:25,代码来源:rec_layer_d1.c
示例5: DTLS_RECORD_LAYER_free
void DTLS_RECORD_LAYER_free(RECORD_LAYER *rl)
{
DTLS_RECORD_LAYER_clear(rl);
pqueue_free(rl->d->unprocessed_rcds.q);
pqueue_free(rl->d->processed_rcds.q);
pqueue_free(rl->d->buffered_app_data.q);
OPENSSL_free(rl->d);
rl->d = NULL;
}
开发者ID:Ana06,项目名称:openssl,代码行数:9,代码来源:rec_layer_d1.c
示例6: dtls1_new
int dtls1_new(SSL *s)
{
DTLS1_STATE *d1;
if (!ssl3_new(s))
return (0);
if ((d1 = OPENSSL_malloc(sizeof *d1)) == NULL)
return (0);
memset(d1, 0, sizeof *d1);
/* d1->handshake_epoch=0; */
#if defined(OPENSSL_SYS_VMS) || defined(VMS_TEST)
d1->bitmap.length = 64;
#else
d1->bitmap.length = sizeof(d1->bitmap.map) * 8;
#endif
pq_64bit_init(&(d1->bitmap.map));
pq_64bit_init(&(d1->bitmap.max_seq_num));
d1->next_bitmap.length = d1->bitmap.length;
pq_64bit_init(&(d1->next_bitmap.map));
pq_64bit_init(&(d1->next_bitmap.max_seq_num));
d1->unprocessed_rcds.q = pqueue_new();
d1->processed_rcds.q = pqueue_new();
d1->buffered_messages = pqueue_new();
d1->sent_messages = pqueue_new();
d1->buffered_app_data.q = pqueue_new();
if (s->server) {
d1->cookie_len = sizeof(s->d1->cookie);
}
if (!d1->unprocessed_rcds.q || !d1->processed_rcds.q
|| !d1->buffered_messages || !d1->sent_messages
|| !d1->buffered_app_data.q) {
if (d1->unprocessed_rcds.q)
pqueue_free(d1->unprocessed_rcds.q);
if (d1->processed_rcds.q)
pqueue_free(d1->processed_rcds.q);
if (d1->buffered_messages)
pqueue_free(d1->buffered_messages);
if (d1->sent_messages)
pqueue_free(d1->sent_messages);
if (d1->buffered_app_data.q)
pqueue_free(d1->buffered_app_data.q);
OPENSSL_free(d1);
return (0);
}
s->d1 = d1;
s->method->ssl_clear(s);
return (1);
}
开发者ID:alhazred,项目名称:illumos-extra,代码行数:54,代码来源:d1_lib.c
示例7: tiz_pqueue_destroy
void tiz_pqueue_destroy (tiz_pqueue_t *p_q)
{
if (p_q)
{
assert (p_q->p_first == p_q->p_last);
assert (p_q->p_first == NULL);
assert (p_q->length == 0);
pqueue_free (p_q->p_soa, p_q->pp_store);
pqueue_free (p_q->p_soa, p_q);
}
}
开发者ID:allenk,项目名称:tizonia-openmax-il,代码行数:12,代码来源:tizpqueue.c
示例8: dtls1_free
void dtls1_free(SSL *s)
{
ssl3_free(s);
dtls1_clear_queues(s);
pqueue_free(s->d1->unprocessed_rcds.q);
pqueue_free(s->d1->processed_rcds.q);
pqueue_free(s->d1->buffered_messages);
pqueue_free(s->d1->sent_messages);
pqueue_free(s->d1->buffered_app_data.q);
OPENSSL_free(s->d1);
}
开发者ID:735579768,项目名称:droidVncServer,代码行数:14,代码来源:d1_lib.c
示例9: dtls1_free
void dtls1_free(SSL *s)
{
DTLS_RECORD_LAYER_free(&s->rlayer);
ssl3_free(s);
dtls1_clear_queues(s);
pqueue_free(s->d1->buffered_messages);
pqueue_free(s->d1->sent_messages);
OPENSSL_free(s->d1);
s->d1 = NULL;
}
开发者ID:nicholasmsanford,项目名称:openssl,代码行数:14,代码来源:d1_lib.c
示例10: dtls1_free
void dtls1_free(SSL *s)
{
pitem *item = NULL;
hm_fragment *frag = NULL;
ssl3_free(s);
while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
{
OPENSSL_free(item->data);
pitem_free(item);
}
pqueue_free(s->d1->unprocessed_rcds.q);
while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL)
{
OPENSSL_free(item->data);
pitem_free(item);
}
pqueue_free(s->d1->processed_rcds.q);
while( (item = pqueue_pop(s->d1->buffered_messages)) != NULL)
{
frag = (hm_fragment *)item->data;
OPENSSL_free(frag->fragment);
OPENSSL_free(frag);
pitem_free(item);
}
pqueue_free(s->d1->buffered_messages);
while ( (item = pqueue_pop(s->d1->sent_messages)) != NULL)
{
frag = (hm_fragment *)item->data;
OPENSSL_free(frag->fragment);
OPENSSL_free(frag);
pitem_free(item);
}
pqueue_free(s->d1->sent_messages);
while ( (item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL)
{
frag = (hm_fragment *)item->data;
OPENSSL_free(frag->fragment);
OPENSSL_free(frag);
pitem_free(item);
}
pqueue_free(s->d1->buffered_app_data.q);
OPENSSL_free(s->d1);
}
开发者ID:dienbk7x,项目名称:NetmfSTM32,代码行数:50,代码来源:d1_lib.cpp
示例11: dtls1_free
void dtls1_free(SSL *s) {
ssl3_free(s);
if (s == NULL || s->d1 == NULL) {
return;
}
dtls1_clear_queues(s);
pqueue_free(s->d1->buffered_messages);
pqueue_free(s->d1->sent_messages);
OPENSSL_free(s->d1);
s->d1 = NULL;
}
开发者ID:friends110110,项目名称:boringssl,代码行数:15,代码来源:d1_lib.c
示例12: main
int
main(void)
{
pitem *item;
pqueue pq;
pq = pqueue_new();
item = pitem_new(3, NULL);
pqueue_insert(pq, item);
item = pitem_new(1, NULL);
pqueue_insert(pq, item);
item = pitem_new(2, NULL);
pqueue_insert(pq, item);
item = pqueue_find(pq, 1);
fprintf(stderr, "found %ld\n", item->priority);
item = pqueue_find(pq, 2);
fprintf(stderr, "found %ld\n", item->priority);
item = pqueue_find(pq, 3);
fprintf(stderr, "found %ld\n", item ? item->priority: 0);
pqueue_print(pq);
for(item = pqueue_pop(pq); item != NULL; item = pqueue_pop(pq))
pitem_free(item);
pqueue_free(pq);
return 0;
}
开发者ID:0b10011,项目名称:node,代码行数:34,代码来源:pq_test.c
示例13: dtls1_free
void dtls1_free(SSL *s)
{
pitem *item = NULL;
hm_fragment *frag = NULL;
ssl3_free(s);
while( (item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL)
{
OPENSSL_free(item->data);
pitem_free(item);
}
pqueue_free(s->d1->unprocessed_rcds.q);
while( (item = pqueue_pop(s->d1->processed_rcds.q)) != NULL)
{
OPENSSL_free(item->data);
pitem_free(item);
}
pqueue_free(s->d1->processed_rcds.q);
while( (item = pqueue_pop(s->d1->buffered_messages)) != NULL)
{
frag = (hm_fragment *)item->data;
OPENSSL_free(frag->fragment);
OPENSSL_free(frag);
pitem_free(item);
}
pqueue_free(s->d1->buffered_messages);
while ( (item = pqueue_pop(s->d1->sent_messages)) != NULL)
{
frag = (hm_fragment *)item->data;
OPENSSL_free(frag->fragment);
OPENSSL_free(frag);
pitem_free(item);
}
pqueue_free(s->d1->sent_messages);
pq_64bit_free(&(s->d1->bitmap.map));
pq_64bit_free(&(s->d1->bitmap.max_seq_num));
pq_64bit_free(&(s->d1->next_bitmap.map));
pq_64bit_free(&(s->d1->next_bitmap.max_seq_num));
OPENSSL_free(s->d1);
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:47,代码来源:d1_lib.c
示例14: dtls1_new
int dtls1_new (SSL * s)
{
DTLS1_STATE *d1;
if (!ssl3_new (s))
return (0);
if ((d1 = OPENSSL_malloc (sizeof *d1)) == NULL)
return (0);
memset (d1, 0, sizeof *d1);
/* d1->handshake_epoch=0; */
d1->unprocessed_rcds.q = pqueue_new ();
d1->processed_rcds.q = pqueue_new ();
d1->buffered_messages = pqueue_new ();
d1->sent_messages = pqueue_new ();
d1->buffered_app_data.q = pqueue_new ();
if (s->server)
{
d1->cookie_len = sizeof (s->d1->cookie);
}
d1->link_mtu = 0;
d1->mtu = 0;
if (!d1->unprocessed_rcds.q || !d1->processed_rcds.q
|| !d1->buffered_messages || !d1->sent_messages || !d1->buffered_app_data.q)
{
if (d1->unprocessed_rcds.q)
pqueue_free (d1->unprocessed_rcds.q);
if (d1->processed_rcds.q)
pqueue_free (d1->processed_rcds.q);
if (d1->buffered_messages)
pqueue_free (d1->buffered_messages);
if (d1->sent_messages)
pqueue_free (d1->sent_messages);
if (d1->buffered_app_data.q)
pqueue_free (d1->buffered_app_data.q);
OPENSSL_free (d1);
return (0);
}
s->d1 = d1;
s->method->ssl_clear (s);
return (1);
}
开发者ID:274914765,项目名称:C,代码行数:47,代码来源:d1_lib.c
示例15: dtls1_new
int
dtls1_new(SSL *s)
{
DTLS1_STATE *d1;
if (!ssl3_new(s))
return (0);
if ((d1 = calloc(1, sizeof *d1)) == NULL) {
ssl3_free(s);
return (0);
}
/* d1->handshake_epoch=0; */
d1->unprocessed_rcds.q = pqueue_new();
d1->processed_rcds.q = pqueue_new();
d1->buffered_messages = pqueue_new();
d1->sent_messages = pqueue_new();
d1->buffered_app_data.q = pqueue_new();
if (s->server) {
d1->cookie_len = sizeof(s->d1->cookie);
}
if (!d1->unprocessed_rcds.q || !d1->processed_rcds.q ||
!d1->buffered_messages || !d1->sent_messages ||
!d1->buffered_app_data.q) {
if (d1->unprocessed_rcds.q)
pqueue_free(d1->unprocessed_rcds.q);
if (d1->processed_rcds.q)
pqueue_free(d1->processed_rcds.q);
if (d1->buffered_messages)
pqueue_free(d1->buffered_messages);
if (d1->sent_messages)
pqueue_free(d1->sent_messages);
if (d1->buffered_app_data.q)
pqueue_free(d1->buffered_app_data.q);
free(d1);
ssl3_free(s);
return (0);
}
s->d1 = d1;
s->method->ssl_clear(s);
return (1);
}
开发者ID:Heratom,项目名称:Firefly-project,代码行数:46,代码来源:d1_lib.c
示例16: START_TEST
END_TEST
START_TEST(test_pqueue_free)
{
PriorityQueue *pq = pqueue_new();
ck_assert_msg(pq != NULL, "Priority queue should not be NULL.");
pqueue_free(pq);
}
开发者ID:jmccaffs,项目名称:Systems,代码行数:9,代码来源:public-test.c
示例17: main
int main(void)
{
int i;
int p;
pqueue_t *pq;
node_t *ns;
node_t *n;
/* We will need (N + 1) slots in "pris" vector. Extra one slot for spare
* usages. */
pris = malloc(5 * sizeof(int *));
for (i = 0; i < 5; i++)
pris[i] = malloc(2 * sizeof(int));
pris[0][0] = 4; pris[0][1] = 2;
pris[1][0] = 3; pris[1][1] = 7;
pris[2][0] = 3; pris[2][1] = 1;
pris[3][0] = 5; pris[3][1] = 6;
p = 4; /* Initialize spare slot. */
pq = pqueue_init(10, cmp_pri, get_pri, set_pri, get_pos, set_pos);
ns = malloc(4 * sizeof(node_t));
ns[0].pri = 0; ns[0].val = 0; pqueue_insert(pq, &ns[0]);
ns[1].pri = 1; ns[0].val = 1; pqueue_insert(pq, &ns[1]);
ns[2].pri = 2; ns[0].val = 2; pqueue_insert(pq, &ns[2]);
ns[3].pri = 3; ns[0].val = 3; pqueue_insert(pq, &ns[3]);
printf("initial:\n"); pqueue_print(pq, stdout, pr_node);
n = pqueue_pop(pq);
printf("[pop] pri: %d, val: %d, real-pri: [%d %d]\n",
n->pri, n->val, pris[n->pri][0], pris[n->pri][1]);
printf("after first pop:\n"); pqueue_print(pq, stdout, pr_node);
pris[p][0] = 3; pris[p][1] = 0;
pqueue_change_priority(pq, p, &ns[3]); /* 3: (5,6) -> (3,0) */
p = 3; /* Move spare slot to 3. */
printf("after 3: (5,6) -> (3,0):\n"); pqueue_print(pq, stdout, pr_node);
pris[p][0] = 3; pris[p][1] = -1;
pqueue_change_priority(pq, p, &ns[0]); /* 0: (4,2) -> (3,-1) */
p = 0; /* Move spare slot to 0. */
printf("after 0: (4,2) -> (3,-1):\n"); pqueue_print(pq, stdout, pr_node);
while ((n = pqueue_pop(pq)))
printf("[pop] pri: %d, val: %d, real-pri: [%d %d]\n",
n->pri, n->val, pris[n->pri][0], pris[n->pri][1]);
pqueue_free(pq);
free(ns);
free(pris);
return 0;
}
开发者ID:machicao2013,项目名称:recipes,代码行数:56,代码来源:sample-multiattr.c
示例18: dtls1_free
void dtls1_free(SSL *s)
{
ssl3_free(s);
dtls1_clear_queues(s);
pqueue_free(s->d1->unprocessed_rcds.q);
pqueue_free(s->d1->processed_rcds.q);
pqueue_free(s->d1->buffered_messages);
pqueue_free(s->d1->sent_messages);
pqueue_free(s->d1->buffered_app_data.q);
pq_64bit_free(&(s->d1->bitmap.map));
pq_64bit_free(&(s->d1->bitmap.max_seq_num));
pq_64bit_free(&(s->d1->next_bitmap.map));
pq_64bit_free(&(s->d1->next_bitmap.max_seq_num));
OPENSSL_free(s->d1);
}
开发者ID:RafaelRMachado,项目名称:MinnowBoard,代码行数:20,代码来源:d1_lib.c
示例19: dtls1_free
void
dtls1_free(SSL *s)
{
if (s == NULL)
return;
ssl3_free(s);
dtls1_clear_queues(s);
pqueue_free(D1I(s)->unprocessed_rcds.q);
pqueue_free(D1I(s)->processed_rcds.q);
pqueue_free(D1I(s)->buffered_messages);
pqueue_free(s->d1->sent_messages);
pqueue_free(D1I(s)->buffered_app_data.q);
explicit_bzero(s->d1->internal, sizeof(*s->d1->internal));
free(s->d1->internal);
explicit_bzero(s->d1, sizeof(*s->d1));
free(s->d1);
s->d1 = NULL;
}
开发者ID:2trill2spill,项目名称:nextgen,代码行数:24,代码来源:d1_lib.c
示例20: pqueue_print
void
pqueue_print(pqueue_t *q, FILE *out, pqueue_print_entry_f print)
{
pqueue_t *dup;
void *e;
dup = pqueue_init(q->size, q->cmppri, q->getpri, set_pri,
q->getpos, set_pos);
dup->size = q->size;
dup->avail = q->avail;
dup->step = q->step;
memcpy(dup->d, q->d, (q->size * sizeof(void *)));
while ((e = pqueue_pop(dup))) {
print(out, e);
}
pqueue_free(dup);
}
开发者ID:alexanderhsiang,项目名称:nagios,代码行数:20,代码来源:pqueue.c
注:本文中的pqueue_free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论