/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pcilib/unit.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-09-24 02:28:45 UTC
  • mfrom: (305.1.19 views)
  • Revision ID: csa@suren.me-20150924022845-p7hc8lh8v0q48g0r
Finalyze XML support and provide initial support for views (only descriptions so far)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _PCILIB_UNIT_H
 
2
#define _PCILIB_UNIT_H
 
3
 
 
4
#include <pcilib.h>
 
5
 
 
6
#define PCILIB_UNIT_INVALID ((pcilib_unit_t)-1)
 
7
#define PCILIB_MAX_TRANSFORMS_PER_UNIT 16                       /**< Limits number of supported transforms per unit */
 
8
 
 
9
typedef struct pcilib_unit_context_s *pcilib_unit_context_t;
 
10
 
 
11
/**
 
12
 * unit transformation routines
 
13
 */
 
14
typedef struct {
 
15
    char *unit;                                                                 /**< Name of the resulting unit */
 
16
    char *transform;                                                            /**< String, similar to view formula, explaining transform to this unit */
 
17
} pcilib_unit_transform_t;
 
18
 
 
19
typedef struct {
 
20
    char *name;                                                                 /**< Unit name */
 
21
    pcilib_unit_transform_t transforms[PCILIB_MAX_TRANSFORMS_PER_UNIT + 1];     /**< Transforms to other units */
 
22
} pcilib_unit_description_t;
 
23
 
 
24
#ifdef __cplusplus
 
25
extern "C" {
 
26
#endif
 
27
 
 
28
int pcilib_add_units(pcilib_t *ctx, size_t n, const pcilib_unit_description_t *desc);
 
29
pcilib_unit_t pcilib_find_unit_by_name(pcilib_t *ctx, const char *unit);
 
30
 
 
31
#ifdef __cplusplus
 
32
}
 
33
#endif
 
34
 
 
35
 
 
36
#endif /* _PCILIB_UNIT_H */