高手进~~一个C语言程序麻烦高手给解释下谢谢了,这个我研究了3天没看明白
#include <gphoto2/gphoto2-abilities-list.h>#include <gphoto2/gphoto2-camera.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* \brief Returns a unique id for the camera driver.
*
* \param id a #CameraText
* \return a gphoto2 error code
*
**/
typedef int (* CameraLibraryIdFunc) (CameraText *id);
/**
* \brief Adds the abilities of the supported models to the supplied list.
*
* \param list a #CameraAbilitiesList
* \return a gphoto2 error code
*
**/
typedef int (* CameraLibraryAbilitiesFunc) (CameraAbilitiesList *list);
/**
* \brief Initializes the camera.
*
* \param camera a #Camera
* \param context a #GPContext
* \return a gphoto2 error code
*
* The camera driver will establish a first connection
* to the camera and configure the camera variable (i.e. using
* #gp_filesystem_set_list_funcs or #gp_port_get_settings).
typedef int (* CameraLibraryInitFunc) (Camera *camera, GPContext *context);
/**
* If you want to write a camera library, you need to implement
* the following three functions. Everything else should be declared
* as static.
**/
int camera_id (CameraText *id);
int camera_abilities (CameraAbilitiesList *list);
int camera_init (Camera *camera, GPContext *context);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GPHOTO2_LIBRARY_H__ */
我想问一下int camera_id (CameraText *id);这个是不是函数是camera_id 然后他的参数是后面()里面的东西?那个CameraText是数据类型? *id 又代表什么?
typedef int (* CameraLibraryInitFunc) (Camera *camera, GPContext *context);这一句又是什么意思?我知道typedef int real 是相当于用real可以代替int 那上面那句话是什么意思?又高手能解释下吗?谢谢了