From a0e4d8359d2352947bfcdaaf3ce6669e0d940437 Mon Sep 17 00:00:00 2001 From: Ilia Platone Date: Wed, 13 Nov 2024 17:12:18 +0100 Subject: [PATCH] Add vlbi server shared library --- CMakeLists.txt | 11 +- vlbi_server_shared.cpp | 58 ++++++ vlbi_server_shared.h | 414 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 482 insertions(+), 1 deletion(-) create mode 100644 vlbi_server_shared.h diff --git a/CMakeLists.txt b/CMakeLists.txt index fb8b7dd..1b438d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ find_package(Threads REQUIRED) option(CMAKE_BUILD_RPATH_USE_ORIGIN "rpath issue fix" ON) option(WITH_VLBI_SERVER "Add OpenVLBI servers" ON) option(WITH_INDI_SERVER "Add INDI server for OpenVLBI" ON) +option(WITH_SHARED_SERVER "Add shared server library for OpenVLBI" ON) option(WITH_DUMMY_SERVER "Add dummy server for OpenVLBI" ON) option(WITH_JSON_SERVER "Add JSON server for OpenVLBI" ON) @@ -21,7 +22,7 @@ set (CMAKE_CXX_STANDARD 11) set (CMAKE_C_STANDARD 11) set (VLBI_VERSION_MAJOR 3) set (VLBI_VERSION_MINOR 0) -set (VLBI_VERSION_RELEASE 2) +set (VLBI_VERSION_RELEASE 3) set (VLBI_VERSION_STRING "${VLBI_VERSION_MAJOR}.${VLBI_VERSION_MINOR}.${VLBI_VERSION_RELEASE}") set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}") @@ -125,4 +126,12 @@ add_executable(vlbi_server_dummy ${CMAKE_CURRENT_SOURCE_DIR}/vlbi_server_dummy.c target_link_libraries(vlbi_server_dummy openvlbi_server openvlbi ${M_LIB} ${ZLIB_LIBRARY}) install(TARGETS vlbi_server_dummy RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) endif(WITH_DUMMY_SERVER) + +if(WITH_SHARED_SERVER) +add_library(vlbi_server SHARED ${CMAKE_CURRENT_SOURCE_DIR}/vlbi_server.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vlbi/instancecollection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vlbi/collection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vlbi/base64.c ${CMAKE_CURRENT_SOURCE_DIR}/vlbi_server_shared.cpp ${CMAKE_CURRENT_SOURCE_DIR}/vlbi_server_dummy.cpp) +target_link_libraries(vlbi_server openvlbi ${M_LIB} ${ZLIB_LIBRARY}) +set_target_properties(vlbi_server PROPERTIES VERSION ${VLBI_VERSION_STRING} SOVERSION ${VLBI_VERSION_MAJOR}) +install(TARGETS vlbi_server LIBRARY DESTINATION ${LIB_INSTALL_DIR}) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/vlbi_server_c.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/OpenVLBI) +endif(WITH_SHARED_SERVER) endif(WITH_VLBI_SERVER) diff --git a/vlbi_server_shared.cpp b/vlbi_server_shared.cpp index 8b13789..8f45967 100644 --- a/vlbi_server_shared.cpp +++ b/vlbi_server_shared.cpp @@ -1 +1,59 @@ +#include "vlbi_server_dummy.h" +#include "vlbi_server_shared.h" +using namespace VLBI; + +typedef void* vlbi_server_instance; + +vlbi_server_instance VLBI_Server_Create() { DUMMYServer *server = new DUMMYServer(); return static_cast(server); } +void VLBI_Server_Destroy(vlbi_server_instance instance) { (static_cast(instance))->~DUMMYServer(); } +void VLBI_Server_Parse(vlbi_server_instance instance) { (static_cast(instance))->Parse(); } +void VLBI_Server_addContext(vlbi_server_instance instance, const char *name) { (static_cast(instance))->addContext(name); } +void VLBI_Server_delContext(vlbi_server_instance instance, const char *name) { (static_cast(instance))->delContext(name); } +void VLBI_Server_setContext(vlbi_server_instance instance, const char *name) { (static_cast(instance))->setContext(name); } +vlbi_context VLBI_Server_getContext(vlbi_server_instance instance) { return (static_cast(instance))->getContext(); } +char* VLBI_Server_currentContext(vlbi_server_instance instance) { return (static_cast(instance))->currentContext(); } +void VLBI_Server_addModel(vlbi_server_instance instance, const char *name, char *format, char *b64) { (static_cast(instance))->addModel(name, format, b64); } +dsp_stream_p VLBI_Server_getModel(vlbi_server_instance instance, const char *name) { return (static_cast(instance))->getModel(name); } +char* VLBI_Server_getModel(vlbi_server_instance instance, const char *name, char *format) { return (static_cast(instance))->getModel(name, format); } +void VLBI_Server_delModel(vlbi_server_instance instance, const char *name) { (static_cast(instance))->delModel(name); } +int VLBI_Server_getModels(vlbi_server_instance instance, char** names) { return (static_cast(instance))->getModels(names); } +void VLBI_Server_addNodeFromFits(vlbi_server_instance instance, const char *name, char *b64) { (static_cast(instance))->addNode(name, b64); } +void VLBI_Server_addNodes(vlbi_server_instance instance, const char *name, char *b64) { (static_cast(instance))->addNodes(name, b64); } +void VLBI_Server_addNode(vlbi_server_instance instance, const char *name, dsp_location *locations, void *buf, int len, timespec starttime, bool geo) { (static_cast(instance))->addNode(name, locations, buf, len, starttime, geo); } +void VLBI_Server_delNode(vlbi_server_instance instance, const char *name) { (static_cast(instance))->delNode(name); } +void VLBI_Server_CopyNode(vlbi_server_instance instance, const char *name, const char *node) { (static_cast(instance))->CopyNode(name, node); } +void VLBI_Server_Plot(vlbi_server_instance instance, const char *name, int flags) { (static_cast(instance))->Plot(name, flags); } +void VLBI_Server_Idft(vlbi_server_instance instance, const char *name, const char *magnitude, const char *phase) { (static_cast(instance))->Idft(name, magnitude, phase); } +void VLBI_Server_Dft(vlbi_server_instance instance, const char *name, const char *magnitude, const char *phase) { (static_cast(instance))->Dft(name, magnitude, phase); } +void VLBI_Server_Mask(vlbi_server_instance instance, const char *name, const char *model, const char *mask) { (static_cast(instance))->Mask(name, model, mask); } +void VLBI_Server_Stack(vlbi_server_instance instance, const char *name, const char *model1, const char *model2) { (static_cast(instance))->Stack(name, model1, model2); } +void VLBI_Server_Copy(vlbi_server_instance instance, const char *name, const char *model) { (static_cast(instance))->Copy(name, model); } +void VLBI_Server_Diff(vlbi_server_instance instance, const char *name, const char *model1, const char *model2) { (static_cast(instance))->Diff(name, model1, model2); } +void VLBI_Server_Convolve(vlbi_server_instance instance, const char *name, const char *model1, const char *model2) { (static_cast(instance))->Convolve(name, model1, model2); } +void VLBI_Server_LowPass(vlbi_server_instance instance, const char *name, const char *node, double freq) { (static_cast(instance))->LowPass(name, node, freq); } +void VLBI_Server_HighPass(vlbi_server_instance instance, const char *name, const char *node, double freq) { (static_cast(instance))->HighPass(name, node, freq); } +void VLBI_Server_BandPass(vlbi_server_instance instance, const char *name, const char *node, double lofreq, double hifreq) { (static_cast(instance))->BandPass(name, node, lofreq, hifreq); } +void VLBI_Server_BandReject(vlbi_server_instance instance, const char *name, const char *node, double lofreq, double hifreq) { (static_cast(instance))->BandReject(name, node, lofreq, hifreq); } +void VLBI_Server_Shift(vlbi_server_instance instance, const char *name) { (static_cast(instance))->Shift(name); } +void VLBI_Server_setRa(vlbi_server_instance instance, double value) { (static_cast(instance))->setRa(value); } +void VLBI_Server_setDec(vlbi_server_instance instance, double value) { (static_cast(instance))->setDec(value); } +void VLBI_Server_setFreq(vlbi_server_instance instance, double value) { (static_cast(instance))->setFreq(value); } +void VLBI_Server_setSampleRate(vlbi_server_instance instance, double value) { (static_cast(instance))->setSampleRate(value); } +void VLBI_Server_setBps(vlbi_server_instance instance, int value) { (static_cast(instance))->setBps(value); } +void VLBI_Server_setWidth(vlbi_server_instance instance, int value) { (static_cast(instance))->setWidth(value); } +void VLBI_Server_setHeight(vlbi_server_instance instance, int value) { (static_cast(instance))->setHeight(value); } +double VLBI_Server_getRa(vlbi_server_instance instance) { return (static_cast(instance))->getRa(); } +double VLBI_Server_getDec(vlbi_server_instance instance) { return (static_cast(instance))->getDec(); } +double VLBI_Server_getFreq(vlbi_server_instance instance) { return (static_cast(instance))->getFreq(); } +double VLBI_Server_getSampleRate(vlbi_server_instance instance) { return (static_cast(instance))->getSampleRate(); } +void VLBI_Server_setCorrelationOrder(vlbi_server_instance instance, int order) { (static_cast(instance))->setCorrelationOrder(order); } +double VLBI_Server_getBps(vlbi_server_instance instance) { return (static_cast(instance))->getBps(); } +double VLBI_Server_getWidth(vlbi_server_instance instance) { return (static_cast(instance))->getWidth(); } +double VLBI_Server_getHeight(vlbi_server_instance instance) { return (static_cast(instance))->getHeight(); } +void VLBI_Server_setInput(vlbi_server_instance instance, FILE* in) { (static_cast(instance))->setInput(in); } +FILE* VLBI_Server_getInput(vlbi_server_instance instance) { return (static_cast(instance))->getInput(); } +void VLBI_Server_setOutput(vlbi_server_instance instance, FILE* out) { (static_cast(instance))->setOutput(out); } +FILE* VLBI_Server_getOutput(vlbi_server_instance instance) { return (static_cast(instance))->getOutput(); } +void VLBI_Server_setDelegate(vlbi_server_instance instance, vlbi_func2_t func) { (static_cast(instance))->setDelegate(func); } +vlbi_func2_t VLBI_Server_getDelegate(vlbi_server_instance instance) { return (static_cast(instance))->getDelegate(); } diff --git a/vlbi_server_shared.h b/vlbi_server_shared.h new file mode 100644 index 0000000..5f56dec --- /dev/null +++ b/vlbi_server_shared.h @@ -0,0 +1,414 @@ +/* OpenVLBI - Open Source Very Long Baseline Interferometry +* Copyright © 2017-2023 Ilia Platone +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program 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 +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#ifndef VLBI_SERVER_SHARED_H +#define VLBI_SERVER_SHARED_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DLL_EXPORT +#ifdef _WIN32 +#define DLL_EXPORT __declspec(dllexport) +#else +#define DLL_EXPORT extern +#endif +#endif + +typedef void* vlbi_server_instance; + +/** +* \brief Flags that characterize a plot +* \sa Server::Plot() +*/ +typedef enum +{ + ///This indicates that the nodes have a positional stream companion + plot_flags_moving_baseline = 1, + ///This will fill all baselines projected pixels with ones + plot_flags_uv_coverage = 2, + ///This indicates that the nodes are synced already and no delay calculation will be done + plot_flags_synced = 4, + ///This will use a custom visibility delegate + plot_flags_custom_delegate = 8, +} vlbi_plot_flags; + + +/** +* \brief Create an instance of the OpenVLBI server +* \return The newly created OpenVLBI server instance +*/ +DLL_EXPORT vlbi_server_instance VLBI_Server_Create(void); + +/** +* \brief Destroy a previously created OpenVLBI server instance +* \param instance A previously created OpenVLBI server instance +*/ +DLL_EXPORT void VLBI_Server_Destroy(vlbi_server_instance); + +/** +* \brief Called immediately after main(), can be overriden to add your custom arguments +* \param argc Non-negative value representing the number of arguments passed to the program from the environment in which the program is run. +* \param argv Pointer to the first element of an array of argc + 1 pointers, of which the last one is null and the previous ones, if any, point to strings that represent the arguments passed to the program from the host environment. +*/ +DLL_EXPORT int VLBI_Server_Init(vlbi_server_instance, int argc, char** argv); + +/** +* \brief main() creates a loop that calls Parse(), you can use this one, which uses the standard syntax or override it with your own implementation +*/ +DLL_EXPORT void VLBI_Server_Parse(vlbi_server_instance); + +/** +* \brief add a new OpenVLBI context by giving it a name. VLBI::Server has an internal context collection +* \param name The name of the new context +*/ +DLL_EXPORT void VLBI_Server_addContext(vlbi_server_instance, const char *name); + +/** +* \brief delete an existing OpenVLBI context by name. +* \param name The name of the context to be deleted +*/ +DLL_EXPORT void VLBI_Server_delContext(vlbi_server_instance, const char *name); + +/** +* \brief set the current OpenVLBI context by passing its name. +* \param name The name of the context +*/ +DLL_EXPORT void VLBI_Server_setContext(vlbi_server_instance, const char *name); + +/** +* \brief Obtain the current OpenVLBI context object. +* \return The vlbi_context object representing the current context +*/ +DLL_EXPORT vlbi_context VLBI_Server_getContext(vlbi_server_instance); + +/** +* \brief Obtain the name current OpenVLBI context. +* \return The name of the current context +*/ +DLL_EXPORT char* VLBI_Server_currentContext(vlbi_server_instance); + +/** +* \brief Create a new model from a picture, give it a name and add it to the current context. +* \param name The name of the new model +* \param format The format of the new model, can be one of png, jpeg or fits +* \param b64 The file buffer base64 encoded +*/ +DLL_EXPORT void VLBI_Server_addModel(vlbi_server_instance, const char *name, char *format, char *b64); + +/** +* \brief Obtain the dsp_stream_p object of a model by passing its name. +* \param name The name of the model +* \return The dsp_stream_p object representing the model +*/ +DLL_EXPORT dsp_stream_p VLBI_Server_getModel(vlbi_server_instance, const char *name); + +/** +* \brief Obtain the base64 encoded file buffer of a model by passing its name. +* \param name The name of the model +* \param format The format of the picture exported, can be one of png, jpeg or fits +* \return The file buffer base64 encoded +*/ +DLL_EXPORT char* VLBI_Server_getModelBase64(vlbi_server_instance, const char *name, char *format); + +/** +* \brief delete from the current context an existing model by name. +* \param name The name of the model to be deleted +*/ +DLL_EXPORT void VLBI_Server_delModel(vlbi_server_instance, const char *name); + +/** +* \brief get the names of all the models of the current context. +* \param names The pointer of a char* array to be filled with the names of the models +* \return The number of models in the current context +*/ +DLL_EXPORT int VLBI_Server_getModels(vlbi_server_instance, char** names); + +/** +* \brief Create a new node from a monodimensional image FITS file, give it a name and add it to the current context. +* \param name The name of the new node +* \param b64 The file buffer base64 encoded +*/ +DLL_EXPORT void VLBI_Server_addNodeFromFits(vlbi_server_instance, const char *name, char *b64); + +/** +* \brief Create as many nodes as the rows number of an SDFITS file, give it a name and add it to the current context. +* \param name The name of the new node +* \param b64 The file buffer base64 encoded +*/ +DLL_EXPORT void VLBI_Server_addNodes(vlbi_server_instance, const char *name, char *b64); + +/** +* \brief Create a new node from a its raw data, give it a name and add it to the current context. +* \param name The name of the new node +* \param locations A pointer to its location(s), will be pointed from the new node, so don't free() it until the node is deleted +* \param buf The data buffer of the new node. Will be casted, according the current value of Bps, to the element type with the current word size +* \param len The number of elements +* \param starttime The UTC time of the first element +* \param geo If 1, consider all elements of location as geographic coordinates, if 0 as relative to the current context' station location +*/ +DLL_EXPORT void VLBI_Server_addNode(vlbi_server_instance, const char *name, dsp_location *locations, void *buf, int len, timespec starttime, bool geo); + +/** +* \brief delete from the current context an existing node by name. +* \param name The name of the node to be deleted +*/ +DLL_EXPORT void VLBI_Server_delNode(vlbi_server_instance, const char *name); + +/** +* \brief Copy a node into another node +* \param name The name of the new node +* \param node The name of the node to be copied +*/ +DLL_EXPORT void VLBI_Server_CopyNode(vlbi_server_instance, const char *name, const char *node); + +/** +* \brief Plot the current observation into a new model. +* \param name The name of the new model +* \param flags The vlbi_plot_flags that characterize this observation +*/ +DLL_EXPORT void VLBI_Server_Plot(vlbi_server_instance, const char *name, int flags); + +/** +* \brief Obtain an inverse fourier transform from the magnitude and phase models passed. +* \param name The name of the new model +* \param magnitude The name of the model used as magnitude +* \param phase The name of the model used as phase +*/ +DLL_EXPORT void VLBI_Server_Idft(vlbi_server_instance, const char *name, const char *magnitude, const char *phase); + +/** +* \brief Save the magnitude and phase to new models obtained by the fourier transform of the model passed. +* \param name The name of the model +* \param magnitude The name of the new model that will contain the magnitude +* \param phase The name of the new model that will contain the phase +*/ +DLL_EXPORT void VLBI_Server_Dft(vlbi_server_instance, const char *name, const char *magnitude, const char *phase); + +/** +* \brief Mask a model with another model by multiplication +* \param name The name of the new model +* \param model The name of the model to be masked +* \param mask The name of the mask model +*/ +DLL_EXPORT void VLBI_Server_Mask(vlbi_server_instance, const char *name, const char *model, const char *mask); + +/** +* \brief Stack a model with another model +* \param name The name of the new model +* \param model1 The name of the first model to be stacked +* \param model2 The name of the second model to be stacked +*/ +DLL_EXPORT void VLBI_Server_Stack(vlbi_server_instance, const char *name, const char *model1, const char *model2); + +/** +* \brief Copy a model into another model +* \param name The name of the new model +* \param model The name of the model to be copied +*/ +DLL_EXPORT void VLBI_Server_Copy(vlbi_server_instance, const char *name, const char *model); + +/** +* \brief Diff a model with another model +* \param name The name of the new model +* \param model1 The name of the first model +* \param model2 The name of the second model to be subtracted from model1 +*/ +DLL_EXPORT void VLBI_Server_Diff(vlbi_server_instance, const char *name, const char *model1, const char *model2); + +/** +* \brief Convolve a model with a convolution matrix model +* \param name The name of the new model +* \param model1 The name of the model +* \param model2 The name of the model used as convolution matrix +*/ +DLL_EXPORT void VLBI_Server_Convolve(vlbi_server_instance, const char *name, const char *model1, const char *model2); + +/** +* \brief Apply a low pass filter on a node buffer +* \param name The name of the new node +* \param node The name of the unfiltered node +* \param freq The cutoff frequency in radians +*/ +DLL_EXPORT void VLBI_Server_LowPass(vlbi_server_instance, const char *name, const char *node, double freq); + +/** +* \brief Apply a high pass filter on a node buffer +* \param name The name of the new node +* \param node The name of the unfiltered node +* \param freq The cutoff frequency in radians +*/ +DLL_EXPORT void VLBI_Server_HighPass(vlbi_server_instance, const char *name, const char *node, double freq); + +/** +* \brief Apply a band pass filter on a node buffer +* \param name The name of the new node +* \param node The name of the unfiltered node +* \param lofreq The low cut frequency in radians +* \param hifreq The high cut frequency in radians +*/ +DLL_EXPORT void VLBI_Server_BandPass(vlbi_server_instance, const char *name, const char *node, double lofreq, double hifreq); + +/** +* \brief Apply a band reject filter on a node buffer +* \param name The name of the new node +* \param node The name of the unfiltered node +* \param lofreq The low cut frequency in radians +* \param hifreq The high cut frequency in radians +*/ +DLL_EXPORT void VLBI_Server_BandReject(vlbi_server_instance, const char *name, const char *node, double lofreq, double hifreq); + +/** +* \brief Shift a model by its dimension in-place +* \param name The name of the model +*/ +DLL_EXPORT void VLBI_Server_Shift(vlbi_server_instance, const char *name); + +/** +* \brief set the target right ascension coordinate, do this before calling Plot() +* \param value The RA coordinate in hours +*/ +DLL_EXPORT void VLBI_Server_setRa(vlbi_server_instance, double value); + +/** +* \brief set the target declination coordinate, do this before calling Plot() +* \param value The Declination coordinate in degrees +*/ +DLL_EXPORT void VLBI_Server_setDec(vlbi_server_instance, double value); + +/** +* \brief set the frequency observed, do this before calling Plot() +* \param value The frequency in Hz +*/ +DLL_EXPORT void VLBI_Server_setFreq(vlbi_server_instance, double value); + +/** +* \brief set the sampling frequency, do this before calling Plot() +* \param value The sample rate, in samples per second +*/ +DLL_EXPORT void VLBI_Server_setSampleRate(vlbi_server_instance, double value); + +/** +* \brief set the bytes per sample, do this before calling addNode() +* \param value The word width in bytes +*/ +DLL_EXPORT void VLBI_Server_setBps(vlbi_server_instance, int value); + +/** +* \brief set the plot width, do this before calling Plot() +* \param value plot width in pixels +*/ +DLL_EXPORT void VLBI_Server_setWidth(vlbi_server_instance, int value); + +/** +* \brief set the plot height, do this before calling Plot() +* \param value plot height in pixels +*/ +DLL_EXPORT void VLBI_Server_setHeight(vlbi_server_instance, int value); + +/** +* \brief get the current right ascension coordinate +* \return The current right ascension in hours +*/ +DLL_EXPORT double VLBI_Server_getRa(vlbi_server_instance); + +/** +* \brief get the current declination coordinate +* \return The current declination in hours +*/ +DLL_EXPORT double VLBI_Server_getDec(vlbi_server_instance); + +/** +* \brief get the current frequency +* \return The frequency in Hz +*/ +DLL_EXPORT double VLBI_Server_getFreq(vlbi_server_instance); + +/** +* \brief get the current sample rate +* \return The sampling rate in sps +*/ +DLL_EXPORT double VLBI_Server_getSampleRate(vlbi_server_instance); + +/** +* \brief set the current correlation order +* \param order The correlation order +*/ +DLL_EXPORT void VLBI_Server_setCorrelationOrder(vlbi_server_instance, int order); + +/** +* \brief get the bytes per sample +* \return The word width in bytes +*/ +DLL_EXPORT double VLBI_Server_getBps(vlbi_server_instance); + +/** +* \brief get the plot width +* \return The plot width in pixels +*/ +DLL_EXPORT double VLBI_Server_getWidth(vlbi_server_instance); + +/** +* \brief get the plot height +* \return The plot height in pixels +*/ +DLL_EXPORT double VLBI_Server_getHeight(vlbi_server_instance); + +/** +* \brief set the input stream +* \param in The input stream file pointer +*/ +DLL_EXPORT void VLBI_Server_setInput(vlbi_server_instance, FILE* in); + +/** +* \brief get the input stream +* \return The input stream file pointer +*/ +DLL_EXPORT FILE* VLBI_Server_getInput(vlbi_server_instance); + +/** +* \brief set the output stream +* \param out The output stream file pointer +*/ +DLL_EXPORT void VLBI_Server_setOutput(vlbi_server_instance, FILE* out); + +/** +* \brief get the output stream +* \return The output stream file pointer +*/ +DLL_EXPORT FILE* VLBI_Server_getOutput(vlbi_server_instance); + +/** +* \brief set the delegate function +* \param func The new delegate +*/ +DLL_EXPORT void VLBI_Server_setDelegate(vlbi_server_instance, vlbi_func2_t func); + +/** +* \brief get the current delegate function +* \return The current delegate +*/ +DLL_EXPORT vlbi_func2_t VLBI_Server_getDelegate(vlbi_server_instance); + +#ifdef __cplusplus +} +#endif +#endif //VLBI_SERVER_SHARED