2014-11-19 00:25:21 +08:00
|
|
|
|
#ifndef ACL_PROCTL_INCLUDE_H
|
|
|
|
|
#define ACL_PROCTL_INCLUDE_H
|
|
|
|
|
|
|
|
|
|
#include "stdlib/acl_define.h"
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̵<EFBFBD>ִ<EFBFBD>г<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>·<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param buf {char*} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>λ<EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD>صĽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD>β
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "\" <20><> "/",<2C><><EFBFBD>磺"C:\\test_path\\test1_path", <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* "C:\\test_path\\test1_path\\"
|
|
|
|
|
* @param size {size_t} buf <EFBFBD>Ŀռ<EFBFBD><EFBFBD><EFBFBD>С
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_daemon_path(char *buf, size_t size);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̿<EFBFBD><EFBFBD>ƿ<EFBFBD><EFBFBD>ܣ<EFBFBD><EFBFBD><EFBFBD> acl_proctl_start <EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD>
|
|
|
|
|
* @param progname {const char*} <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_deamon_init(const char *progname);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>̨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD>̵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣<EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_daemon_loop(void);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ڿ<EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progchild {const char*} <EFBFBD>ӽ<EFBFBD><EFBFBD>̵ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param argc {int} argv <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param argv {char* []}
|
|
|
|
|
* @return 0: ok; -1: error
|
|
|
|
|
*/
|
|
|
|
|
ACL_API int acl_proctl_deamon_start_one(const char *progchild, int argc, char *argv[]);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progname {const char*} <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progchild {const char*} <EFBFBD>ӽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param argc {int} argv <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param argv {char* []} <EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD>̵IJ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_start_one(const char *progname,
|
|
|
|
|
const char *progchild, int argc, char *argv[]);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽֹͣij<EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progname {const char*} <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progchild {const char*} <EFBFBD>ӽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param argc {int} argv <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param argv {char* []} <EFBFBD><EFBFBD><EFBFBD>ݸ<EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD>̵IJ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_stop_one(const char *progname,
|
|
|
|
|
const char *progchild, int argc, char *argv[]);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽֹͣ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progname {const char*} <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_stop_all(const char *progname);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ֪ͨ<EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD>ֹͣ<EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD>̣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD>Զ<EFBFBD><EFBFBD>˳<EFBFBD>
|
|
|
|
|
* @param progname {const char*} <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_quit(const char *progname);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>г<EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progname {const char*} <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_list(const char *progname);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ̽<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progname {const char*} <EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param progchild {const char*} <EFBFBD>ӽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_probe(const char *progname, const char *progchild);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>ӽ<EFBFBD><EFBFBD>̵<EFBFBD><EFBFBD>ýӿڣ<EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD>˽ӿ<EFBFBD><EFBFBD>븸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD>佨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD>ϵ
|
|
|
|
|
* @param progname {const char*} <EFBFBD>ӽ<EFBFBD><EFBFBD>̽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param onexit_fn {void (*)(void*)} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD>õĻص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param arg {void*} onexit_fn <EFBFBD><EFBFBD><EFBFBD><EFBFBD>֮һ
|
|
|
|
|
*/
|
|
|
|
|
ACL_API void acl_proctl_child(const char *progname, void (*onexit_fn)(void *), void *arg);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|