xmppipe_fmt -> xmppipe_fmt_encode

master
Michael Santos 6 years ago
parent 9598e01579
commit 91173ecc00

@ -598,7 +598,7 @@ handle_stdin(xmppipe_state_t *state, int fd, char *buf, size_t len)
if ((state->opt & XMPPIPE_OPT_DISCARD) && state->occupants == 0) {
if (state->opt & XMPPIPE_OPT_DISCARD_TO_STDOUT) {
char *enc = NULL;
enc = xmppipe_fmt(buf);
enc = xmppipe_fmt_encode(buf);
(void)printf("!:%s\n", enc);
free(enc);
}
@ -984,9 +984,9 @@ handle_presence(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
if (state->status == XMPPIPE_S_READY_AVAIL && state->occupants == 0)
xmppipe_next_state(state, XMPPIPE_S_READY_EMPTY);
etype = xmppipe_fmt(type);
efrom = xmppipe_fmt(from);
eto = xmppipe_fmt(to);
etype = xmppipe_fmt_encode(type);
efrom = xmppipe_fmt_encode(from);
eto = xmppipe_fmt_encode(to);
(void)printf("p:%s:%s:%s\n", etype, efrom, eto);
@ -1098,16 +1098,16 @@ handle_message(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
return 1;
}
emessage = xmppipe_nfmt((char *)buf,n);
emessage = xmppipe_nfmt_encode((char *)buf,n);
xmpp_free(state->ctx, buf);
}
else {
emessage = xmppipe_fmt(message);
emessage = xmppipe_fmt_encode(message);
}
etype = xmppipe_fmt(type);
efrom = xmppipe_fmt(from);
eto = xmppipe_fmt(to);
etype = xmppipe_fmt_encode(type);
efrom = xmppipe_fmt_encode(from);
eto = xmppipe_fmt_encode(to);
(void)printf("m:%s:%s:%s:%s\n", etype, efrom, eto, emessage);

@ -102,8 +102,8 @@ typedef struct {
int xmppipe_fmt_init();
char *xmppipe_fmt(const char *);
char *xmppipe_nfmt(const char *, size_t);
char *xmppipe_fmt_encode(const char *);
char *xmppipe_nfmt_encode(const char *, size_t);
char *xmppipe_fmt_decode(const char *);
char *xmppipe_nfmt_decode(const char *, size_t);
int xmppipe_set_nonblock(int fd);

@ -32,7 +32,7 @@ xmppipe_fmt_init()
}
char *
xmppipe_nfmt(const char *s, size_t len)
xmppipe_nfmt_encode(const char *s, size_t len)
{
char *buf = xmppipe_calloc(len * 3 + 1, 1);
char *p = buf;
@ -53,9 +53,9 @@ xmppipe_nfmt(const char *s, size_t len)
}
char *
xmppipe_fmt(const char *s)
xmppipe_fmt_encode(const char *s)
{
return xmppipe_nfmt(s, strlen(s));
return xmppipe_nfmt_encode(s, strlen(s));
}
char *

Loading…
Cancel
Save