本文整理汇总了C++中re_printf函数的典型用法代码示例。如果您正苦于以下问题:C++ re_printf函数的具体用法?C++ re_printf怎么用?C++ re_printf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了re_printf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: agent_gather
void agent_gather(struct agent *ag)
{
int err;
if (!ag)
return;
net_if_apply(interface_handler, ag);
re_printf("HOST gathering complete (interfaces = %u)\n",
ag->interfacec);
if (is_gathering_complete(ag)) {
re_printf("local candidate gathering completed"
" -- sending EOC\n");
ag->local_eoc = true;
err = control_send_message(ag->cli, "a=end-of-candidates\r\n");
if (err) {
re_fprintf(stderr, "failed to send EOC\n");
}
}
}
开发者ID:alfredh,项目名称:reicec,代码行数:25,代码来源:agent.c
示例2: close_handler
static void close_handler(int err, const struct sip_msg *msg,
const struct sipevent_substate *substate, void *arg)
{
struct presence *pres = arg;
uint32_t wait;
pres->sub = mem_deref(pres->sub);
(void)re_printf("presence: subscriber closed <%r>: ",
&contact_addr(pres->contact)->auri);
if (substate) {
(void)re_printf("%s", sipevent_reason_name(substate->reason));
wait = wait_term(substate);
}
else if (msg) {
(void)re_printf("%u %r", msg->scode, &msg->reason);
wait = wait_fail(++pres->failc);
}
else {
(void)re_printf("%m", err);
wait = wait_fail(++pres->failc);
}
(void)re_printf("; will retry in %u secs (failc=%u)\n",
wait, pres->failc);
tmr_start(&pres->tmr, wait * 1000, tmr_handler, pres);
contact_set_presence(pres->contact, PRESENCE_UNKNOWN);
}
开发者ID:mralexgray,项目名称:baresip,代码行数:31,代码来源:subscriber.c
示例3: device_connect
static void device_connect(struct device *device, struct device *peer_device)
{
struct peer *peer;
ASSERT_TRUE(device != NULL);
ASSERT_TRUE(peer_device != NULL);
#if 0
re_printf("@@@ connect %s ----> %s\n",
device->name, peer_device->name);
#endif
peer = device_find_peer(device, peer_device);
if (peer) {
re_printf("device %s already connected to %s\n",
device->name, peer_device->name);
}
ASSERT_TRUE(peer == NULL);
peer = (struct peer *)mem_zalloc(sizeof(*peer), peer_destructor);
ASSERT_TRUE(peer != NULL);
peer->device = peer_device;
rand_str(peer->sid, sizeof(peer->sid));
list_append(&device->peerl, &peer->le, peer);
}
开发者ID:LampmanYao,项目名称:wire-audio-video-signaling,代码行数:29,代码来源:test_cryptobox.cpp
示例4: dns_handler
static void dns_handler(int err, const struct dnshdr *hdr, struct list *ansl,
struct list *authl, struct list *addl, void *arg)
{
struct rst *rst = arg;
struct dnsrr *rr;
struct sa srv;
(void)err;
(void)hdr;
(void)authl;
(void)addl;
rr = dns_rrlist_find(ansl, rst->host, DNS_TYPE_A, DNS_CLASS_IN, true);
if (!rr) {
re_printf("rst: unable to resolve: %s\n", rst->host);
tmr_start(&rst->tmr, RETRY_WAIT, reconnect, rst);
return;
}
sa_set_in(&srv, rr->rdata.a.addr, rst->port);
err = tcp_connect(&rst->tc, &srv, estab_handler, recv_handler,
close_handler, rst);
if (err) {
re_printf("rst: tcp connect error: %m\n", err);
tmr_start(&rst->tmr, RETRY_WAIT, reconnect, rst);
return;
}
}
开发者ID:Studio-Link,项目名称:baresip_old,代码行数:29,代码来源:rst.c
示例5: stun_dns_handler
static void stun_dns_handler(int err, const struct sa *srv, void *arg)
{
struct candidate *cand = arg;
if (err) {
re_fprintf(stderr, "could not resolve STUN server (%m)\n",
err);
candidate_done(cand);
return;
}
switch (cand->type) {
case TYPE_STUN:
re_printf("resolved STUN-server (%J)\n", srv);
cand->stun_srv = *srv;
gather_srflx2(cand, cand->base->attr.proto);
break;
case TYPE_TURN:
re_printf("resolved TURN-server (%J)\n", srv);
cand->turn_srv = *srv;
gather_relay2(cand, cand->turn_proto);
break;
default:
re_printf("unknown type\n");
break;
}
}
开发者ID:alfredh,项目名称:reicec,代码行数:30,代码来源:agent.c
示例6: allocator_print_statistics
void allocator_print_statistics(const struct allocator *allocator)
{
struct le *le;
double amin = 99999999, amax = 0, asum = 0, aavg;
int ix_min = -1, ix_max = -1;
/* show allocation summary */
if (!allocator || !allocator->num_sent)
return;
for (le = allocator->allocl.head; le; le = le->next) {
struct allocation *alloc = le->data;
if (alloc->atime < amin) {
amin = alloc->atime;
ix_min = alloc->ix;
}
if (alloc->atime > amax) {
amax = alloc->atime;
ix_max = alloc->ix;
}
asum += alloc->atime;
}
aavg = asum / allocator->num_sent;
re_printf("\nAllocation time statistics:\n");
re_printf("min: %.1f ms (allocation #%d)\n", amin, ix_min);
re_printf("avg: %.1f ms\n", aavg);
re_printf("max: %.1f ms (allocation #%d)\n", amax, ix_max);
re_printf("\n");
}
开发者ID:alfredh,项目名称:turnperf,代码行数:34,代码来源:allocation.c
示例7: tcp_estab_handler
/* shared between STUN and TURN */
static void tcp_estab_handler(void *arg)
{
struct candidate *cand = arg;
int err;
re_printf("TCP established to STUN/TURN-server\n");
switch (cand->type) {
case TYPE_STUN:
err = stun_request(NULL, cand->ag->stun, IPPROTO_TCP,
cand->tc, NULL, 0, STUN_METHOD_BINDING,
NULL, 0, false,
stun_resp_handler, cand, 0);
if (err) {
re_printf("tcp: stun_request failed (%m)\n", err);
}
break;
case TYPE_TURN:
err = turnc_alloc(&cand->turnc, NULL, IPPROTO_TCP,
cand->tc, LAYER_TURN, &cand->turn_srv,
cand->ag->cli->param.username,
cand->ag->cli->param.password,
TURN_DEFAULT_LIFETIME, turnc_handler, cand);
if (err) {
re_printf("tcp: turn client: %m\n", err);
}
break;
}
}
开发者ID:alfredh,项目名称:reicec,代码行数:32,代码来源:agent.c
示例8: odict_compare
/* return TRUE if equal */
bool odict_compare(const struct odict *dict1, const struct odict *dict2)
{
struct le *le1, *le2;
if (!dict1 || !dict2)
return false;
if (odict_count(dict1, true) != odict_count(dict2, true)) {
re_printf("count mismatch\n");
return false;
}
for (le1 = dict1->lst.head, le2 = dict2->lst.head;
le1 && le2;
le1 = le1->next, le2 = le2->next) {
struct odict_entry *e1 = le1->data;
struct odict_entry *e2 = le2->data;
if (0 != str_cmp(e1->key, e2->key)) {
re_printf("key mismatch\n");
re_printf("(%s) %r\n", e1->key);
re_printf("(%s) %r\n", e2->key);
return false;
}
if (!odict_value_compare(e1, e2))
return false;
}
return true; /* equal */
}
开发者ID:traviscross,项目名称:libre-test,代码行数:33,代码来源:util.c
示例9: tls_endpoint_estab_handler
static void tls_endpoint_estab_handler(const char *cipher, void *arg)
{
int err;
(void)arg;
re_fprintf(stderr, "\r[ %u .. %c ]",
tlsperf.count,
0x20 + tlsperf.count % 0x60);
if (tls_endpoint_established(tlsperf.ep_cli) &&
tls_endpoint_established(tlsperf.ep_srv)) {
if (tlsperf.count >= tlsperf.num) {
tlsperf.ts_estab = tmr_jiffies();
re_printf("\nDONE!\n");
re_printf("cipher: %s\n", cipher);
print_report();
re_cancel();
}
else {
stop_test();
err = start_test();
if (err)
abort_test(err);
}
}
}
开发者ID:jamella,项目名称:tlsperf,代码行数:30,代码来源:main.c
示例10: sip_msg_dump
/**
* Print a SIP Message to stdout
*
* @param msg SIP Message
*/
void sip_msg_dump(const struct sip_msg *msg)
{
struct le *le;
uint32_t i;
if (!msg)
return;
for (i=0; i<HDR_HASH_SIZE; i++) {
le = list_head(hash_list(msg->hdrht, i));
while (le) {
const struct sip_hdr *hdr = le->data;
le = le->next;
(void)re_printf("%02u '%r'='%r'\n", i, &hdr->name,
&hdr->val);
}
}
le = list_head(&msg->hdrl);
while (le) {
const struct sip_hdr *hdr = le->data;
le = le->next;
(void)re_printf("%02u '%r'='%r'\n", hdr->id, &hdr->name,
&hdr->val);
}
}
开发者ID:Issic47,项目名称:libre,代码行数:38,代码来源:msg.c
示例11: estab_handler
static void estab_handler(void *arg)
{
struct rst *rst = arg;
struct mbuf *mb;
int err;
re_printf("rst: connection established\n");
mb = mbuf_alloc(512);
if (!mb) {
err = ENOMEM;
goto out;
}
err = mbuf_printf(mb,
"GET %s HTTP/1.0\r\n"
"Icy-MetaData: 1\r\n"
"\r\n",
rst->path);
if (err)
goto out;
mb->pos = 0;
err = tcp_send(rst->tc, mb);
if (err)
goto out;
out:
if (err) {
re_printf("rst: error sending HTTP request: %m\n", err);
}
mem_deref(mb);
}
开发者ID:Studio-Link,项目名称:baresip_old,代码行数:35,代码来源:rst.c
示例12: offer_handler
/*
* called when an SDP offer is received (got offer: true) or
* when an offer is to be sent (got_offer: false)
*/
static int offer_handler(struct mbuf **mbp, const struct sip_msg *msg,
void *arg)
{
const bool got_offer = mbuf_get_left(msg->mb);
int err;
(void)arg;
if (got_offer) {
err = sdp_decode(sdp, msg->mb, true);
if (err) {
re_fprintf(stderr, "unable to decode SDP offer: %s\n",
strerror(err));
return err;
}
re_printf("SDP offer received\n");
update_media();
}
else {
re_printf("sending SDP offer\n");
}
return sdp_encode(mbp, sdp, !got_offer);
}
开发者ID:chk-jxcn,项目名称:redemo,代码行数:29,代码来源:sip_ua.c
示例13: gather_srflx2
static int gather_srflx2(struct candidate *cand, int proto)
{
struct ice_lcand *base = cand->base;
int err;
switch (proto) {
case IPPROTO_UDP:
err = stun_keepalive_alloc(&cand->ska, proto,
base->us, LAYER_STUN,
&cand->stun_srv,
NULL,
stun_mapped_handler, cand);
if (err) {
re_printf("stun_request failed (%m)\n", err);
}
stun_keepalive_enable(cand->ska, 25);
break;
case IPPROTO_TCP:
/* for TCP we must connect FROM the locally bound
socket (either passive or S-O) */
re_printf("SRFLX tcp connecting.. %J -> %J\n",
&base->attr.addr, &cand->stun_srv);
err = tcp_conn_alloc(&cand->tc, &cand->stun_srv,
tcp_estab_handler, tcp_recv_handler,
tcp_close_handler, cand);
if (err) {
re_fprintf(stderr, "tcp_conn_alloc failed (%m)\n",
err);
return err;
}
err = tcp_conn_bind(cand->tc, &base->attr.addr);
if (err) {
re_fprintf(stderr, "tcp_conn_bind to %J failed"
" (%m)\n",
&base->attr.addr, err);
return err;
}
err = tcp_conn_connect(cand->tc, &cand->stun_srv);
if (err) {
re_fprintf(stderr, "tcp_conn_connect to %J failed"
" (%m)\n",
err, &cand->stun_srv);
return err;
}
break;
default:
return EPROTONOSUPPORT;
}
return 0;
}
开发者ID:alfredh,项目名称:reicec,代码行数:59,代码来源:agent.c
示例14: read_wav
static int read_wav(kiss_fftr_cfg fft, const char *infile)
{
struct aufile *af_in = NULL;
struct aufile_prm prm;
size_t sampc_in_total = 0;
size_t i;
int err;
err = aufile_open(&af_in, &prm, infile, AUFILE_READ);
if (err) {
re_fprintf(stderr, "%s: could not open input file (%m)\n",
infile, err);
goto out;
}
if (prm.fmt != AUFMT_S16LE) {
err = EINVAL;
goto out;
}
re_printf("%s: %u Hz, %d channels\n", infile, prm.srate, prm.channels);
for (;;) {
int16_t sampv[NUM_FFT];
size_t sz = sizeof(sampv);
kiss_fft_cpx freqv[NUM_FREQ];
err = aufile_read(af_in, (void *)sampv, &sz);
if (err || !sz)
break;
if (sz != sizeof(sampv)) {
re_printf("skipping last %zu samples\n", sz);
break;
}
sampc_in_total += (sz/2);
/* do FFT transform */
kiss_fftr(fft, sampv, freqv);
for (i=0; i<ARRAY_SIZE(freqv); i++) {
kiss_fft_cpx cpx = freqv[i];
magv[i] += sqrt(cpx.r * cpx.r + cpx.i * cpx.i);
}
}
re_printf("read %u samples\n", sampc_in_total);
out:
if (err) {
re_fprintf(stderr, "file read error: %m\n", err);
}
mem_deref(af_in);
return err;
}
开发者ID:Jackygcc,项目名称:spectrem,代码行数:59,代码来源:main.c
示例15: dump_stats
static void dump_stats(const struct videnc_state *ves)
{
re_printf("~~~~~ Daala Encoder stats ~~~~~\n");
re_printf("num frames: %zu\n", ves->stats.n_frame);
re_printf("num headers: %zu\n", ves->stats.n_header);
re_printf("key-frames packets: %zu\n", ves->stats.n_keyframe);
re_printf("total packets: %zu\n", ves->stats.n_packet);
}
开发者ID:GGGO,项目名称:baresip,代码行数:8,代码来源:encode.c
示例16: agent_process_remote_attr
int agent_process_remote_attr(struct agent *ag,
const char *name, const char *value)
{
int err = 0;
if (!ag || !name)
return EINVAL;
if (0 == str_casecmp(name, "ice-ufrag")) {
ag->rufrag = true;
err = trice_set_remote_ufrag(ag->icem, value);
}
else if (0 == str_casecmp(name, "ice-pwd")) {
ag->rpwd = true;
err = trice_set_remote_pwd(ag->icem, value);
}
else if (0 == str_casecmp(name, "candidate")) {
unsigned i;
err = agent_rcand_decode_add(ag->icem, value);
for (i=0; i<ag->candc; i++)
candidate_add_permissions(&ag->candv[i]);
}
else if (0 == str_casecmp(name, "end-of-candidates")) {
re_printf("got end-of-candidates from remote\n");
ag->remote_eoc = true;
}
else {
re_printf("attribute ignored: %s\n", name);
}
if (err) {
re_printf("remote attr error (%m)\n", err);
return err;
}
if (ag->rufrag && ag->rpwd && ag->cli->param.run_checklist
&& !list_isempty(trice_rcandl(ag->icem))
&& !trice_checklist_isrunning(ag->icem)) {
re_printf("starting ICE checklist with pacing interval"
" %u milliseconds..\n",
ag->cli->param.pacing_interval);
err = trice_checklist_start(ag->icem, NULL,
ag->cli->param.pacing_interval,
true,
ice_estab_handler,
ice_failed_handler, ag);
if (err) {
re_fprintf(stderr, "could not start checklist (%m)\n",
err);
}
}
return 0;
}
开发者ID:alfredh,项目名称:reicec,代码行数:58,代码来源:agent.c
示例17: register_handler
/* called when register responses are received */
static void register_handler(int err, const struct sip_msg *msg, void *arg)
{
(void)arg;
if (err)
re_printf("register error: %s\n", strerror(err));
else
re_printf("register reply: %u %r\n", msg->scode, &msg->reason);
}
开发者ID:chk-jxcn,项目名称:redemo,代码行数:10,代码来源:sip_ua.c
示例18: progress_handler
/* called when SIP progress (like 180 Ringing) responses are received */
static void progress_handler(const struct sip_msg *msg, void *arg)
{
struct tcsipcall *call = arg;
re_printf("session progress: %u %r\n", msg->scode, &msg->reason);
if((msg->scode == 183) && mbuf_get_left(msg->mb)) {
re_printf("early media");
tcmedia_answer(call->media, msg->mb);
tcsipcall_activate(call);
}
}
开发者ID:labdong801,项目名称:tcsip,代码行数:11,代码来源:tcsipcall.c
示例19: close_handler
/* called when the session fails to connect or is terminated from peer */
static void close_handler(int err, const struct sip_msg *msg, void *arg)
{
(void)arg;
if (err)
re_printf("session closed: %s\n", strerror(err));
else
re_printf("session closed: %u %r\n", msg->scode, &msg->reason);
terminate();
}
开发者ID:chk-jxcn,项目名称:redemo,代码行数:12,代码来源:sip_ua.c
示例20: notify_handler
static void notify_handler(struct sip *sip, const struct sip_msg *msg,
void *arg)
{
struct mwi *mwi = arg;
if (mbuf_get_left(msg->mb)) {
re_printf("----- MWI for %s -----\n", ua_aor(mwi->ua));
re_printf("%b\n", mbuf_buf(msg->mb), mbuf_get_left(msg->mb));
}
(void)sip_treply(NULL, sip, msg, 200, "OK");
}
开发者ID:qwertos,项目名称:baresip,代码行数:12,代码来源:mwi.c
注:本文中的re_printf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论