src/pomp_msg.c
int pomp_msg_write_argv(struct pomp_msg *msg, uint32_t msgid,
		const char *fmt, int argc, const char * const *argv)
{
	int res = 0;
	struct pomp_encoder enc = POMP_ENCODER_INITIALIZER;

	POMP_RETURN_ERR_IF_FAILED(msg != NULL, -EINVAL);

	/* Initialize message */
	res = pomp_msg_init(msg, msgid);
	if (res < 0)
		goto out;

	/* Setup encoder */
	res = pomp_encoder_init(&enc, msg);
	if (res < 0)
		goto out;

	/* Encode message */
	res = pomp_encoder_write_argv(&enc, fmt, argc, argv);
	if (res < 0)
		goto out;

	/* Finish it */
	res = pomp_msg_finish(msg);
	if (res < 0)
		goto out;

out:
	/* Cleanup */
	(void)pomp_encoder_clear(&enc);
	return res;
}
/*
 * See documentation in public header.
 */
See documentation in public header.
See documentation in public header .
int pomp_msg_write_argv(struct pomp_msg *msg, uint32_t msgid,
		const char *fmt, int argc, const char * const *argv)
{
	int res = 0;
	struct pomp_encoder enc = POMP_ENCODER_INITIALIZER;
	POMP_RETURN_ERR_IF_FAILED(msg != NULL, -EINVAL);
	res = pomp_msg_init(msg, msgid);
	if (res < 0)
		goto out;
	res = pomp_encoder_init(&enc, msg);
	if (res < 0)
		goto out;
	res = pomp_encoder_write_argv(&enc, fmt, argc, argv);
	if (res < 0)
		goto out;
	res = pomp_msg_finish(msg);
	if (res < 0)
		goto out;
out:
	(void)pomp_encoder_clear(&enc);
	return res;
}
int pomp_msg_write_argv ( struct pomp_msg * msg , uint32_t msgid , const char * fmt , int argc , const char * const * argv ) { int res = 0 ; struct pomp_encoder enc = POMP_ENCODER_INITIALIZER ; POMP_RETURN_ERR_IF_FAILED ( msg != NULL , - EINVAL ) ; res = pomp_msg_init ( msg , msgid ) ; if ( res < 0 ) goto out ; res = pomp_encoder_init ( & enc , msg ) ; if ( res < 0 ) goto out ; res = pomp_encoder_write_argv ( & enc , fmt , argc , argv ) ; if ( res < 0 ) goto out ; res = pomp_msg_finish ( msg ) ; if ( res < 0 ) goto out ; out : ( void ) pomp_encoder_clear ( & enc ) ; return res ; }
See documentation in public header.
See documentation in public header .
/* Initialize message */ /* Setup encoder */ /* Encode message */ /* Finish it */ /* Cleanup */