ossp-pkg/xds/xds.h
1.2
/*
$Source: /v/ossp/cvs/ossp-pkg/xds/Attic/xds.h,v $
$Revision: 1.2 $
Copyright (c) 2001 by Cable & Wireless Deutschland.
Permission to use, copy, modify, and distribute this software for
any purpose with or without fee is hereby granted, provided that
the above copyright notice and this permission notice appear in all
copies.
This software is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
included license for more details.
*/
#ifndef __LIBXDS_H__
#define __LIBXDS_H__
#include <stdlib.h>
typedef int (*xds_formatter_cb)(char* buf, size_t buf_size, void* val);
typedef struct
{
char* name;
xds_formatter_cb callback;
}
xds_formatter_cb_desc;
typedef struct
{
xds_formatter_cb_desc* formatters;
size_t formatters_size;
}
xds_ctx;
xds_ctx* xds_init(void);
void xds_destroy(xds_ctx* context);
int xds_register(xds_ctx* context, const char* name, xds_formatter_cb callback);
int xds_vregister(xds_ctx* context, const xds_formatter_cb_desc* callbacks, size_t size);
int xds_mashal(xds_ctx* context, const char* fmt, ...);
int xds_snmashal(xds_ctx* context, char* buf, size_t buf_size, const char* fmt, ...);
int xds_amashal(xds_ctx* context, char** buf_p, size_t buf_size, const char* fmt, ...);
#endif /* !defined(__LIBXDS_H__) */