DRMS_KEYWORD(3) DRMS Programmer's Manual DRMS_KEYWORD(3) NAME drms_keyword - DRMS keyword data structures SYNOPSIS #include typedef struct DRMS_Keyword_struct { DRMS_Record_t *record; /* The record this keyword belongs to.*/ DRMS_KeywordInfo_t *info; /* Series-wide info. */ DRMS_Type_Value_t value; /* Keyword data. */ } DRMS_Keyword_t; /* Keyword attributes common to all record in a series. */ typedef struct DRMS_KeywordInfo_struct { char name[DRMS_MAXNAMELEN]; /* Keyword name. */ int islink; /* Is this a regular or link keyword? */ /************ Fields used by regular keywords ********/ DRMS_Type_t type; /* Keyword type. */ char format[DRMS_MAXFORMATLEN]; /* Format string for formatted input and output. */ char unit[DRMS_MAXUNITLEN]; /* Physical unit. */ char description[DRMS_MAXCOMMENTLEN]; int isconstant; /* If isconstant=1 then this keyword has the same value for all records from the series. */ int per_segment; /* If per_segment=1 then this keyword has the has a different for each segment belonging to the record. If the keyword name is "blah" then keywords pertaining to specific segments are referred to by "blah[0]", "blah[1]", etc. */ /************ Fields used by link keywords ***********/ char linkname[DRMS_MAXNAMELEN]; /* Name of link pointing to record from which to inherit keyword value. */ char target_key[DRMS_MAXNAMELEN]; /* Keyword from which to inherit.*/ } DRMS_KeywordInfo_t; DESCRIPTION DRMS Keywords contain named data values (meta-data) associated with DRMS records. The DRMS_Keyword_t structure contains the value of a key- word belonging to a specific record. The DRMS_KeywordInfo_t structure contains information about the keyword, common to all records of a DRMS series. FUNCTIONS Set and get values char drms_getkey_char(DRMS_Record_t *rec, const char *key, int *status) short drms_getkey_short(DRMS_Record_t *rec, const char *key, int *status) int drms_getkey_int(DRMS_Record_t *rec, const char *key, int *status) long long drms_getkey_longlong(DRMS_Record_t *rec, const char *key, int *status) float drms_getkey_float(DRMS_Record_t *rec, const char *key, int *status) double drms_getkey_double(DRMS_Record_t *rec, const char *key, int *status) char *drms_getkey_string(DRMS_Record_t *rec, const char *key, int *status) int drms_setkey_char(DRMS_Record_t *rec, const char *key, char value) int drms_setkey_short(DRMS_Record_t *rec, const char *key, short value) int drms_setkey_int(DRMS_Record_t *rec, const char *key, int value) int drms_setkey_longlong(DRMS_Record_t *rec, const char *key, long long value) int drms_setkey_float(DRMS_Record_t *rec, const char *key, float value) int drms_setkey_double(DRMS_Record_t *rec, const char *key, double value) int drms_setkey_string(DRMS_Record_t *rec, const char *key, char *value) Generic set and get functions DRMS_Type_Value_t drms_getkey(DRMS_Record_t *rec, const char *key, DRMS_Type_t *type, int *status) int drms_setkey(DRMS_Record_t *rec, const char *key, DRMS_Type_t type, DRMS_Type_Value_t *value) Pretty printing void drms_keyword_print(DRMS_Keyword_t *key) void drms_keyword_printval(DRMS_Keyword_t *key) Lookup DRMS_Keyword_t *drms_keyword_lookup(DRMS_Record_t *rec, const char *keyname); SEE ALSO drms_record(3), drms_segment(3), drms_link(3), drms_array(3) DRMS MANPAGE 2006-05-19 DRMS_KEYWORD(3)