diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-15 21:14:38 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-15 23:34:35 +0200 |
commit | cee5fb36dab5741c2f2a5b5952e734bac6621c8f (patch) | |
tree | 1bb067796b0cb2c6105e008a9b9dd55b2a2fa9ef /examples/ipa-stream-client.c | |
parent | ad2e9d637e27a6c51fa6f4ae8ec81075a6448c27 (diff) |
src: shorter stream function names
%s/_client_conn_/_cli_/g
%s/_server_conn_/_srv_/g
%s/_client_/cli/g
%s/server/srv/g
%s/RECONFIG/RECONF/g
%s/SERVER/SRV/g
%s/CLIENT/CLI/g
Diffstat (limited to 'examples/ipa-stream-client.c')
-rw-r--r-- | examples/ipa-stream-client.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/ipa-stream-client.c b/examples/ipa-stream-client.c index 9302825..b771fa3 100644 --- a/examples/ipa-stream-client.c +++ b/examples/ipa-stream-client.c @@ -43,7 +43,7 @@ const struct log_info osmo_stream_client_test_log_info = { .num_cat = ARRAY_SIZE(osmo_stream_client_test_cat), }; -static struct osmo_stream_client_conn *conn; +static struct osmo_stream_cli *conn; void sighandler(int foo) { @@ -51,9 +51,9 @@ void sighandler(int foo) exit(EXIT_SUCCESS); } -static int connect_cb(struct osmo_stream_client_conn *conn) +static int connect_cb(struct osmo_stream_cli *conn) { - int *__num_msgs = osmo_stream_client_conn_get_data(conn); + int *__num_msgs = osmo_stream_cli_get_data(conn); int num_msgs = *__num_msgs, i; LOGP(DIPATEST, LOGL_NOTICE, "connected\n"); @@ -85,7 +85,7 @@ static int connect_cb(struct osmo_stream_client_conn *conn) osmo_ipa_msg_push_header(msg, IPAC_PROTO_OSMO); - osmo_stream_client_conn_send(conn, msg); + osmo_stream_cli_send(conn, msg); LOGP(DIPATEST, LOGL_DEBUG, "enqueueing msg %d of " "%d bytes to be sent\n", i, msg->len); @@ -93,10 +93,10 @@ static int connect_cb(struct osmo_stream_client_conn *conn) return 0; } -static int read_cb(struct osmo_stream_client_conn *conn) +static int read_cb(struct osmo_stream_cli *conn) { struct msgb *msg; - struct osmo_fd *ofd = osmo_stream_client_conn_get_ofd(conn); + struct osmo_fd *ofd = osmo_stream_cli_get_ofd(conn); LOGP(DIPATEST, LOGL_DEBUG, "received message from stream\n"); @@ -162,24 +162,24 @@ int main(int argc, char *argv[]) * initialize stream client. */ - conn = osmo_stream_client_conn_create(tall_test); + conn = osmo_stream_cli_create(tall_test); if (conn == NULL) { fprintf(stderr, "cannot create client\n"); exit(EXIT_FAILURE); } - osmo_stream_client_conn_set_addr(conn, "127.0.0.1"); - osmo_stream_client_conn_set_port(conn, 10000); - osmo_stream_client_conn_set_connect_cb(conn, connect_cb); - osmo_stream_client_conn_set_read_cb(conn, read_cb); - osmo_stream_client_conn_set_data(conn, &num_msgs); + osmo_stream_cli_set_addr(conn, "127.0.0.1"); + osmo_stream_cli_set_port(conn, 10000); + osmo_stream_cli_set_connect_cb(conn, connect_cb); + osmo_stream_cli_set_read_cb(conn, read_cb); + osmo_stream_cli_set_data(conn, &num_msgs); - if (osmo_stream_client_conn_open(conn) < 0) { + if (osmo_stream_cli_open(conn) < 0) { fprintf(stderr, "cannot open client\n"); exit(EXIT_FAILURE); } int on = 1, ret; - struct osmo_fd *ofd = osmo_stream_client_conn_get_ofd(conn); + struct osmo_fd *ofd = osmo_stream_cli_get_ofd(conn); ret = setsockopt(ofd->fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); if (ret < 0) { |