diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-17 11:44:08 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-17 11:44:08 +0100 |
commit | 35681d4e1d171117c9d4c2c4fd7d474b5871f81f (patch) | |
tree | 9abb180d6e35a961e7e798b08101fef59cab6c18 /src/uca.h | |
parent | 5b80e3c687fb2b47b06d9ffe6ac07bec475d812a (diff) | |
download | uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.tar.gz uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.tar.bz2 uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.tar.xz uca-35681d4e1d171117c9d4c2c4fd7d474b5871f81f.zip |
Rename struct_name_t to struct_name and create typedefs
Diffstat (limited to 'src/uca.h')
-rw-r--r-- | src/uca.h | 87 |
1 files changed, 44 insertions, 43 deletions
@@ -63,10 +63,6 @@ extern "C" { * pointers to access the camera accordingly. */ -struct uca_t; -struct uca_camera_t; -struct uca_property_t; - /* The property IDs must start with 0 and must be continuous. Whenever this * library is released, the IDs must not change to guarantee binary compatibility! */ enum uca_property_ids { @@ -120,39 +116,6 @@ enum uca_property_ids { UCA_PROP_LAST }; -/** - * Initialize the unified camera access interface. - * - * \param[in] config_filename Configuration file in JSON format for cameras - * relying on external calibration data. It is ignored when no JSON parser can - * be found at compile time or config_filename is NULL. - * - * \return Pointer to a uca_t structure - */ -struct uca_t *uca_init(const char *config_filename); - -/** - * \brief Free resources of the unified camera access interface - */ -void uca_destroy(struct uca_t *uca); - -/** - * \brief Convert a property string to the corresponding ID - */ -enum uca_property_ids uca_get_property_id(const char *property_name); - -/** - * \brief Convert a property ID to the corresponding string - */ -const char* uca_get_property_name(enum uca_property_ids property_id); - -/** - * \brief Return the full property structure for a given ID - */ -struct uca_property_t *uca_get_full_property(enum uca_property_ids property_id); - - - /* Possible timestamp modes for UCA_PROP_TIMESTAMP_MODE */ #define UCA_TIMESTAMP_ASCII 0x01 #define UCA_TIMESTAMP_BINARY 0x02 @@ -176,7 +139,7 @@ struct uca_property_t *uca_get_full_property(enum uca_property_ids property_id); * frame grabbers. It basically consists of a human-readable name, a physical * unit, a type and some access rights. */ -struct uca_property_t { +typedef struct uca_property { /** * A human-readable string for this property. * @@ -229,7 +192,7 @@ struct uca_property_t { uca_write = 0x02, /**< property can be written */ uca_readwrite = 0x01 | 0x02 /**< property can be read and written */ } access; -}; +} uca_property_t; extern const char *uca_unit_map[]; /**< maps unit numbers to corresponding strings */ @@ -253,12 +216,50 @@ enum uca_errors { /** * Keeps a list of cameras and grabbers. */ -struct uca_t { - struct uca_camera_t *cameras; +typedef struct uca { + struct uca_camera *cameras; /* private */ - struct uca_grabber_t *grabbers; -}; + struct uca_grabber *grabbers; +} uca_t; + +/** + * Initialize the unified camera access interface. + * + * \param[in] config_filename Configuration file in JSON format for cameras + * relying on external calibration data. It is ignored when no JSON parser can + * be found at compile time or config_filename is NULL. + * + * \return Pointer to a uca structure + * + * \note uca_init() is thread-safe if a Pthread-implementation is available. + */ +struct uca *uca_init(const char *config_filename); + +/** + * Free resources of the unified camera access interface + * + * \note uca_destroy() is thread-safe if a Pthread-implementation is available. + */ +void uca_destroy(struct uca *u); + +/** + * Convert a property string to the corresponding ID + */ +enum uca_property_ids uca_get_property_id(const char *property_name); + +/** + * Convert a property ID to the corresponding string + */ +const char* uca_get_property_name(enum uca_property_ids property_id); + +/** + * Return the full property structure for a given ID + */ +uca_property_t *uca_get_full_property(enum uca_property_ids property_id); + + + #ifdef __cplusplus } |