00001
00004 #ifndef _DRMS_LINK_H
00005 #define _DRMS_LINK_H
00006
00007 #include "drms_types.h"
00008 #include "drms.h"
00009
00010
00011
00012 DRMS_Record_t *drms_link_follow(DRMS_Record_t *rec, const char *linkname,
00013 int *status);
00014 DRMS_RecordSet_t *drms_link_followall(DRMS_Record_t *rec, const char *linkname,
00015 int *status);
00016 void drms_link_print(DRMS_Link_t *link);
00017 void drms_link_fprint(FILE *linkfile, DRMS_Link_t *link);
00018 int drms_link_getpidx(DRMS_Record_t *rec);
00019 int drms_setlink_static(DRMS_Record_t *rec, const char *linkname,
00020 long long recnum);
00021 int drms_setlink_dynamic(DRMS_Record_t *rec, const char *linkname,
00022 DRMS_Type_t *types, DRMS_Type_Value_t *values);
00023 int drms_link_set(const char *linkname, DRMS_Record_t *baserec, DRMS_Record_t *supplementingrec);
00024
00025
00026 static inline int drms_link_ranksort(const void *he1, const void *he2)
00027 {
00028 DRMS_Link_t *l1 = (DRMS_Link_t *)hcon_getval(*((HContainerElement_t **)he1));
00029 DRMS_Link_t *l2 = (DRMS_Link_t *)hcon_getval(*((HContainerElement_t **)he2));
00030
00031 XASSERT(l1 && l2);
00032
00033 return (l1->info->rank < l2->info->rank) ? -1 : (l1->info->rank > l2->info->rank ? 1 : 0);
00034 }
00035
00036
00037
00109 #endif