#ifndef	__GID_OPER_INCLUDE_H__
#define	__GID_OPER_INCLUDE_H__

#ifdef	__cplusplus
extern "C" {
#endif

#include "lib_acl.h"

#define	GID_OK			200	/*  */
#define	GID_ERR_SID		500	/* Ự ID Ų */
#define	GID_ERR_OVERRIDE	501	/* ﵽֵ */
#define	GID_ERR_SAVE		502	/* 洢ʱ */

/**
 * ݴŻַ
 * @param errnum {int} 
 * @return {const char*} 
 */
const char *gid_serror(int errnum);

/**
 * ȡһGID
 * @param path {const char*} ļ洢·
 * @param tag {const char*} IDʶ
 * @param step {unsigned int} ÿεĲֵ
 * @param errnum {int*} ǿգ¼ԭ
 * @return {acl_int64}, ֵ < 0ʾʧܣ
 *  ԭο errnum ķֵ
 */
acl_int64 gid_next(const char *path, const char *tag,
	unsigned int step, int *errnum);

/**
 * ʼӦô˺ʼڲ
 * @param fh_limit {int} ļ
 * @param sync_gid {int} ÿһµ gid Ƿͬʱͬ
 * @param debug_section {int} õıǩֵ
 */
void gid_init(int fh_limit, int sync_gid, int debug_section);

/**
 * ˳ǰô˺ʹڴˢ
 */
void gid_finish(void);

#ifdef	__cplusplus
}
#endif

#endif
