#ifndef _LICENSE_H
#define _LICENSE_H

typedef enum license_result_type {
        ok=0,
	lic_hostid_syntax_error,
	lic_hostid_cannot_obtain,
	lic_hostid_invalid,
	lic_time_syntax_error,
	lic_time_expire_error,
	lic_options_error,
        lic_key_syntax_error,
        lic_wrong_key_error,
	lic_parameter_error
} license_result_type;

#ifdef ENCODE
 
license_result_type
encode (const char * hostid,
	const char * timestr,
	const char * options,
        unsigned long * key1,
	unsigned long * key2,
	unsigned long * hostid1,
	unsigned long * hostid2);

#endif
	
#ifdef DECODE

license_result_type
decode (const char * hostid,
	const char * timestr,
	const char * options,
	const char * key);

license_result_type
validate_hostid (const char * hostid);

license_result_type
validate_time (const char * timestr, int the_year, int the_month, int the_day);

#endif

#endif