00001
00002 #ifndef _DSDSAPI_H
00003 #define _DSDSAPI_H
00004
00005 #include "drms_types.h"
00006
00007 #define kJSOC_MACHINE "JSOC_MACHINE"
00008 #define kLIBDSDS "libdsds.so"
00009 #define kDSDS_SERIES_NUM "series_num"
00010 #define kDSDS_DS "ds"
00011 #define kDSDS_RN "rn"
00012 #define kDSDS_PROGTOKEN "prog:"
00013 #define kDSDS_NSPREFIX "dsdsing"
00014
00015 #define kDSDS_MaxHandle 64
00016
00017 typedef enum kDSDS_Stat_enum
00018 {
00019 kDSDS_Stat_Success = 0,
00020 kDSDS_Stat_CantReadProcLink,
00021 kDSDS_Stat_CantOpenLibrary,
00022 kDSDS_Stat_NoEnvironment,
00023
00024 kDSDS_Stat_NoSOI,
00025
00026 kDSDS_Stat_MissingAPI,
00027 kDSDS_Stat_APIRetErr,
00028 kDSDS_Stat_TypeErr,
00029
00030 kDSDS_Stat_PeqError,
00031 kDSDS_Stat_MalformedKey,
00032 kDSDS_Stat_NoMemory,
00033
00034 kDSDS_Stat_InvalidRank,
00035 kDSDS_Stat_InvalidParams,
00036
00037 kDSDS_Stat_InvalidHandle,
00038
00039 kDSDS_Stat_InvalidFITS,
00040 kDSDS_Stat_UnkFITSpath,
00041
00042 kDSDS_Stat_DSDSOffline,
00043 kDSDS_Stat_VDSCache
00044 } kDSDS_Stat_t;
00045
00046 typedef const char *DSDS_Handle_t;
00047 typedef DSDS_Handle_t *DSDS_pHandle_t;
00048
00049 typedef struct DSDS_KeyList_struct
00050 {
00051 DRMS_Keyword_t *elem;
00052 struct DSDS_KeyList_struct *next;
00053 } DSDS_KeyList_t;
00054
00055
00056
00057 #define kDSDS_Segment "dsds_data"
00058
00059 void *DSDS_GetFPtr(void *hDSDS, const char *symbol);
00060 int DSDS_IsDSDSSpec(const char *spec);
00061 int DSDS_IsDSDSPort(const char *query);
00062 int DSDS_GetDSDSParams(DRMS_SeriesInfo_t *si, char *out);
00063 int DSDS_SetDSDSParams(void *hDSDS, DRMS_SeriesInfo_t *si, DSDS_Handle_t in);
00064 void *DSDS_GetLibHandle(const char *libname, kDSDS_Stat_t *status);
00065 static inline const char *DSDS_GetNsPrefix()
00066 {
00067 return kDSDS_NSPREFIX;
00068 }
00069
00070
00071 #define kDSDS_DSDS_OPEN_RECORDS "DSDS_open_records"
00072 #define kDSDS_DSDS_FREE_KEYLIST "DSDS_free_keylist"
00073 #define kDSDS_DSDS_FREE_KEYLISTARR "DSDS_free_keylistarr"
00074 #define kDSDS_DSDS_FREE_SEG "DSDS_free_seg"
00075 #define kDSDS_DSDS_FREE_SEGARR "DSDS_free_segarr"
00076 #define kDSDS_DSDS_STEAL_SEGINFO "DSDS_steal_seginfo"
00077 #define kDSDS_DSDS_SEGMENT_READ "DSDS_segment_read"
00078 #define kDSDS_DSDS_FREE_ARRAY "DSDS_free_array"
00079 #define kDSDS_DSDS_HANDLE_TODESC "DSDS_handle_todesc"
00080 #define kDSDS_DSDS_FREE_HANDLE "DSDS_free_handle"
00081 #define kDSDS_DSDS_READ_FITSHEADER "DSDS_read_fitsheader"
00082 #define kDSDS_DSDS_FREE_VDSCACHE "DSDS_free_vdscache"
00083
00084 typedef long long (*pDSDSFn_DSDS_open_records_t)(const char *dsspec,
00085 char *drmsSeries,
00086 DSDS_pHandle_t hparams,
00087 DSDS_KeyList_t ***keylistarr,
00088 DRMS_Segment_t **segarr,
00089 kDSDS_Stat_t *stat);
00090 typedef void (*pDSDSFn_DSDS_free_keylist_t)(DSDS_KeyList_t **keylist);
00091 typedef void (*pDSDSFn_DSDS_free_keylistarr_t)(DSDS_KeyList_t ***keylistarr,
00092 int n);
00093 typedef void (*pDSDSFn_DSDS_free_seg_t)(DRMS_Segment_t **seg);
00094 typedef void (*pDSDSFn_DSDS_free_segarr_t)(DRMS_Segment_t **segarr,
00095 int n);
00096 typedef void (*pDSDSFn_DSDS_steal_seginfo_t)(DRMS_Segment_t *thief, DRMS_Segment_t *victim);
00097 typedef DRMS_Array_t *(*pDSDSFn_DSDS_segment_read_t)(char *paramsDesc,
00098 int ds,
00099 int rn,
00100 const char *filename,
00101 kDSDS_Stat_t *stat);
00102 typedef void (*pDSDSFn_DSDS_free_array_t)(DRMS_Array_t **arr);
00103 typedef int (*pDSDSFn_DSDS_handle_todesc_t)(DSDS_Handle_t handle,
00104 char *desc,
00105 kDSDS_Stat_t *stat);
00106 typedef void (*pDSDSFn_DSDS_free_handle_t)(DSDS_pHandle_t pHandle);
00107 typedef int (*pDSDSFn_DSDS_read_fitsheader_t)(const char *file,
00108 DSDS_KeyList_t **keylist,
00109 DRMS_Segment_t **seg,
00110 const char *segname,
00111 kDSDS_Stat_t *stat);
00112 typedef void (*pDSDSFn_DSDS_free_vdscache_t)();
00113
00114 #endif