Document of c-modernization-kit (porter) 1.0.0
Loading...
Searching...
No Matches
potrGetServiceType.c
Go to the documentation of this file.
1
13
14#include <porter_const.h>
15#include <porter.h>
16
17#include "../protocol/config.h"
18
19/* doxygen コメントは、ヘッダに記載 */
20POTR_EXPORT int POTR_API potrGetServiceType(const char *config_path,
21 int64_t service_id,
22 PotrType *type)
23{
25
26 if (config_path == NULL || type == NULL)
27 {
28 return POTR_ERROR;
29 }
30
31 if (config_load_service(config_path, service_id, &def) != POTR_SUCCESS)
32 {
33 return POTR_ERROR;
34 }
35
36 *type = def.type;
37 return POTR_SUCCESS;
38}
int config_load_service(const char *config_path, int64_t service_id, PotrServiceDef *def)
設定ファイルから指定サービスの定義を読み込みます。
Definition config.c:508
設定ファイル解析モジュールの内部ヘッダー。
#define POTR_SUCCESS
成功の戻り値を表す定数。
#define POTR_ERROR
失敗の戻り値を表す定数。
通信ライブラリ (動的リンク用) のヘッダーファイル。
#define POTR_API
呼び出し規約マクロ。
Definition porter.h:46
#define POTR_EXPORT
DLL エクスポート/インポート制御マクロ。
Definition porter.h:37
通信ライブラリの定数ファイル。
PotrType
通信種別。
Definition porter_type.h:85
POTR_EXPORT int POTR_API potrGetServiceType(const char *config_path, int64_t service_id, PotrType *type)
設定ファイルから指定サービスの通信種別を取得します。
サービス定義。
PotrType type
通信種別。