Remove stale/obsolete interface routines

git-svn-id: fc35eccb03ccef1c432fd0fcf5295fcceaca86a6@33941 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6

Global $_LG_DLL = DllOpen("link-grammar.dll")

Func _LG_GetVersion()
	;const char * linkgrammar_get_version(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkgrammar_get_version")
	Return $result[0]
EndFunc   ;==>_LG_GetVersion

Func _LG_DictionaryCreateDefault()
	;Dictionary dictionary_create_default_lang(void);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_default_lang")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateDefault

Func _LG_DictionaryCreateLang($sLanguage)
	;Dictionary dictionary_create_lang(const char * lang);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_lang", "str", $sLanguage)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateLang

;Func _LG_Dictionary_Create($sDictName, $sPostProcessFileName, $sConstituentKnowledgeName, $sAffixName)
;Dictionary dictionary_create(const char *dict_name,
;                             const char *post_process_file_name,
;                             const char *constituent_knowledge_name,
;                             const char *affix_name);EndFunc
;EndFunc

Func _LG_DictionaryDelete($hDictionary)
	;int dictionary_delete(Dictionary dict);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_delete", "ptr", $hDictionary)
EndFunc   ;==>_LG_DictionaryDelete

Func _LG_DictionarySetData($sPath)
	;void dictionary_set_data_dir(const char * path);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_set_data_dir", "str", $sPath)
EndFunc   ;==>_LG_DictionarySetData

Func _LG_DictionaryGetDataDir()
	;const char * dictionary_get_data_dir(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "dictionary_get_data_dir")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetDataDir

Func _LG_DictionaryGetMaxCost($hDictionary)
	;int dictionary_get_max_cost(Dictionary dict);
	$result = DllCall($_LG_DLL, "int:cdecl", "dictionary_get_max_cost", "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetMaxCost

Func _LG_ParseOptionsCreate()
	;Parse_Options  parse_options_create();
	$result = DllCall($_LG_DLL, "ptr:cdecl", "parse_options_create")
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsCreate

Func _LG_ParseOptionsDelete($hOptions)
	;int parse_options_delete(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_delete", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsDelete

Func _LG_ParseOptionsSetVerbosity($hOptions, $iVerbosity)
	;void parse_options_set_verbosity(Parse_Options opts, int verbosity);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_verbosity", "ptr", $hOptions, "int", $iVerbosity)
EndFunc   ;==>_LG_ParseOptionsSetVerbosity

Func _LG_ParseOptionsGetVerbosity($hOptions)
	;int  parse_options_get_verbosity(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_verbosity", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetVerbosity

Func _LG_ParseOptionsSetLinkageLimit($hOptions, $iLinkageLimit)
	;void parse_options_set_linkage_limit(Parse_Options opts, int linkage_limit);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_linkage_limit", "ptr", $hOptions, "int", $iLinkageLimit)
EndFunc   ;==>_LG_ParseOptionsSetLinkageLimit

Func _LG_ParseOptionsGetLinkageLimit($hOptions)
	;int  parse_options_get_linkage_limit(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_linkage_limit", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetLinkageLimit

Func _LG_ParseOptionsSetDisjunctCost($hOptions, $iDisjunctCost)
	;void parse_options_set_disjunct_cost(Parse_Options opts, int disjunct_cost);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_disjunct_cost", "ptr", $hOptions, "int", $iDisjunctCost)
EndFunc   ;==>_LG_ParseOptionsSetDisjunctCost

Func _LG_ParseOptionsGetDisjunctCost($hOptions)
	;int  parse_options_get_disjunct_cost(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_disjunct_cost", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisjunctCost

Func _LG_ParseOptionsSetMinNullCount($hOptions, $iNullCount)
	;void parse_options_set_min_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_min_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMinNullCount

Func _LG_ParseOptionsGetMinNullCount($hOptions)
	;int  parse_options_get_min_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_min_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMinNullCount

Func _LG_ParseOptionsSetMaxNullCount($hOptions, $iNullCount)
	;void parse_options_set_max_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMaxNullCount

Func _LG_ParseOptionsGetMaxNullCount($hOptions)
	;int  parse_options_get_max_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxNullCount

Func _LG_ParseOptionsSetNullBlock($hOptions, $iNullBlock)
	;void parse_options_set_null_block(Parse_Options opts, int null_block);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_null_block", "ptr", $hOptions, "int", $iNullBlock)
EndFunc   ;==>_LG_ParseOptionsSetNullBlock

Func _LG_ParseOptionsGetNullBlock($hOptions)
	;int  parse_options_get_null_block(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_null_block", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetNullBlock

Func _LG_ParseOptionsSetShortLength($hOptions, $iShortLength)
	;void parse_options_set_short_length(Parse_Options opts, int short_length);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_short_length", "ptr", $hOptions, "int", $iShortLength)
EndFunc   ;==>_LG_ParseOptionsSetShortLength

Func _LG_ParseOptionsGetShortLength($hOptions)
	;int  parse_options_get_short_length(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_short_length", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetShortLength

Func _LG_ParseOptionsSetIslandsOk($hOptions, $iIslandsOk)
	;void parse_options_set_islands_ok(Parse_Options opts, int islands_ok);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_islands_ok", "ptr", $hOptions, "int", $iIslandsOk)
EndFunc   ;==>_LG_ParseOptionsSetIslandsOk

Func _LG_ParseOptionsGetIslandsOk($hOptions)
	;int  parse_options_get_islands_ok(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_islands_ok", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetIslandsOk

Func _LG_ParseOptionsSetMaxParseTime($hOptions, $iSeconds)
	;void parse_options_set_max_parse_time(Parse_Options  opts, int secs);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_parse_time", "ptr", $hOptions, "int", $iSeconds)
EndFunc   ;==>_LG_ParseOptionsSetMaxParseTime

Func _LG_ParseOptionsGetMaxParseTime($hOptions)
	;int  parse_options_get_max_parse_time(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_parse_time", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxParseTime

Func _LG_ParseOptionsSetMaxMemory($hOptions, $iMemory)
	;void parse_options_set_max_memory(Parse_Options  opts, int mem);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_memory", "ptr", $hOptions, "int", $iMemory)
EndFunc   ;==>_LG_ParseOptionsSetMaxMemory

Func _LG_ParseOptionsGetMaxMemory($hOptions)
	;int  parse_options_get_max_memory(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_memory", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxMemory

Func _LG_ParseOptionsTimerExpired($hOptions)
	;int  parse_options_timer_expired(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_timer_expired", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsTimerExpired

Func _LG_ParseOptionsMemoryExhausted($hOptions)
	;int  parse_options_memory_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_memory_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsMemoryExhausted

Func _LG_ParseOptionsResourcesExhausted($hOptions)
	;int  parse_options_resources_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_resources_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsResourcesExhausted

Func _LG_ParseOptionsResetResources($hOptions)
	;void parse_options_reset_resources(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_reset_resources", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsResetResources

Func _LG_ParseOptionsSetCostModelType($hOptions, $iCostModel)
	;void parse_options_set_cost_model_type(Parse_Options opts, int cm);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_cost_model_type", "ptr", $hOptions, "int", $iCostModel)
EndFunc   ;==>_LG_ParseOptionsSetCostModelType

Func _LG_ParseOptionsGetCostModelType($hOptions)
	;int  parse_options_get_cost_model_type(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_cost_model_type", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetCostModelType

Func _LG_ParseOptionsSetScreenWidth($hOptions, $iWidth)
	;void parse_options_set_screen_width(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_screen_width", "ptr", $hOptions, "int", $iWidth)
EndFunc   ;==>_LG_ParseOptionsSetScreenWidth

Func _LG_ParseOptionsGetScreenWidth($hOptions)
	;int  parse_options_get_screen_width(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_screen_width", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetScreenWidth

Func _LG_ParseOptionsSetAllowNull($hOptions, $iAllowNull)
	;void parse_options_set_allow_null(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_allow_null", "ptr", $hOptions, "int", $iAllowNull)
EndFunc   ;==>_LG_ParseOptionsSetAllowNull

Func _LG_ParseOptionsGetAllowNull($hOptions)
	;int  parse_options_get_allow_null(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_allow_null", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllowNull

Func _LG_ParseOptionsSetDisplayWalls($hOptions, $iDisplayWalls)
	;void parse_options_set_display_walls(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_display_walls", "ptr", $hOptions, "int", $iDisplayWalls)
EndFunc   ;==>_LG_ParseOptionsSetDisplayWalls

Func _LG_ParseOptionsGetDisplayWalls($hOptions)
	;int  parse_options_get_display_walls(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_display_walls", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisplayWalls

Func _LG_ParseOptionsSetAllShortConnectors($hOptions, $iShortConnectors)
	;void parse_options_set_all_short_connectors(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_all_short_connectors", "ptr", $hOptions, "int", $iShortConnectors)
EndFunc   ;==>_LG_ParseOptionsSetAllShortConnectors

Func _LG_ParseOptionsGetAllShortConnectors($hOptions)
	;int  parse_options_get_all_short_connectors(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_all_short_connectors", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllShortConnectors

Func _LG_SentenceCreate($sInputString, $hDictionary)
	;Sentence sentence_create(const char *input_string, Dictionary dict);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "sentence_create", "str", $sInputString, "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_SentenceCreate

Func _LG_SentenceDelete($hSentence)
	;void sentence_delete(Sentence sent);
	DllCall($_LG_DLL, "none:cdecl", "sentence_delete", "ptr", $hSentence)
EndFunc   ;==>_LG_SentenceDelete

Func _LG_SentenceSplit($hSentence, $hOptions)
	;int sentence_split(Sentence sent, Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "sentence_split", "ptr", $hSentence, "ptr", $hOptions)
EndFunc   ;==>_LG_SentenceSplit

Func _LG_SentenceParse($hSentence, $hOptions)
	;int sentence_parse(Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_parse", "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_SentenceParse

Func _LG_SentenceLength($hSentence)
	;int sentence_length(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_length", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLength

Func _LG_SentenceNullCount($hSentence)
	;int sentence_null_count(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_null_count", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNullCount

Func _LG_SentenceNumLinkagesFound($hSentence)
	;int sentence_num_linkages_found(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_found", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesFound

Func _LG_SentenceNumValidLinkages($hSentence)
	;int sentence_num_valid_linkages(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_valid_linkages", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumValidLinkages

Func _LG_SentenceNumLinkagesPostProcessed($hSentence)
	;int sentence_num_linkages_post_processed(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_post_processed", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesPostProcessed

Func _LG_SentenceNumViolations($hSentence, $iNumber)
	;int sentence_num_violations(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_violations", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumViolations

Func _LG_SentenceDisjunctCost($hSentence, $iNumber)
	;int sentence_disjunct_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_disjunct_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceDisjunctCost

Func _LG_SentenceLinkCost($hSentence, $iNumber)
	;int sentence_link_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_link_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLinkCost

Func _LG_LinkageCreate($iIndex, $hSentence, $hOptions)
	;Linkage  linkage_create(int index, Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "linkage_create", "int", $iIndex, "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_LinkageCreate

Func _LG_LinkageGetNumWords($hLinkage)
	;int linkage_get_num_words(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_words", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumWords

Func _LG_LinkageGetNumLinks($hLinkage)
	;int  linkage_get_num_links(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_links", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumLinks

Func _LG_LinkageGetLinkLength($hLinkage, $iIndex)
	;int linkage_get_link_length(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_length", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLength

Func _LG_LinkageGetLinkLWord($hLinkage, $iIndex)
	;int linkage_get_link_lword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_lword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLWord

Func _LG_LinkageGetLinkRWord($hLinkage, $iIndex)
	;int linkage_get_link_rword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_rword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRWord

Func _LG_LinkagePrintDiagram($hLinkage)
	;char * linkage_print_diagram(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_diagram", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintDiagram

Func _LG_LinkageFreeDiagram($hDiagram)
	;void   linkage_free_diagram(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_diagram", "ptr", $hDiagram)
EndFunc   ;==>_LG_LinkageFreeDiagram

Func _LG_LinkagePrintPostscript($hLinkage, $iMode)
	;char * linkage_print_postscript(Linkage linkage, int mode);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_postscript", "ptr", $hLinkage, "int", $iMode)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintPostscript

Func _LG_LinkageFreePostscript($hPostscript)
	;void   linkage_free_postscript(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_postscript", "ptr", $hPostscript)
EndFunc   ;==>_LG_LinkageFreePostscript

Func _LG_LinkagePrintLinksAndDomains($hLinkage)
	;char * linkage_print_links_and_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_links_and_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintLinksAndDomains

Func _LG_LinkageFreeLinksAndDomains($hLinksAndDomains)
	;void   linkage_free_links_and_domains(char *str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_links_and_domains", "ptr", $hLinksAndDomains)
EndFunc   ;==>_LG_LinkageFreeLinksAndDomains

Func _LG_LinkagePrintConstituentTree($hLinkage, $iOpt)
	;char * linkage_print_constituent_tree(Linkage linkage int iOpt);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_constituent_tree", "ptr", $hLinkage, "int", $iOpt)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintConstituentTree

Func _LG_LinkageGetLinkLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_label(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_label", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLabel

Func _LG_LinkageGetLinkLLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_llabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_llabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLLabel

Func _LG_LinkageGetLinkRLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_rlabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_rlabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRLabel

Func _LG_LinkageGetLinkNumDomains($hLinkage, $iIndex)
	;int     linkage_get_link_num_domains(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_num_domains", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkNumDomains

Func _LG_LinkageGetLinkDomainNames($hLinkage, $iIndex)
	;const char ** linkage_get_link_domain_names(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_domain_names", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkDomainNames

Func _LG_LinkageGetViolationName($hLinkage)
	;const char *  linkage_get_violation_name(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_violation_name", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetViolationName

;Func _LG_LinkageGetWords($hLinkage)
;	;const char ** linkage_get_words(Linkage linkage);
;			$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_words", "ptr", $hLinkage)
;	Return $result[0]
;EndFunc

Func _LG_LinkageGetWord($hLinkage, $iWord)
	;const char *  linkage_get_word(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_word", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetWord

Func _LG_LinkageGetDisjunct($hLinkage, $iWord)
	;const char *  linkage_get_disjunct(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_disjunct", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetDisjunct

Func _LG_LinkageUnusedWordCost($hLinkage)
	;int linkage_unused_word_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_unused_word_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageUnusedWordCost

Func _LG_LinkageDisjunctCost($hLinkage)
	;int linkage_disjunct_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_disjunct_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageDisjunctCost

Func _LG_LinkageLinkCost($hLinkage)
	;int linkage_link_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_link_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageLinkCost

Func _LG_LinkageHasInconsistentDomains($hLinkage)
	;int linkage_has_inconsistent_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_has_inconsistent_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageHasInconsistentDomains

Func _LG_LinkageDelete($hLinkage)
	;void linkage_delete(Linkage linkage);
	$result = DllCall($_LG_DLL, "none:cdecl", "linkage_delete", "ptr", $hLinkage)
EndFunc   ;==>_LG_LinkageDelete

Func _LG_PostProcessOpen($sName)
	;PostProcessor   post_process_open(const char * name);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "post_process_open", "str", $sName)
	Return $result[0]
EndFunc   ;==>_LG_PostProcessOpen

Func _LG_PostProcessClose($hPostProcessor)
	;void            post_process_close(PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "post_process_close", "ptr", $hPostProcessor)
EndFunc   ;==>_LG_PostProcessClose

Func _LG_LinkagePostProcess($hLinkage, $hPostProcessor)
	;void linkage_post_process(Linkage linkage, PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "linkage_post_process", "ptr", $hLinkage, "ptr", $hPostProcessor)
EndFunc   ;==>_LG_LinkagePostProcess

Func _LG_LinkagePrintDisjuncts($hLinkage)
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_disjuncts", "ptr", $hLinkage)
	Return $result[0]
EndFunc

Global $_LG_DLL = DllOpen("link-grammar.dll")

Func _LG_GetVersion()
	;const char * linkgrammar_get_version(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkgrammar_get_version")
	Return $result[0]
EndFunc   ;==>_LG_GetVersion

Func _LG_DictionaryCreateDefault()
	;Dictionary dictionary_create_default_lang(void);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_default_lang")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateDefault

Func _LG_DictionaryCreateLang($sLanguage)
	;Dictionary dictionary_create_lang(const char * lang);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "dictionary_create_lang", "str", $sLanguage)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryCreateLang

;Func _LG_Dictionary_Create($sDictName, $sPostProcessFileName, $sConstituentKnowledgeName, $sAffixName)
;Dictionary dictionary_create(const char *dict_name,
;                             const char *post_process_file_name,
;                             const char *constituent_knowledge_name,
;                             const char *affix_name);EndFunc
;EndFunc

Func _LG_DictionaryDelete($hDictionary)
	;int dictionary_delete(Dictionary dict);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_delete", "ptr", $hDictionary)
EndFunc   ;==>_LG_DictionaryDelete

Func _LG_DictionarySetData($sPath)
	;void dictionary_set_data_dir(const char * path);
	DllCall($_LG_DLL, "none:cdecl", "dictionary_set_data_dir", "str", $sPath)
EndFunc   ;==>_LG_DictionarySetData

Func _LG_DictionaryGetDataDir()
	;const char * dictionary_get_data_dir(void);
	$result = DllCall($_LG_DLL, "str:cdecl", "dictionary_get_data_dir")
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetDataDir

Func _LG_DictionaryGetMaxCost($hDictionary)
	;int dictionary_get_max_cost(Dictionary dict);
	$result = DllCall($_LG_DLL, "int:cdecl", "dictionary_get_max_cost", "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_DictionaryGetMaxCost

Func _LG_ParseOptionsCreate()
	;Parse_Options  parse_options_create();
	$result = DllCall($_LG_DLL, "ptr:cdecl", "parse_options_create")
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsCreate

Func _LG_ParseOptionsDelete($hOptions)
	;int parse_options_delete(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_delete", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsDelete

Func _LG_ParseOptionsSetVerbosity($hOptions, $iVerbosity)
	;void parse_options_set_verbosity(Parse_Options opts, int verbosity);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_verbosity", "ptr", $hOptions, "int", $iVerbosity)
EndFunc   ;==>_LG_ParseOptionsSetVerbosity

Func _LG_ParseOptionsGetVerbosity($hOptions)
	;int  parse_options_get_verbosity(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_verbosity", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetVerbosity

Func _LG_ParseOptionsSetLinkageLimit($hOptions, $iLinkageLimit)
	;void parse_options_set_linkage_limit(Parse_Options opts, int linkage_limit);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_linkage_limit", "ptr", $hOptions, "int", $iLinkageLimit)
EndFunc   ;==>_LG_ParseOptionsSetLinkageLimit

Func _LG_ParseOptionsGetLinkageLimit($hOptions)
	;int  parse_options_get_linkage_limit(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_linkage_limit", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetLinkageLimit

Func _LG_ParseOptionsSetDisjunctCost($hOptions, $iDisjunctCost)
	;void parse_options_set_disjunct_cost(Parse_Options opts, int disjunct_cost);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_disjunct_cost", "ptr", $hOptions, "int", $iDisjunctCost)
EndFunc   ;==>_LG_ParseOptionsSetDisjunctCost

Func _LG_ParseOptionsGetDisjunctCost($hOptions)
	;int  parse_options_get_disjunct_cost(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_disjunct_cost", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisjunctCost

Func _LG_ParseOptionsSetMinNullCount($hOptions, $iNullCount)
	;void parse_options_set_min_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_min_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMinNullCount

Func _LG_ParseOptionsGetMinNullCount($hOptions)
	;int  parse_options_get_min_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_min_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMinNullCount

Func _LG_ParseOptionsSetMaxNullCount($hOptions, $iNullCount)
	;void parse_options_set_max_null_count(Parse_Options opts, int null_count);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_null_count", "ptr", $hOptions, "int", $iNullCount)
EndFunc   ;==>_LG_ParseOptionsSetMaxNullCount

Func _LG_ParseOptionsGetMaxNullCount($hOptions)
	;int  parse_options_get_max_null_count(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_null_count", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxNullCount

Func _LG_ParseOptionsSetNullBlock($hOptions, $iNullBlock)
	;void parse_options_set_null_block(Parse_Options opts, int null_block);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_null_block", "ptr", $hOptions, "int", $iNullBlock)
EndFunc   ;==>_LG_ParseOptionsSetNullBlock

Func _LG_ParseOptionsGetNullBlock($hOptions)
	;int  parse_options_get_null_block(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_null_block", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetNullBlock

Func _LG_ParseOptionsSetShortLength($hOptions, $iShortLength)
	;void parse_options_set_short_length(Parse_Options opts, int short_length);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_short_length", "ptr", $hOptions, "int", $iShortLength)
EndFunc   ;==>_LG_ParseOptionsSetShortLength

Func _LG_ParseOptionsGetShortLength($hOptions)
	;int  parse_options_get_short_length(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_short_length", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetShortLength

Func _LG_ParseOptionsSetIslandsOk($hOptions, $iIslandsOk)
	;void parse_options_set_islands_ok(Parse_Options opts, int islands_ok);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_islands_ok", "ptr", $hOptions, "int", $iIslandsOk)
EndFunc   ;==>_LG_ParseOptionsSetIslandsOk

Func _LG_ParseOptionsGetIslandsOk($hOptions)
	;int  parse_options_get_islands_ok(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_islands_ok", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetIslandsOk

Func _LG_ParseOptionsSetMaxParseTime($hOptions, $iSeconds)
	;void parse_options_set_max_parse_time(Parse_Options  opts, int secs);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_parse_time", "ptr", $hOptions, "int", $iSeconds)
EndFunc   ;==>_LG_ParseOptionsSetMaxParseTime

Func _LG_ParseOptionsGetMaxParseTime($hOptions)
	;int  parse_options_get_max_parse_time(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_parse_time", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxParseTime

Func _LG_ParseOptionsSetMaxMemory($hOptions, $iMemory)
	;void parse_options_set_max_memory(Parse_Options  opts, int mem);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_max_memory", "ptr", $hOptions, "int", $iMemory)
EndFunc   ;==>_LG_ParseOptionsSetMaxMemory

Func _LG_ParseOptionsGetMaxMemory($hOptions)
	;int  parse_options_get_max_memory(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_max_memory", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetMaxMemory

Func _LG_ParseOptionsTimerExpired($hOptions)
	;int  parse_options_timer_expired(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_timer_expired", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsTimerExpired

Func _LG_ParseOptionsMemoryExhausted($hOptions)
	;int  parse_options_memory_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_memory_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsMemoryExhausted

Func _LG_ParseOptionsResourcesExhausted($hOptions)
	;int  parse_options_resources_exhausted(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_resources_exhausted", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsResourcesExhausted

Func _LG_ParseOptionsResetResources($hOptions)
	;void parse_options_reset_resources(Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_reset_resources", "ptr", $hOptions)
EndFunc   ;==>_LG_ParseOptionsResetResources

Func _LG_ParseOptionsSetCostModelType($hOptions, $iCostModel)
	;void parse_options_set_cost_model_type(Parse_Options opts, int cm);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_cost_model_type", "ptr", $hOptions, "int", $iCostModel)
EndFunc   ;==>_LG_ParseOptionsSetCostModelType

Func _LG_ParseOptionsGetCostModelType($hOptions)
	;int  parse_options_get_cost_model_type(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_cost_model_type", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetCostModelType

Func _LG_ParseOptionsSetScreenWidth($hOptions, $iWidth)
	;void parse_options_set_screen_width(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_screen_width", "ptr", $hOptions, "int", $iWidth)
EndFunc   ;==>_LG_ParseOptionsSetScreenWidth

Func _LG_ParseOptionsGetScreenWidth($hOptions)
	;int  parse_options_get_screen_width(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_screen_width", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetScreenWidth

Func _LG_ParseOptionsSetAllowNull($hOptions, $iAllowNull)
	;void parse_options_set_allow_null(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_allow_null", "ptr", $hOptions, "int", $iAllowNull)
EndFunc   ;==>_LG_ParseOptionsSetAllowNull

Func _LG_ParseOptionsGetAllowNull($hOptions)
	;int  parse_options_get_allow_null(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_allow_null", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllowNull

Func _LG_ParseOptionsSetDisplayWalls($hOptions, $iDisplayWalls)
	;void parse_options_set_display_walls(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_display_walls", "ptr", $hOptions, "int", $iDisplayWalls)
EndFunc   ;==>_LG_ParseOptionsSetDisplayWalls

Func _LG_ParseOptionsGetDisplayWalls($hOptions)
	;int  parse_options_get_display_walls(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_display_walls", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetDisplayWalls

Func _LG_ParseOptionsSetAllShortConnectors($hOptions, $iShortConnectors)
	;void parse_options_set_all_short_connectors(Parse_Options opts, int val);
	DllCall($_LG_DLL, "none:cdecl", "parse_options_set_all_short_connectors", "ptr", $hOptions, "int", $iShortConnectors)
EndFunc   ;==>_LG_ParseOptionsSetAllShortConnectors

Func _LG_ParseOptionsGetAllShortConnectors($hOptions)
	;int  parse_options_get_all_short_connectors(Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "parse_options_get_all_short_connectors", "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_ParseOptionsGetAllShortConnectors

Func _LG_SentenceCreate($sInputString, $hDictionary)
	;Sentence sentence_create(const char *input_string, Dictionary dict);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "sentence_create", "str", $sInputString, "ptr", $hDictionary)
	Return $result[0]
EndFunc   ;==>_LG_SentenceCreate

Func _LG_SentenceDelete($hSentence)
	;void sentence_delete(Sentence sent);
	DllCall($_LG_DLL, "none:cdecl", "sentence_delete", "ptr", $hSentence)
EndFunc   ;==>_LG_SentenceDelete

Func _LG_SentenceSplit($hSentence, $hOptions)
	;int sentence_split(Sentence sent, Parse_Options opts);
	DllCall($_LG_DLL, "none:cdecl", "sentence_split", "ptr", $hSentence, "ptr", $hOptions)
EndFunc   ;==>_LG_SentenceSplit

Func _LG_SentenceParse($hSentence, $hOptions)
	;int sentence_parse(Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_parse", "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_SentenceParse

Func _LG_SentenceLength($hSentence)
	;int sentence_length(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_length", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLength

Func _LG_SentenceGetWord($hSentence, $iWord)
	;const char * sentence_get_word(Sentence sent, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "sentence_get_word", "ptr", $hSentence, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_SentenceGetWord

Func _LG_SentenceNullCount($hSentence)
	;int sentence_null_count(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_null_count", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNullCount

Func _LG_SentenceNumLinkagesFound($hSentence)
	;int sentence_num_linkages_found(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_found", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesFound

Func _LG_SentenceNumValidLinkages($hSentence)
	;int sentence_num_valid_linkages(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_valid_linkages", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumValidLinkages

Func _LG_SentenceNumLinkagesPostProcessed($hSentence)
	;int sentence_num_linkages_post_processed(Sentence sent);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_linkages_post_processed", "ptr", $hSentence)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumLinkagesPostProcessed

Func _LG_SentenceNumViolations($hSentence, $iNumber)
	;int sentence_num_violations(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_num_violations", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceNumViolations

Func _LG_SentenceDisjunctCost($hSentence, $iNumber)
	;int sentence_disjunct_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_disjunct_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceDisjunctCost

Func _LG_SentenceLinkCost($hSentence, $iNumber)
	;int sentence_link_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_link_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceLinkCost

Func _LG_SentenceAndCost($hSentence, $iNumber)
	;int sentence_and_cost(Sentence sent, int i);
	$result = DllCall($_LG_DLL, "int:cdecl", "sentence_and_cost", "ptr", $hSentence, "int", $iNumber)
	Return $result[0]
EndFunc   ;==>_LG_SentenceAndCost

Func _LG_LinkageCreate($iIndex, $hSentence, $hOptions)
	;Linkage  linkage_create(int index, Sentence sent, Parse_Options opts);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "linkage_create", "int", $iIndex, "ptr", $hSentence, "ptr", $hOptions)
	Return $result[0]
EndFunc   ;==>_LG_LinkageCreate

Func _LG_LinkageGetNumSublinkages($hLinkage)
	;int linkage_get_num_sublinkages(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_sublinkages", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumSublinkages

Func _LG_LinkageSetCurrentSublinkage($hLinkage, $iIndex)
	;int linkage_set_current_sublinkage(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_set_current_sublinkage", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageSetCurrentSublinkage

Func _LG_LinkageComputeUnion($hLinkage)
	;int linkage_compute_union(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_compute_union", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageComputeUnion

Func _LG_LinkageGetNumWords($hLinkage)
	;int linkage_get_num_words(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_words", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumWords

Func _LG_LinkageGetNumLinks($hLinkage)
	;int  linkage_get_num_links(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_num_links", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetNumLinks

Func _LG_LinkageGetLinkLength($hLinkage, $iIndex)
	;int linkage_get_link_length(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_length", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLength

Func _LG_LinkageGetLinkLWord($hLinkage, $iIndex)
	;int linkage_get_link_lword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_lword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLWord

Func _LG_LinkageGetLinkRWord($hLinkage, $iIndex)
	;int linkage_get_link_rword(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_rword", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRWord

Func _LG_LinkagePrintDiagram($hLinkage)
	;char * linkage_print_diagram(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_diagram", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintDiagram

Func _LG_LinkageFreeDiagram($hDiagram)
	;void   linkage_free_diagram(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_diagram", "ptr", $hDiagram)
EndFunc   ;==>_LG_LinkageFreeDiagram

Func _LG_LinkagePrintPostscript($hLinkage, $iMode)
	;char * linkage_print_postscript(Linkage linkage, int mode);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_postscript", "ptr", $hLinkage, "int", $iMode)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintPostscript

Func _LG_LinkageFreePostscript($hPostscript)
	;void   linkage_free_postscript(char * str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_postscript", "ptr", $hPostscript)
EndFunc   ;==>_LG_LinkageFreePostscript

Func _LG_LinkagePrintLinksAndDomains($hLinkage)
	;char * linkage_print_links_and_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_links_and_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintLinksAndDomains

Func _LG_LinkageFreeLinksAndDomains($hLinksAndDomains)
	;void   linkage_free_links_and_domains(char *str);
	DllCall($_LG_DLL, "none:cdecl", "linkage_free_links_and_domains", "ptr", $hLinksAndDomains)
EndFunc   ;==>_LG_LinkageFreeLinksAndDomains

Func _LG_LinkagePrintConstituentTree($hLinkage, $iOpt)
	;char * linkage_print_constituent_tree(Linkage linkage int iOpt);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_constituent_tree", "ptr", $hLinkage, "int", $iOpt)
	Return $result[0]
EndFunc   ;==>_LG_LinkagePrintConstituentTree

Func _LG_LinkageGetLinkLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_label(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_label", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLabel

Func _LG_LinkageGetLinkLLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_llabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_llabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkLLabel

Func _LG_LinkageGetLinkRLabel($hLinkage, $iIndex)
	;const char * linkage_get_link_rlabel(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_rlabel", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkRLabel

Func _LG_LinkageGetLinkNumDomains($hLinkage, $iIndex)
	;int     linkage_get_link_num_domains(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_link_num_domains", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkNumDomains

Func _LG_LinkageGetLinkDomainNames($hLinkage, $iIndex)
	;const char ** linkage_get_link_domain_names(Linkage linkage, int index);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_link_domain_names", "ptr", $hLinkage, "int", $iIndex)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetLinkDomainNames

Func _LG_LinkageGetViolationName($hLinkage)
	;const char *  linkage_get_violation_name(Linkage linkage);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_violation_name", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetViolationName

;Func _LG_LinkageGetWords($hLinkage)
;	;const char ** linkage_get_words(Linkage linkage);
;			$result = DllCall($_LG_DLL, "int:cdecl", "linkage_get_words", "ptr", $hLinkage)
;	Return $result[0]
;EndFunc

Func _LG_LinkageGetWord($hLinkage, $iWord)
	;const char *  linkage_get_word(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_word", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetWord

Func _LG_LinkageGetDisjunct($hLinkage, $iWord)
	;const char *  linkage_get_disjunct(Linkage linkage, int w);
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_get_disjunct", "ptr", $hLinkage, "int", $iWord)
	Return $result[0]
EndFunc   ;==>_LG_LinkageGetDisjunct

Func _LG_LinkageUnusedWordCost($hLinkage)
	;int linkage_unused_word_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_unused_word_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageUnusedWordCost

Func _LG_LinkageDisjunctCost($hLinkage)
	;int linkage_disjunct_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_disjunct_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageDisjunctCost

Func _LG_LinkageAndCost($hLinkage)
	;int linkage_and_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_and_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageAndCost

Func _LG_LinkageLinkCost($hLinkage)
	;int linkage_link_cost(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_link_cost", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageLinkCost

Func _LG_LinkageIsCanonical($hLinkage)
	;int linkage_is_canonical(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_is_canonical", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageIsCanonical

Func _LG_LinkageIsImproper($hLinkage)
	;int linkage_is_improper(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_is_improper", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageIsImproper

Func _LG_LinkageHasInconsistentDomains($hLinkage)
	;int linkage_has_inconsistent_domains(Linkage linkage);
	$result = DllCall($_LG_DLL, "int:cdecl", "linkage_has_inconsistent_domains", "ptr", $hLinkage)
	Return $result[0]
EndFunc   ;==>_LG_LinkageHasInconsistentDomains

Func _LG_LinkageDelete($hLinkage)
	;void linkage_delete(Linkage linkage);
	$result = DllCall($_LG_DLL, "none:cdecl", "linkage_delete", "ptr", $hLinkage)
EndFunc   ;==>_LG_LinkageDelete

Func _LG_PostProcessOpen($sName)
	;PostProcessor   post_process_open(const char * name);
	$result = DllCall($_LG_DLL, "ptr:cdecl", "post_process_open", "str", $sName)
	Return $result[0]
EndFunc   ;==>_LG_PostProcessOpen

Func _LG_PostProcessClose($hPostProcessor)
	;void            post_process_close(PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "post_process_close", "ptr", $hPostProcessor)
EndFunc   ;==>_LG_PostProcessClose

Func _LG_LinkagePostProcess($hLinkage, $hPostProcessor)
	;void linkage_post_process(Linkage linkage, PostProcessor postprocessor);
	DllCall($_LG_DLL, "none:cdecl", "linkage_post_process", "ptr", $hLinkage, "ptr", $hPostProcessor)
EndFunc   ;==>_LG_LinkagePostProcess

Func _LG_LinkagePrintDisjuncts($hLinkage)
	$result = DllCall($_LG_DLL, "str:cdecl", "linkage_print_disjuncts", "ptr", $hLinkage)
	Return $result[0]
EndFunc


Update GuiCreateEx.au3

Update GuiCreateEx.au3

#include-once
#include <Array.au3>
#include <GUIConstantsEx.au3>

OnAutoItExitRegister("_GUICreateEx_OnExit")

Opt("GUIOnEventMode", 1)
Opt("GUIEventOptions", 1)
Opt("MustDeclareVars", 1)

Global $g__aGuiCreateEx[1] = [0]

#cs
; Example
#include-once
#include <GuiCreateEx.au3>

Global $hGui
Global $hButton_NewGui

$hGui = GUICreateEx("Título[ " & $g__aGuiCreateEx[0] & " ]", 800, 600)
$hButton_NewGui = GUICtrlCreateButton("new gui", 10, 10, 80, 20)
GUICtrlSetOnEvent($hButton_NewGui, "NewGui")
GUISetState(@SW_SHOW, $hGui)

While Sleep(25)
WEnd

Func NewGui()
	Local $aSize = WinGetPos($g__aGuiCreateEx[UBound($g__aGuiCreateEx, 1) - 1])
	Local $hGui = GUICreateEx("Título[ " & $g__aGuiCreateEx[0] & " ]", $aSize[2] - (20 + 6), $aSize[3] - (40 + 5), $aSize[0] + 10, $aSize[1] + 10, Default, Default, $g__aGuiCreateEx[UBound($g__aGuiCreateEx, 1) - 1])
	$hButton_NewGui = GUICtrlCreateButton("new gui", 10, 10, 80, 20)
	GUICtrlSetOnEvent($hButton_NewGui, "NewGui")
	GUISetState(@SW_SHOW, $hGui)
EndFunc   ;==>NewGui
#ce

; #FUNCTION# ====================================================================================================================
; Name...........:	GUICreateEx
; Description ...:	Allow create a new GUI (Graphic User Interface) above current GUI and lock previus GUI
; Syntax.........:	same way of GuiCreate
; Parameters ....:	$sTitle.......: Title's GUI
;					$iWidth.......:	width's GUI
;					$iHeight......: height's GUI
;					$iLeft........:	left position's GUI
; 					$iTop.........: top position's GUI
;					$mStyle.......:	Style's GUI
;					$mExStyle.....:	Extended Style's GUI
;					$iParent......: The handle of another previously created window
; Return values .:	a windows handle
; Author ........:	Luismar Chechelaky
; Modified.......:	2015/06/20 11:25
; Remarks .......:
; Related .......:
; Link ..........:	https://github.com/chechelaky/AutoIt/raw/master/GuiCreateEx/GuiCreateEx.au3
; Example .......:
; ===============================================================================================================================
Func GUICreateEx($sTitle = "", $iWidth = 460, $iHeight = 360, $iLeft = -1, $iTop = -1, $mStyle = Default, $mExStyle = Default, $iParent = 0)
	If Not $g__aGuiCreateEx[0] Then
		$iParent = 0
	Else
		$iParent = $g__aGuiCreateEx[UBound($g__aGuiCreateEx, 1) - 1]
		GUISetState(@SW_DISABLE, $iParent)
	EndIf
	Local $hGui = GUICreate($sTitle, $iWidth, $iHeight, $iLeft, $iTop, $mStyle, $mExStyle, $iParent)
	If @error Then Return SetError(1, 0, 0)
	GUISetOnEvent($GUI_EVENT_CLOSE, "_GUICreateEx_Quit")
	_ArrayAdd($g__aGuiCreateEx, $hGui)
	$g__aGuiCreateEx[0] = UBound($g__aGuiCreateEx, 1) - 1
	Return $g__aGuiCreateEx[$g__aGuiCreateEx[0]]
EndFunc   ;==>GUICreateEx

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........:	_GUICreateEx_OnExit
; Author ........:	Luismar Chechelaky
; Modified.......:	2015/06/20 11:25
; Link ..........:	https://github.com/chechelaky/AutoIt/raw/master/GuiCreateEx/GuiCreateEx.au3
; ===============================================================================================================================
Func _GUICreateEx_OnExit()
	GUISetState($g__aGuiCreateEx[1], @SW_HIDE)
	GUIDelete($g__aGuiCreateEx[1])
EndFunc   ;==>_GUICreateEx_OnExit

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........:	_GUICreateEx_Quit
; Author ........:	Luismar Chechelaky
; Modified.......:	2015/06/20 11:25
; Link ..........:	https://github.com/chechelaky/AutoIt/raw/master/GuiCreateEx/GuiCreateEx.au3
; ===============================================================================================================================
Func _GUICreateEx_Quit()
	Local $hGui
	Switch $g__aGuiCreateEx[0]
		Case 1
			$hGui = $g__aGuiCreateEx[$g__aGuiCreateEx[0]]
			Exit
		Case Else
			GUISetState(@SW_ENABLE, $g__aGuiCreateEx[$g__aGuiCreateEx[0] - 1])
			GUISetState($g__aGuiCreateEx[$g__aGuiCreateEx[0]], @SW_HIDE)
			GUIDelete($g__aGuiCreateEx[$g__aGuiCreateEx[0]])
			_ArrayDelete($g__aGuiCreateEx, UBound($g__aGuiCreateEx, 1) - 1)
			$g__aGuiCreateEx[0] = UBound($g__aGuiCreateEx, 1) - 1
	EndSwitch
EndFunc   ;==>_GUICreateEx_Quit

#include-once
#include <GuiCreateEx.au3> ; https://github.com/chechelaky/AutoIt/blob/master/GuiCreateEx/GuiCreateEx.au3

Global $hGui
Global $hButton_NewGui

$hGui = GUICreateEx("Título[ " & $g__aGuiCreateEx[0] & " ]", 800, 600)
$hButton_NewGui = GUICtrlCreateButton("new gui", 10, 10, 80, 20)
GUICtrlSetOnEvent($hButton_NewGui, "NewGui")
GUISetState(@SW_SHOW, $hGui)

While Sleep(25)
WEnd

Func NewGui()
	Local $aSize = WinGetPos($g__aGuiCreateEx[UBound($g__aGuiCreateEx, 1) - 1])
	Local $hGui = GUICreateEx("Título[ " & $g__aGuiCreateEx[0] & " ]", $aSize[2] - (20 + 6), $aSize[3] - (40 + 5), $aSize[0] + 10, $aSize[1] + 10, Default, Default, $g__aGuiCreateEx[UBound($g__aGuiCreateEx, 1) - 1])
	$hButton_NewGui = GUICtrlCreateButton("new gui", 10, 10, 80, 20)
	GUICtrlSetOnEvent($hButton_NewGui, "NewGui")
	GUISetState(@SW_SHOW, $hGui)
EndFunc   ;==>NewGui


I think we are there

I think we are there

#include "micro.au3"

Func _test_($sTestName)
	$oClassObject = _AutoItObject_Class()
	$oClassObject.Create()
    $dicSteps = ObjCreate("Scripting.Dictionary")

	With $oClassObject
		.AddMethod("addStep","_addStep")
		.AddMethod("countSteps","_countSteps")
		.AddMethod("assertTrue","_assertTrue")
        .AddMethod("stepPassed","_stepPassed")
        .AddMethod("stepFailed","_stepFailed")
	EndWith

	;Property
	With $oClassObject
		.AddProperty("_type_", $ELSCOPE_PUBLIC, "_test_") ;Object type
		.AddProperty("Name", $ELSCOPE_PUBLIC,$sTestName)
		.AddProperty("Steps", $ELSCOPE_PUBLIC, $dicSteps) ;Dictionary with test case steps
		.AddProperty("StepCount",$ELSCOPE_PRIVATE,0)
		.AddProperty("pass",$ELSCOPE_PUBLIC,True)
        .AddProperty("TestResult",$ELSCOPE_PUBLIC,"pass") ;0 Failed - 1 OK
		.AddProperty("TestStepsFailed",$ELSCOPE_PUBLIC,0)
		.AddProperty("TestStepsPassed",$ELSCOPE_PUBLIC,0)
	EndWith

	Return $oClassObject.Object
EndFunc

Func _assertTrue($this, $assertText, $assertion)
	$this.addStep($assertText, $assertion)
EndFunc

Func _addStep($this,$stepText,$assertion)
	Local $step[2] = [$stepText,$assertion]
    $this.StepCount = $this.StepCount + 1
    $this.Steps.Add($this.StepCount, $step)

    If $assertion Then
        $this.stepPassed()
    Else
        $this.testFailed()
	EndIf
EndFunc

Func _stepFailed($this)
    $this.pass = False
    $this.TestResult = "fail"
	$this.TestStepFailed = $this.TestStepFailed + 1
EndFunc

Func _stepPassed($this)
    $this.TestStepPassed = $this.TestStepPassed + 1
EndFunc

#include "micro.au3"

Func _test_($sTestName)
	$oClassObject = _AutoItObject_Class()
	$oClassObject.Create()
    $dicSteps = ObjCreate("Scripting.Dictionary")

	With $oClassObject
		.AddMethod("addStep","_addStep")
		.AddMethod("countSteps","_countSteps")
		.AddMethod("assertTrue","_assertTrue")
        .AddMethod("stepPassed","_stepPassed")
        .AddMethod("stepFailed","_stepFailed")
	EndWith

	;Property
	With $oClassObject
		.AddProperty("_type_", $ELSCOPE_PUBLIC, "_test_") ;Object type
		.AddProperty("Name", $ELSCOPE_PUBLIC,$sTestName)
		.AddProperty("Steps", $ELSCOPE_PUBLIC, $dicSteps) ;Dictionary with test case steps
		.AddProperty("StepCount",$ELSCOPE_PRIVATE,0)
		.AddProperty("pass",$ELSCOPE_PUBLIC,True)
        .AddProperty("TestResult",$ELSCOPE_PUBLIC,"pass") ;0 Failed - 1 OK
		.AddProperty("TestStepsFailed",$ELSCOPE_PUBLIC,0)
		.AddProperty("TestStepsPassed",$ELSCOPE_PUBLIC,0)
	EndWith

	Return $oClassObject.Object
EndFunc

Func _assertTrue($this, $assertText, $assertion)
	$this.addStep($assertText, $assertion)
EndFunc

Func _addStep($this,$stepText,$assertion)
	$this.StepCount = $this.StepCount + 1

    If $assertion Then
        $this.stepPassed()
    Else
        $this.testFailed()
	EndIf

    $step[2] = [$stepText,$assertion]
	$this.Steps.Add($this.StepCount, $step)
EndFunc

Func _stepFailed($this)
    $this.pass = False
    $this.TestResult = "fail"
	$this.TestStepFailed = $this.TestStepFailed + 1
EndFunc

Func _stepPassed($this)
    $this.TestStepPassed = $this.TestStepPassed + 1
EndFunc


riduzione src autoit

riduzione src autoit

#NoTrayIcon
#include <Misc.au3>
#include <array.au3>
_Singleton(@ScriptName)
Global Const $VERSION = "1.0.0"
Global Const $DIST_ZIP_PATH = @AppDataDir & "\daocstarter\" & $VERSION; & "\daocstarter-win32-x64"
Global Const $WORKINGDIR = $DIST_ZIP_PATH & "\dist\daocstarter-win32-x64"
Global Const $EXE = $WORKINGDIR & "\daocstarter.exe"
Global Const $TMP_ZIP_PATH = @TempDir & "\dist.zip"
;~ DirRemove($DIST_ZIP_PATH, 1)

If Not FileExists($EXE) Then
	FileInstall(".\dist.zip", $TMP_ZIP_PATH, 1)
	_Zip_UnzipAll($TMP_ZIP_PATH, $DIST_ZIP_PATH & '\', 1);progress bar
EndIf
ShellExecute($EXE, "", $WORKINGDIR)

Func _Zip_UnzipAll($hZipFile, $hDestPath, $flag = 1)
	If _Zip_DllChk() <> 0 Then Return SetError(_Zip_DllChk(), 0, 0);no dll
	If Not FileExists($hZipFile) Then Return SetError(2, 0, 0) ;no zip file
	If Not FileExists($hDestPath) Then DirCreate($hDestPath)
	Local $aArray[1]
	$oApp = ObjCreate("Shell.Application")
	$oApp.Namespace($hDestPath).CopyHere($oApp.Namespace($hZipFile).Items)
	For $item In $oApp.Namespace($hZipFile).Items
		_ArrayAdd($aArray, $item)
	Next
	While 1
		If $flag = 1 then _Hide()
		If FileExists($hDestPath & "\" & $aArray[UBound($aArray) - 1]) Then
			Return SetError(0, 0, 1)
			ExitLoop
		EndIf
		Sleep(500)
	WEnd
EndFunc

Func _Zip_DllChk()
	If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return 2
	If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return 3
	Return 0
EndFunc

Func _Hide()
	If ControlGetHandle("[CLASS:#32770]", "", "[CLASS:SysAnimate32; INSTANCE:1]") <> "" And WinGetState("[CLASS:#32770]") <> @SW_HIDE	Then ;The Window Exists
		$hWnd = WinGetHandle("[CLASS:#32770]")
		WinSetState($hWnd, "", @SW_HIDE)
	EndIf
EndFunc

#NoTrayIcon
#include <array.au3>
_Singleton(@ScriptName)
Global Const $VERSION = "1.0.0"
Global Const $DIST_ZIP_PATH = @AppDataDir & "\daocstarter\" & $VERSION; & "\daocstarter-win32-x64"
Global Const $WORKINGDIR = $DIST_ZIP_PATH & "\dist\daocstarter-win32-x64"
Global Const $EXE = $WORKINGDIR & "\daocstarter.exe"
Global Const $TMP_ZIP_PATH = @TempDir & "\dist.zip"
;~ DirRemove($DIST_ZIP_PATH, 1)

If FileExists($EXE) Then
	;giaInstallato()
Else
	DirCreate($DIST_ZIP_PATH)
	FileInstall(".\dist.zip", $TMP_ZIP_PATH, 1)
	_Zip_UnzipAll($TMP_ZIP_PATH, $DIST_ZIP_PATH & '\', 1);progress bar
EndIf

ShellExecute($EXE, "", $WORKINGDIR)

Func _Zip_UnzipAll($hZipFile, $hDestPath, $flag = 1)
	If _Zip_DllChk() <> 0 Then Return SetError(_Zip_DllChk(), 0, 0);no dll
	If Not FileExists($hZipFile) Then Return SetError(2, 0, 0) ;no zip file
	If Not FileExists($hDestPath) Then DirCreate($hDestPath)
	Local $aArray[1]
	$oApp = ObjCreate("Shell.Application")
	$oApp.Namespace($hDestPath).CopyHere($oApp.Namespace($hZipFile).Items)
	For $item In $oApp.Namespace($hZipFile).Items
		_ArrayAdd($aArray, $item)
	Next
	While 1
		If $flag = 1 then _Hide()
		If FileExists($hDestPath & "\" & $aArray[UBound($aArray) - 1]) Then
			Return SetError(0, 0, 1)
			ExitLoop
		EndIf
		Sleep(500)
	WEnd
EndFunc

Func _Zip_DllChk()
	If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return 2
	If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return 3
	Return 0
EndFunc

Func _Hide()
	If ControlGetHandle("[CLASS:#32770]", "", "[CLASS:SysAnimate32; INSTANCE:1]") <> "" And WinGetState("[CLASS:#32770]") <> @SW_HIDE	Then ;The Window Exists
		$hWnd = WinGetHandle("[CLASS:#32770]")
		WinSetState($hWnd, "", @SW_HIDE)
	EndIf
EndFunc

Func _Singleton($sOccurenceName, $iFlag = 0)
	Local Const $ERROR_ALREADY_EXISTS = 183
	Local Const $SECURITY_DESCRIPTOR_REVISION = 1
	Local $tSecurityAttributes = 0
	If BitAND($iFlag, 2) Then
		Local $tSecurityDescriptor = DllStructCreate("byte;byte;word;ptr[4]")
		Local $aRet = DllCall("advapi32.dll", "bool", "InitializeSecurityDescriptor", _
				"struct*", $tSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION)
		If @error Then Return SetError(@error, @extended, 0)
		If $aRet[0] Then
			$aRet = DllCall("advapi32.dll", "bool", "SetSecurityDescriptorDacl", _
					"struct*", $tSecurityDescriptor, "bool", 1, "ptr", 0, "bool", 0)
			If @error Then Return SetError(@error, @extended, 0)
			If $aRet[0] Then
				$tSecurityAttributes = DllStructCreate($tagSECURITY_ATTRIBUTES)
				DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes))
				DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($tSecurityDescriptor))
				DllStructSetData($tSecurityAttributes, 3, 0)
			EndIf
		EndIf
	EndIf
	Local $aHandle = DllCall("kernel32.dll", "handle", "CreateMutexW", "struct*", $tSecurityAttributes, "bool", 1, "wstr", $sOccurenceName)
	If @error Then Return SetError(@error, @extended, 0)
	Local $aLastError = DllCall("kernel32.dll", "dword", "GetLastError")
	If @error Then Return SetError(@error, @extended, 0)
	If $aLastError[0] = $ERROR_ALREADY_EXISTS Then
		If BitAND($iFlag, 1) Then
			DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $aHandle[0])
			If @error Then Return SetError(@error, @extended, 0)
			Return SetError($aLastError[0], $aLastError[0], 0)
		Else
			Exit -1
		EndIf
	EndIf
	Return $aHandle[0]
EndFunc


Update BackEffect.au3

Update BackEffect.au3

;~ #AutoIt3Wrapper_AU3Check_Parameters= -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
;~ #Tidy_Parameters=/sf
#include-once
#include <Array.au3>
#include <Color.au3>
#include <GuiConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WinAPIGdi.au3>

; #INDEX# =======================================================================================================================
; Title .........: BackEffect
; AutoIt Version : 3.3.14.2
; Description ...:
; Source.........: https://github.com/chechelaky/AutoIt/blob/master/BackEffect/BackEffect.au3
; Author(s) .....: Luismar Chechelaky (Luigi)
; ===============================================================================================================================

Func AddBack_Effect($hGui, $hControl = 0, $iBorder = 4)
	#forcedef $g_oBackeffect_Control
	If Not $hControl Or $g_oBackeffect_Control.Exists($hControl) Then Return SetError(1, 0, 0)
	Local $aPos = ControlGetPos($hGui, "", $hControl)
	Local $temp = GUICtrlCreateLabel("", $aPos[0] - $iBorder, $aPos[1] - $iBorder, $aPos[2] + $iBorder * 2, $aPos[3] + $iBorder * 2)
	$g_oBackeffect_Control.Add($hControl, $temp)
	$g_oBackeffect_Control.Add($temp, $temp)
EndFunc   ;==>AddBack_Effect

Func __BackEffectStart($hGui = 0, $iColorOver = 0x00FF00, $iDelay = 10, $iIncrement = 5)
	__BackEffect_EvalNumber($iDelay, 10)
	__BackEffect_EvalNumber($iIncrement, 2)

	If Not IsDeclared("g_aBackEffect_Over") Then Global $g_aBackEffect_Over = __BackEffect_SplitColor(Hex($iColorOver, 6))
	If Not IsDeclared("g_aBackEffect_Back") Then Global $g_aBackEffect_Back = __BackEffect_SplitColor(Hex(GUIGetBkColor($hGui), 6))
;~ 	ConsoleWrite("$g_aBackEffect_Back[" & $g_aBackEffect_Back & "]" & @LF)
;~ 	ConsoleWrite("$g_aBackEffect_Back[ " &  $g_aBackEffect_Back & " ]" & @LF)
	If Not IsDeclared("g_iBackeffect_Delay") Then Global $g_iBackeffect_Delay = $iDelay
	If Not IsDeclared("g_iBackeffect_Increment") Then Global $g_iBackeffect_Increment = $iIncrement
	If Not IsDeclared("g_oBackeffect_Control") Then Global $g_oBackeffect_Control = ObjCreate("Scripting.Dictionary")
	If Not IsDeclared("g_oBackeffect_Label") Then Global $g_oBackeffect_Label = ObjCreate("Scripting.Dictionary")
	If Not IsDeclared("g_aBackeffect_Split") Then Global $g_aBackeffect_Channel
	If Not IsDeclared("g_aBackeffect_RGB") Then Global $g_aBackeffect_Channel
	If Not IsDeclared("g_aMouse") Then Global $g_aMouse
	If Not IsDeclared("g_iOVER") Then Global $g_iOVER
	If Not IsDeclared("g_hGui") Then Global $g_hGui

	AdlibRegister("__BackEffect", $g_iBackeffect_Delay)
	OnAutoItExitRegister("__BackEffectStop")
EndFunc   ;==>__BackEffectStart

Func __BackEffect_EvalNumber(ByRef $iNumber, $iMin)
	$iNumber = Int(Abs(Number($iNumber)))
	$iNumber = ($iNumber < $iMin) ? $iMin : $iNumber
EndFunc   ;==>__BackEffect_EvalNumber

Func __BackEffectStop()
	AdlibUnRegister("__BackEffect")
EndFunc   ;==>__BackEffectStop

Func __BackEffect()
	$g_aMouse = GUIGetCursorInfo($g_hGui)
	If @error Or Not $g_aMouse[4] Then
		$g_iOVER = 0
	Else
		$g_iOVER = $g_oBackeffect_Control.Item($g_aMouse[4])
	EndIf

	If $g_iOVER And Not $g_oBackeffect_Label.Exists($g_iOVER) Then $g_oBackeffect_Label.Add($g_iOVER, Hex($g_aBackEffect_Back[3]))
	For $each In $g_oBackeffect_Label
		If $each == $g_iOVER Then
			If Not ("0x" & $g_oBackeffect_Label.Item($each) == $g_aBackEffect_Over[3]) Then
				$g_aBackeffect_Channel = __BackEffect_SplitColor($g_oBackeffect_Label.Item($each))
				For $ii = 0 To 2
					$g_aBackeffect_Channel[$ii] = __BackEffect_Compare($g_aBackEffect_Over[$ii], $g_aBackeffect_Channel[$ii], $g_aBackeffect_Channel[$ii])
				Next
				$g_oBackeffect_Label.Item($each) = Hex($g_aBackeffect_Channel[0], 2) & Hex($g_aBackeffect_Channel[1], 2) & Hex($g_aBackeffect_Channel[2], 2)
				GUICtrlSetBkColor($each, "0x" & $g_oBackeffect_Label.Item($each))
			EndIf
		Else
			If Not ("0x" & $g_oBackeffect_Label.Item($each) == $g_aBackEffect_Back[3]) Then
				$g_aBackeffect_Channel = __BackEffect_SplitColor($g_oBackeffect_Label.Item($each))
				For $ii = 0 To 2
					$g_aBackeffect_Channel[$ii] = __BackEffect_Compare($g_aBackEffect_Back[$ii], $g_aBackeffect_Channel[$ii], $g_aBackeffect_Channel[$ii])
				Next
				$g_oBackeffect_Label.Item($each) = Hex($g_aBackeffect_Channel[0], 2) & Hex($g_aBackeffect_Channel[1], 2) & Hex($g_aBackeffect_Channel[2], 2)
				GUICtrlSetBkColor($each, "0x" & $g_oBackeffect_Label.Item($each))
			EndIf
		EndIf
	Next
EndFunc   ;==>__BackEffect

Func __BackEffect_Compare($FROM, $TO, $iChannel)
;~ 	ConsoleWrite("__BackEffect_Compare( $FROM=" & $FROM & ", $TO=" & $TO & ", $iChannel=" & $iChannel & " )" & @LF)
	Switch $FROM
		Case $TO
			Return $FROM
		Case Else
			If $FROM > $TO Then
				$iChannel = $TO + $g_iBackeffect_Increment
				If $iChannel > $FROM Then Return $FROM
			Else
				$iChannel = $TO - $g_iBackeffect_Increment
				If $iChannel < $FROM Then Return $FROM
			EndIf
	EndSwitch
	Return $iChannel
EndFunc   ;==>__BackEffect_Compare

Func __BackEffect_SplitColor($input)
;~ 	ConsoleWrite("__BackEffect_SplitColor[ " & $input & " ] $Red[ " & $Red & " ] $Green[ " & $Green & " ] $Blue[ " & $Blue & " ]" & @LF)
	Local $arr[4] = [BitAND(BitShift("0x" & $input, 16), 0xFF), BitAND(BitShift("0x" & $input, 8), 0xFF), BitAND("0x" & $input, 0xFF), "0x" & $input]
	Return $arr
EndFunc   ;==>__BackEffect_SplitColor

; #FUNCTION# ====================================================================================================================
; Name ..........: GUIGetBkColor
; Description ...: Retrieves the RGB value of the GUI background.
; Syntax ........: GUIGetBkColor($hWnd)
; Parameters ....: $hWnd                - A handle of the GUI.
; Return values .: Success - RGB value
;                  Failure - 0
; Author ........: guinness
; Example .......: Yes
; ===============================================================================================================================
Func GUIGetBkColor($hWnd)
	Local $iColor = 0
	If IsHWnd($hWnd) Then
		Local $hDC = _WinAPI_GetDC($hWnd)
		$iColor = _WinAPI_GetBkColor($hDC)
		_WinAPI_ReleaseDC($hWnd, $hDC)
	EndIf
	Return $iColor
EndFunc   ;==>GUIGetBkColor

;~ #AutoIt3Wrapper_AU3Check_Parameters= -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
;~ #Tidy_Parameters=/sf
#include-once
#include <Array.au3>
#include <Color.au3>
#include <GuiConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WinAPIGdi.au3>

; #INDEX# =======================================================================================================================
; Title .........: BackEffect
; AutoIt Version : 3.3.14.2
; Description ...:
; Author(s) .....: Luismar Chechelaky (Luigi)
; ===============================================================================================================================

Func AddBack_Effect($hGui, $hControl = 0, $iBorder = 4)
	#forcedef $g_oBackeffect_Control
	If Not $hControl Or $g_oBackeffect_Control.Exists($hControl) Then Return SetError(1, 0, 0)
	Local $aPos = ControlGetPos($hGui, "", $hControl)
	Local $temp = GUICtrlCreateLabel("", $aPos[0] - $iBorder, $aPos[1] - $iBorder, $aPos[2] + $iBorder * 2, $aPos[3] + $iBorder * 2)
	$g_oBackeffect_Control.Add($hControl, $temp)
	$g_oBackeffect_Control.Add($temp, $temp)
EndFunc   ;==>AddBack_Effect

Func __BackEffectStart($hGui = 0, $iColorOver = 0x00FF00, $iDelay = 10, $iIncrement = 5)
	__BackEffect_EvalNumber($iDelay, 10)
	__BackEffect_EvalNumber($iIncrement, 2)

	If Not IsDeclared("g_aBackEffect_Over") Then Global $g_aBackEffect_Over = __BackEffect_SplitColor(Hex($iColorOver, 6))
	If Not IsDeclared("g_aBackEffect_Back") Then Global $g_aBackEffect_Back = __BackEffect_SplitColor(Hex(GUIGetBkColor($hGui), 6))
;~ 	ConsoleWrite("$g_aBackEffect_Back[" & $g_aBackEffect_Back & "]" & @LF)
;~ 	ConsoleWrite("$g_aBackEffect_Back[ " &  $g_aBackEffect_Back & " ]" & @LF)
	If Not IsDeclared("g_iBackeffect_Delay") Then Global $g_iBackeffect_Delay = $iDelay
	If Not IsDeclared("g_iBackeffect_Increment") Then Global $g_iBackeffect_Increment = $iIncrement
	If Not IsDeclared("g_oBackeffect_Control") Then Global $g_oBackeffect_Control = ObjCreate("Scripting.Dictionary")
	If Not IsDeclared("g_oBackeffect_Label") Then Global $g_oBackeffect_Label = ObjCreate("Scripting.Dictionary")
	If Not IsDeclared("g_aBackeffect_Split") Then Global $g_aBackeffect_Channel
	If Not IsDeclared("g_aBackeffect_RGB") Then Global $g_aBackeffect_Channel
	If Not IsDeclared("g_aMouse") Then Global $g_aMouse
	If Not IsDeclared("g_iOVER") Then Global $g_iOVER
	If Not IsDeclared("g_hGui") Then Global $g_hGui

	AdlibRegister("__BackEffect", $g_iBackeffect_Delay)
	OnAutoItExitRegister("__BackEffectStop")
EndFunc   ;==>__BackEffectStart

Func __BackEffect_EvalNumber(ByRef $iNumber, $iMin)
	$iNumber = Int(Abs(Number($iNumber)))
	$iNumber = ($iNumber < $iMin) ? $iMin : $iNumber
EndFunc   ;==>__BackEffect_EvalNumber

Func __BackEffectStop()
	AdlibUnRegister("__BackEffect")
EndFunc   ;==>__BackEffectStop

Func __BackEffect()
	$g_aMouse = GUIGetCursorInfo($g_hGui)
	If @error Or Not $g_aMouse[4] Then
		$g_iOVER = 0
	Else
		$g_iOVER = $g_oBackeffect_Control.Item($g_aMouse[4])
	EndIf

	If $g_iOVER And Not $g_oBackeffect_Label.Exists($g_iOVER) Then $g_oBackeffect_Label.Add($g_iOVER, Hex($g_aBackEffect_Back[3]))
	For $each In $g_oBackeffect_Label
		If $each == $g_iOVER Then
			If Not ("0x" & $g_oBackeffect_Label.Item($each) == $g_aBackEffect_Over[3]) Then
				$g_aBackeffect_Channel = __BackEffect_SplitColor($g_oBackeffect_Label.Item($each))
				For $ii = 0 To 2
					$g_aBackeffect_Channel[$ii] = __BackEffect_Compare($g_aBackEffect_Over[$ii], $g_aBackeffect_Channel[$ii], $g_aBackeffect_Channel[$ii])
				Next
				$g_oBackeffect_Label.Item($each) = Hex($g_aBackeffect_Channel[0], 2) & Hex($g_aBackeffect_Channel[1], 2) & Hex($g_aBackeffect_Channel[2], 2)
				GUICtrlSetBkColor($each, "0x" & $g_oBackeffect_Label.Item($each))
			EndIf
		Else
			If Not ("0x" & $g_oBackeffect_Label.Item($each) == $g_aBackEffect_Back[3]) Then
				$g_aBackeffect_Channel = __BackEffect_SplitColor($g_oBackeffect_Label.Item($each))
				For $ii = 0 To 2
					$g_aBackeffect_Channel[$ii] = __BackEffect_Compare($g_aBackEffect_Back[$ii], $g_aBackeffect_Channel[$ii], $g_aBackeffect_Channel[$ii])
				Next
				$g_oBackeffect_Label.Item($each) = Hex($g_aBackeffect_Channel[0], 2) & Hex($g_aBackeffect_Channel[1], 2) & Hex($g_aBackeffect_Channel[2], 2)
				GUICtrlSetBkColor($each, "0x" & $g_oBackeffect_Label.Item($each))
			EndIf
		EndIf
	Next
EndFunc   ;==>__BackEffect

Func __BackEffect_Compare($FROM, $TO, $iChannel)
;~ 	ConsoleWrite("__BackEffect_Compare( $FROM=" & $FROM & ", $TO=" & $TO & ", $iChannel=" & $iChannel & " )" & @LF)
	Switch $FROM
		Case $TO
			Return $FROM
		Case Else
			If $FROM > $TO Then
				$iChannel = $TO + $g_iBackeffect_Increment
				If $iChannel > $FROM Then Return $FROM
			Else
				$iChannel = $TO - $g_iBackeffect_Increment
				If $iChannel < $FROM Then Return $FROM
			EndIf
	EndSwitch
	Return $iChannel
EndFunc   ;==>__BackEffect_Compare

Func __BackEffect_SplitColor($input)
;~ 	ConsoleWrite("__BackEffect_SplitColor[ " & $input & " ] $Red[ " & $Red & " ] $Green[ " & $Green & " ] $Blue[ " & $Blue & " ]" & @LF)
	Local $arr[4] = [BitAND(BitShift("0x" & $input, 16), 0xFF), BitAND(BitShift("0x" & $input, 8), 0xFF), BitAND("0x" & $input, 0xFF), "0x" & $input]
	Return $arr
EndFunc   ;==>__BackEffect_SplitColor

; #FUNCTION# ====================================================================================================================
; Name ..........: GUIGetBkColor
; Description ...: Retrieves the RGB value of the GUI background.
; Syntax ........: GUIGetBkColor($hWnd)
; Parameters ....: $hWnd                - A handle of the GUI.
; Return values .: Success - RGB value
;                  Failure - 0
; Author ........: guinness
; Example .......: Yes
; ===============================================================================================================================
Func GUIGetBkColor($hWnd)
	Local $iColor = 0
	If IsHWnd($hWnd) Then
		Local $hDC = _WinAPI_GetDC($hWnd)
		$iColor = _WinAPI_GetBkColor($hDC)
		_WinAPI_ReleaseDC($hWnd, $hDC)
	EndIf
	Return $iColor
EndFunc   ;==>GUIGetBkColor


Add support AmaRecTV 4

Add support AmaRecTV 4

fix https://github.com/hasegaw/IkaLog/issues/406

Signed-off-by: AIZAWA Hina <07c779d48779c322a7c5324109202f9012f7aebf@bouhime.com>

;
;  IkaLog
;  ======
;  Copyright (C) 2015 Takeshi HASEGAWA
;
;  Licensed under the Apache License, Version 2.0 (the 'License');
;  you may not use this file except in compliance with the License.
;  You may obtain a copy of the License at
;
;      http://www.apache.org/licenses/LICENSE-2.0
;
;  Unless required by applicable law or agreed to in writing, software
;  distributed under the License is distributed on an 'AS IS' BASIS,
;  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;  See the License for the specific language governing permissions and
;  limitations under the License.

;
;  Start and stop recording using Open Broadcaster Software(OBS).
;
;  To Start Recording:
;    ControlAmarecTV.au3 start
;
;  To Stop Recording:
;    ControlAmarecTV.au3 stop
;
;  To Reanem the recording:
;    If you want to rename the recording to a specific filename,
;    Specifcy the filename as environment variables
;    IKALOG_MP4_DESTDIR and IKALOG_MP4_DESTNAME.
;
;  Though this script will sleep seconds so that work on
;  a specific environment. The behavior is subject to change.
;

#include <FileConstants.au3>
#include <StringConstants.au3>

;ƍD݂ɍ킹Ēlݒ肵ĂB
;SendL[̒l̏ɂ  https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm
Const $SendKeyValue = "^z"      ;AmaRecTV̘^Jnɐݒ肳ĂL[̒l
Const $STARTsleepSec = 0        ;^Jn̑ҋ@ԁibŎwj
Const $STOPsleepSec = 10        ;^Ȋҋ@ԁibŎwj
Const $RENAMEsleepSec = 3       ;^Iナl[܂ł̑ҋ@ԁibŎwj

Func RenameFile($source)
    Local $dest = EnvGet('IKALOG_MP4_DESTNAME')
    $dest = StringReplace($dest, "/", "\")
    If $dest = '' Then
        Return False
    EndIf

    ; IkaLog assumes mp4 as video file extension, but AmarecTV uses avi.
    If StringRight($dest, 4) = ".mp4" Then
        $dest = StringReplace($dest, ".mp4", ".avi", -1)
    EndIf

    FileMove($source, $dest, $FC_OVERWRITE)
EndFunc

Func FindRecentRecording()
    Local $directory = EnvGet('IKALOG_MP4_DESTDIR')

    ; Replace all slashes to backslashes.
    ; $directory also needs a backslash at its end.
    $directory = StringReplace($directory, "/", "\")
    If StringRight($directory, 1) <> "\" Then
        $directory = $directory & "\"
    EndIf

    Local $hSearch = FileFindFirstFile($directory & "*.avi*")

    If $hSearch = -1 Then
        MsgBox(0, "Error", "Could not find any candinates in " & $directory & " (path 1)", 10)
        Return False
    EndIf

    Local $latest_file = ''
    Local $latest_timestamp = ''

    While True
        Local $file = FileFindNextFile($hSearch)
        If @error Then ExitLoop

        Local $timestamp = FileGetTime($directory & $file, $FT_MODIFIED, $FT_STRING)
        If StringCompare($timestamp, $latest_timestamp) > 0 Then
            $latest_file = $directory & $file
            $latest_timestamp = $timestamp
        EndIf
    WEnd

    FileClose($hSearch)

    If $latest_file = '' Then
        MsgBox(0, "Error", "Could not find any candinates in " & $directory & " (path 2)", 10)
        Return False
    EndIf

    Return $latest_file
EndFunc

Func ControlAmarecTV($stop)
    Local $hWnd = 0
    If WinExists('[CLASS:AmaRecTV; INSTANCE:2]') Then
        $hWnd = WinWait('[CLASS:AmaRecTV; INSTANCE:2]', '', 1)
    Else
        $hWnd = WinWait('[CLASS:AmaRecTV4; INSTANCE:2]', '', 1)
    EndIf

    If $hWnd = 0 Then
        MsgBox(0, "Error", "Could not find AmarecTV")
        Return False
    EndIf

    Local $text = ControlGetText($hWnd, "", "[CLASS:msctls_statusbar32]")
    Local $inRecording = StringInStr($text, '^撆...') > 0

    ;Xg擾nhƔr,ႤƂ̓t[ȂƂ݂Ȃւ
    Local $ListhWnd = GetAmaRecHandleFromList()
    If ($ListhWnd <> 0) And ($ListhWnd <> $hWnd) Then
        $hWnd = $ListhWnd
    EndIf

    Local $click = False
    If $inRecording and $stop Then
        ;Stop Recording.
        $click = True
    ElseIf (Not $inRecording) and (Not $stop) Then
        ; Start Recording.
        $click = True
    EndIf

    If $click Then
        If $stop Then
            ; ^Iҋ@
            Sleep(1000 * $STOPsleepSec)
        Else
            ; ^Jnҋ@
            Sleep(1000 * $STARTsleepSec)
        EndIf

        WinActivate($hWnd)
        WinWaitActive($hWnd, "", 1)

        ; SendKey
        Send($SendkeyValue)

        If $stop Then
            If EnvGet('IKALOG_MP4_DESTDIR') <> "" Then
                Sleep(1000 * $RENAMEsleepSec)
                Local $file  = FindRecentRecording()
                RenameFile($file)
            EndIf
        EndIf
    EndIf
EndFunc

;EChEA^CgAmaRecTV, NXDisplay܂܂ĂAAmaRecTVƔFănhԂ
Func IsVisible($handle)
    If BitAnd( WinGetState($handle), 2 ) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc

; $var[$i][0]:^Cg, $var[$i][1]:nh
Func GetAmaRecHandleFromList()
    Local $var = WinList()
    Local $retValue = 0
    For $i = 1 to $var[0][0]
        ; ŖÔEBhÊ
        If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
            If StringInStr($var[$i][0], "AmaRecTV") Or StringInStr($var[$i][0], "AmaRecTV4") Then
                If (StringInStr(WinGetClassList($var[$i][0]), "Display")) Then
                    $retValue = $var[$i][1]
                    Return $retValue
                EndIf
            EndIf
        EndIf
    Next
    Return $retValue
EndFunc

if ($CmdLine[0] = 0) Then
    Local $msg = StringFormat("%s%s", "--- NIvV---", @LF)
    $msg = StringFormat("%s%s%s%s%s",$msg, "^Jn:", @ScriptName, " start", @LF)
    $msg = StringFormat("%s%s%s%s", $msg, "^I:", @ScriptName, " stop" & @LF & @LF)
    $msg = StringFormat("%s%s%s", $msg, "--- ݂̐ݒ --- ", @LF)
    $msg = StringFormat("%s%s%s%s", $msg, "zbgL[̒l: ", $SendKeyValue, @LF)
    $msg = StringFormat("%s^Jn̑ҋ@ %sb%s", $msg, $STARTsleepSec, @LF)
    $msg = StringFormat("%s^Ȋҋ@ %sb%s", $msg, $STOPsleepSec,  @LF)
    $msg = StringFormat("%sl[̑ҋ@ %sb%s", $msg, $RENAMEsleepSec, @LF)
    MsgBox(64, "NIvV & ݂̐ݒ", $msg)
Else
    $stop = StringCompare($CmdLine[1], 'stop') == 0
    ControlAmarecTV($stop)
EndIf

;
;  IkaLog
;  ======
;  Copyright (C) 2015 Takeshi HASEGAWA
;
;  Licensed under the Apache License, Version 2.0 (the 'License');
;  you may not use this file except in compliance with the License.
;  You may obtain a copy of the License at
;
;      http://www.apache.org/licenses/LICENSE-2.0
;
;  Unless required by applicable law or agreed to in writing, software
;  distributed under the License is distributed on an 'AS IS' BASIS,
;  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;  See the License for the specific language governing permissions and
;  limitations under the License.

;
;  Start and stop recording using Open Broadcaster Software(OBS).
;
;  To Start Recording:
;    ControlAmarecTV.au3 start
;
;  To Stop Recording:
;    ControlAmarecTV.au3 stop
;
;  To Reanem the recording:
;    If you want to rename the recording to a specific filename,
;    Specifcy the filename as environment variables
;    IKALOG_MP4_DESTDIR and IKALOG_MP4_DESTNAME.
;
;  Though this script will sleep seconds so that work on
;  a specific environment. The behavior is subject to change.
;

#include <FileConstants.au3>
#include <StringConstants.au3>

;ƍD݂ɍ킹Ēlݒ肵ĂB
;SendL[̒l̏ɂ  https://www.autoitscript.com/autoit3/docs/appendix/SendKeys.htm
Const $SendKeyValue = "^z"      ;AmaRecTV̘^Jnɐݒ肳ĂL[̒l
Const $STARTsleepSec = 0        ;^Jn̑ҋ@ԁibŎwj
Const $STOPsleepSec = 10        ;^Ȋҋ@ԁibŎwj
Const $RENAMEsleepSec = 3       ;^Iナl[܂ł̑ҋ@ԁibŎwj

Func RenameFile($source)
    Local $dest = EnvGet('IKALOG_MP4_DESTNAME')
    $dest = StringReplace($dest, "/", "\")
    If $dest = '' Then
        Return False
    EndIf

    ; IkaLog assumes mp4 as video file extension, but AmarecTV uses avi.
    If StringRight($dest, 4) = ".mp4" Then
        $dest = StringReplace($dest, ".mp4", ".avi", -1)
    EndIf

    FileMove($source, $dest, $FC_OVERWRITE)
EndFunc

Func FindRecentRecording()
    Local $directory = EnvGet('IKALOG_MP4_DESTDIR')

    ; Replace all slashes to backslashes.
    ; $directory also needs a backslash at its end.
    $directory = StringReplace($directory, "/", "\")
    If StringRight($directory, 1) <> "\" Then
        $directory = $directory & "\"
    EndIf

    Local $hSearch = FileFindFirstFile($directory & "*.avi*")

    If $hSearch = -1 Then
        MsgBox(0, "Error", "Could not find any candinates in " & $directory & " (path 1)", 10)
        Return False
    EndIf

    Local $latest_file = ''
    Local $latest_timestamp = ''

    While True
        Local $file = FileFindNextFile($hSearch)
        If @error Then ExitLoop

        Local $timestamp = FileGetTime($directory & $file, $FT_MODIFIED, $FT_STRING)
        If StringCompare($timestamp, $latest_timestamp) > 0 Then
            $latest_file = $directory & $file
            $latest_timestamp = $timestamp
        EndIf
    WEnd

    FileClose($hSearch)

    If $latest_file = '' Then
        MsgBox(0, "Error", "Could not find any candinates in " & $directory & " (path 2)", 10)
        Return False
    EndIf

    Return $latest_file
EndFunc

Func ControlAmarecTV($stop)
    Local $hWnd = WinWait('[CLASS:AmaRecTV; INSTANCE:2]', '', 1)

    If $hWnd = 0 Then
        MsgBox(0, "Error", "Could not find AmarecTV")
        Return False
    EndIf

    Local $text = ControlGetText($hWnd, "", "[CLASS:msctls_statusbar32]")
    Local $inRecording = StringInStr($text, '^撆...') > 0

    ;Xg擾nhƔr,ႤƂ̓t[ȂƂ݂Ȃւ
    Local $ListhWnd = GetAmaRecHandleFromList()
    If ($ListhWnd <> 0) And ($ListhWnd <> $hWnd) Then
        $hWnd = $ListhWnd
    EndIf

    Local $click = False
    If $inRecording and $stop Then
        ;Stop Recording.
        $click = True
    ElseIf (Not $inRecording) and (Not $stop) Then
        ; Start Recording.
        $click = True
    EndIf

    If $click Then
        If $stop Then
            ; ^Iҋ@
            Sleep(1000 * $STOPsleepSec)
        Else
            ; ^Jnҋ@
            Sleep(1000 * $STARTsleepSec)
        EndIf

        WinActivate($hWnd)
        WinWaitActive($hWnd, "", 1)

        ; SendKey
        Send($SendkeyValue)

        If $stop Then
            If EnvGet('IKALOG_MP4_DESTDIR') <> "" Then
                Sleep(1000 * $RENAMEsleepSec)
                Local $file  = FindRecentRecording()
                RenameFile($file)
            EndIf
        EndIf
    EndIf
EndFunc

;EChEA^CgAmaRecTV, NXDisplay܂܂ĂAAmaRecTVƔFănhԂ
Func IsVisible($handle)
    If BitAnd( WinGetState($handle), 2 ) Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc

; $var[$i][0]:^Cg, $var[$i][1]:nh
Func GetAmaRecHandleFromList()
    Local $var = WinList()
    Local $retValue = 0
    For $i = 1 to $var[0][0]
        ; ŖÔEBhÊ
        If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
            If StringInStr($var[$i][0], "AmaRecTV") Then
                If (StringInStr(WinGetClassList($var[$i][0]), "Display")) Then
                    $retValue = $var[$i][1]
                    Return $retValue
                EndIf
            EndIf
        EndIf
    Next
    Return $retValue
EndFunc

if ($CmdLine[0] = 0) Then
    Local $msg = StringFormat("%s%s", "--- NIvV---", @LF)
    $msg = StringFormat("%s%s%s%s%s",$msg, "^Jn:", @ScriptName, " start", @LF)
    $msg = StringFormat("%s%s%s%s", $msg, "^I:", @ScriptName, " stop" & @LF & @LF)
    $msg = StringFormat("%s%s%s", $msg, "--- ݂̐ݒ --- ", @LF)
    $msg = StringFormat("%s%s%s%s", $msg, "zbgL[̒l: ", $SendKeyValue, @LF)
    $msg = StringFormat("%s^Jn̑ҋ@ %sb%s", $msg, $STARTsleepSec, @LF)
    $msg = StringFormat("%s^Ȋҋ@ %sb%s", $msg, $STOPsleepSec,  @LF)
    $msg = StringFormat("%sl[̑ҋ@ %sb%s", $msg, $RENAMEsleepSec, @LF)
    MsgBox(64, "NIvV & ݂̐ݒ", $msg)
Else
    $stop = StringCompare($CmdLine[1], 'stop') == 0
    ControlAmarecTV($stop)
EndIf


Update mancala.au3

Update mancala.au3

;~ #AutoIt3Wrapper_AU3Check_Parameters= -q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7
;~ #Tidy_Parameters=/sf

; #SCRIPT# ======================================================================================================================
; Name ..........: mancala.au3
; Author ........: Luigi (Luismar Chechelaky)
; Description ...: adaptação do jogo de mancala para AutoIt
; Link ..........: https://github.com/chechelaky/AutoIt/blob/master/mancala/mancala.au3
; webgrafia......: http://www.ludomania.com.br/Tradicionais/mancala.html
; ===============================================================================================================================

#include-once
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

OnAutoItExitRegister("OnExit")

Opt("GUIOnEventMode", 1)
Opt("GUIEventOptions", 1)
Opt("MustDeclareVars", 1)

Global $aGuiSize[2] = [1200, 400]
Global $sGuiTitle = "GuiTitle"
Global $hGui
Global $dummy
Global $hPlayerA, $hPlayerB

$hGui = GUICreate($sGuiTitle, $aGuiSize[0], $aGuiSize[1])
GUISetOnEvent($GUI_EVENT_CLOSE, "Quit")
$dummy = GUICtrlCreateButton("", 0, 0, 0, 0)
Botoes()

$hPlayerA = GUICtrlCreateLabel("A[ 24 ]", 10, 320, 80, 25)
$hPlayerB = GUICtrlCreateLabel("B[ 24 ]", 10, 340, 80, 25)

Global $QuemJogou = 0 ; 0(Escolher), 1(Cima), 2(Baixo)

GUISetState(@SW_SHOW, $hGui)

While Sleep(25)
WEnd

Func Botoes()
	Local $iIntervalo = 20, $half = $iIntervalo / 2
	Local $iLargura = Int(($aGuiSize[0] - $iIntervalo * 9) / 8)

	Global $CASAS[14], $PEDRAS[14] = [4, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 4, 0]
	For $ii = 0 To 13
		Switch $ii
			Case 0, 1, 2, 3, 4, 5
				$CASAS[$ii] = GUICtrlCreateButton($PEDRAS[$ii], $iIntervalo + ($iIntervalo + $iLargura) * ($ii + 1), $iIntervalo * 2 + $iLargura, $iLargura, $iLargura, Default, $WS_EX_TOPMOST)
			Case 6
				$CASAS[$ii] = GUICtrlCreateButton($PEDRAS[$ii], $iIntervalo * 8 + $iLargura * 7, $iIntervalo, $iLargura, $iLargura * 2 + $iIntervalo, $SS_SUNKEN)
			Case 13
				$CASAS[$ii] = GUICtrlCreateButton($PEDRAS[$ii], $iIntervalo, $iIntervalo, $iLargura, $iLargura * 2 + $iIntervalo, $SS_SUNKEN)
			Case 7, 8, 9, 10, 11, 12
				$CASAS[$ii] = GUICtrlCreateButton($PEDRAS[$ii], $iIntervalo + ($iIntervalo + $iLargura) * (13 - $ii), $iIntervalo, $iLargura, $iLargura)
		EndSwitch
		GUICtrlSetTip($CASAS[$ii], $CASAS[$ii], "$ii[" & $ii & "]")
		GUICtrlSetOnEvent($CASAS[$ii], "Evento")
		GUICtrlSetFont($CASAS[$ii], 40, 400, 0, "Courier New")
	Next
EndFunc   ;==>Botoes

Func QuemJogou($in)
	Switch $in
		Case $CASAS[0] To $CASAS[0] + 6
			Return 1
		Case $CASAS[0] + 7 To $CASAS[0] + 13
			Return 2
	EndSwitch
EndFunc   ;==>QuemJogou

Func _DePara($in)
	Switch $in
		Case 4 To 9, 11 To 16
			Return $CASAS[13] - $in + $CASAS[0]
		Case Else
			Return 0
	EndSwitch
EndFunc   ;==>_DePara

Func Evento()
	Local $JOGA_MAIS_UMA_VEZ = False

	; identifica quem está jogando
	$QuemJogou = QuemJogou(@GUI_CtrlId)
	; verifica quantas pedrás existem na casa
	; caso não haje nenhuma pedra ou seja uma KALA, interrompe
	Local $QuantasPedras = GUICtrlRead(@GUI_CtrlId)
	If Not Number($QuantasPedras) Or @GUI_CtrlId = 10 Or @GUI_CtrlId = 17 Then Return

	ConsoleWrite("QuantasPedras[ " & $QuantasPedras & " ]" & @LF)
	; zera as pedras da casa
	GUICtrlSetData(@GUI_CtrlId, 0)
	Local $try

	; calcula o loop, baseado na quantidade de sementes
	; e distribui uma semente para cada uma das próximas casas
	For $ii = 1 To $QuantasPedras
		$try = @GUI_CtrlId + $ii
		If $try - $CASAS[0] > 13 Then $try -= 14
		GUICtrlSetData($try, GUICtrlRead($try) + 1)
	Next
	; define a kala do jogador
	Local $kala = $QuemJogou = 2 ? 17 : 10
	; verifica se a última casa onde foi depositada a semente é uma kala
	; se for kala, joga mais uma vez
	If $try = $kala Then
		$JOGA_MAIS_UMA_VEZ = True
		GUICtrlSetState(@GUI_CtrlId, $GUI_DISABLE)
	EndIf

	ConsoleWrite("@[ " & @GUI_CtrlId & " ] $try[ " & $try & " ]  _DePara[ " & _DePara($try) & " ] $QuantasPedras[" & $QuantasPedras & "] $ii[" & $ii & "] $QuemJogou[" & $QuemJogou & "]" & @LF)
	; verifica se a ultima casa possui uma semente, e se na casa do adversário há sementes
	; caso afirmativo, pega as sementes do adversário e movimenta para a kala
	Local $DePara = _DePara($try)
	If Number(GUICtrlRead($try)) = 1 And Number(GUICtrlRead($DePara)) Then
		ConsoleWrite("KALA" & @LF)
		GUICtrlSetData($kala, GUICtrlRead($try) + GUICtrlRead($DePara) + GUICtrlRead($kala))
		GUICtrlSetData($try, 0)
		GUICtrlSetData($DePara, 0)
		GUICtrlSetState(@GUI_CtrlId, $GUI_DISABLE)
		GUICtrlSetState($try, $GUI_DISABLE)
		GUICtrlSetState($DePara, $GUI_DISABLE)

		$JOGA_MAIS_UMA_VEZ = True
	EndIf

	; desabilita as casas sem sentes e do jogador adversário
	; habilita as casas do jogador que possuem sementes
	If $JOGA_MAIS_UMA_VEZ Then

	Else
		Switch $QuemJogou
			Case 1
				For $ii = $CASAS[0] To $CASAS[0] + 5
					GUICtrlSetState($ii, $GUI_DISABLE)
				Next

				For $ii = $CASAS[0] + 7 To $CASAS[0] + 13
					If Number(GUICtrlRead($ii)) Then GUICtrlSetState($ii, $GUI_ENABLE)
				Next
			Case 2
				For $ii = $CASAS[0] To $CASAS[0] + 6
					If Number(GUICtrlRead($ii)) Then GUICtrlSetState($ii, $GUI_ENABLE)
				Next

				For $ii = $CASAS[0] + 7 To $CASAS[0] + 12
					GUICtrlSetState($ii, $GUI_DISABLE)
				Next
		EndSwitch
	EndIf
	GUICtrlSetState($dummy, $GUI_FOCUS)
	HouveGanhador()
EndFunc   ;==>Evento

Func HouveGanhador()
	Local $iPlayerA = 0
	Local $iPlayerB = 0
	For $ii = 4 To 10
		$iPlayerA += GUICtrlRead($ii)
		$iPlayerB += GUICtrlRead($ii + 7)
	Next
	GUICtrlSetData($hPlayerA, "A[ " & $iPlayerA & " ]")
	GUICtrlSetData($hPlayerB, "B[ " & $iPlayerB & " ]")
EndFunc   ;==>HouveGanhador

Func OnExit()
	GUISetState($hGui, @SW_HIDE)
	GUIDelete($hGui)
EndFunc   ;==>OnExit

Func Quit()
	Exit
EndFunc   ;==>Quit

; #FUNCTION# ====================================================================================================================
; Name ..........: MyRiverRaid
; Author ........: Luigi (Luismar Chechelaky)
; Description ...: um simples exemplo utilizando IrrLitch para renderizar um avião movendo-se por um mapa finito em loop infinito.
;                  O mapa foi construído com o Tiled Map Editor e o código traduz imagens 2d em seu equivalente em 3D.
; Link ..........: https://github.com/chechelaky/MyRiverRaid/
;
; Q muda a camera (3 ângulos)
; T sobe
; G desce
; setas (cima, baixo, esquerda, direita) movimento
; ===============================================================================================================================