亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tclmacosa.c

?? tcl是工具命令語言
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*  * tclMacOSA.c -- * *	This contains the initialization routines, and the implementation of *	the OSA and Component commands.  These commands allow you to connect *	with the AppleScript or any other OSA component to compile and execute *	scripts. * * Copyright (c) 1996 Lucent Technologies and Jim Ingham * Copyright (c) 1997 Sun Microsystems, Inc. * * See the file "License Terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tclMacOSA.c,v 1.10 2002/10/09 11:54:30 das Exp $ */#define MAC_TCL#include <Aliases.h>#include <string.h>#include <AppleEvents.h>#include <AppleScript.h>#include <OSA.h>#include <OSAGeneric.h>#include <Script.h>#include <FullPath.h>#include <components.h>#include <resources.h>#include <FSpCompat.h>/*  * The following two Includes are from the More Files package. */#include <MoreFiles.h>#include <FullPath.h>#include "tcl.h"#include "tclInt.h"/* * I need this only for the call to FspGetFullPath, * I'm really not poking my nose where it does not belong! */#include "tclMacInt.h"/* * Data structures used by the OSA code. */typedef struct tclOSAScript {    OSAID scriptID;    OSType languageID;    long modeFlags;} tclOSAScript;typedef struct tclOSAContext {	OSAID contextID;} tclOSAContext;typedef struct tclOSAComponent {	char *theName;	ComponentInstance theComponent; /* The OSA Component represented */	long componentFlags;	OSType languageID;	char *languageName;	Tcl_HashTable contextTable;    /* Hash Table linking the context names & ID's */	Tcl_HashTable scriptTable;	Tcl_Interp *theInterp;	OSAActiveUPP defActiveProc;	long defRefCon;} tclOSAComponent;/* * Prototypes for static procedures.  */static pascal OSErr	TclOSAActiveProc _ANSI_ARGS_((long refCon));static int		TclOSACompileCmd _ANSI_ARGS_((Tcl_Interp *interp,		 	    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static int 		tclOSADecompileCmd _ANSI_ARGS_((Tcl_Interp * Interp,			    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static int 		tclOSADeleteCmd _ANSI_ARGS_((Tcl_Interp *interp,			    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static int 		tclOSAExecuteCmd _ANSI_ARGS_((Tcl_Interp *interp,			    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static int 		tclOSAInfoCmd _ANSI_ARGS_((Tcl_Interp *interp,			    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static int 		tclOSALoadCmd _ANSI_ARGS_((Tcl_Interp *interp,			    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static int 		tclOSARunCmd _ANSI_ARGS_((Tcl_Interp *interp,			    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static int 		tclOSAStoreCmd _ANSI_ARGS_((Tcl_Interp *interp,			    tclOSAComponent *OSAComponent, int argc,			    CONST char **argv));static void		GetRawDataFromDescriptor _ANSI_ARGS_((AEDesc *theDesc,			    Ptr destPtr, Size destMaxSize, Size *actSize));static OSErr 		GetCStringFromDescriptor _ANSI_ARGS_((			    AEDesc *sourceDesc, char *resultStr,			    Size resultMaxSize,Size *resultSize));static int 		Tcl_OSAComponentCmd _ANSI_ARGS_((ClientData clientData,			    Tcl_Interp *interp, int argc, CONST char **argv)); static void 		getSortedHashKeys _ANSI_ARGS_((Tcl_HashTable *theTable,			    CONST char *pattern, Tcl_DString *theResult));static int 		ASCIICompareProc _ANSI_ARGS_((const void *first,			    const void *second));static int 		Tcl_OSACmd _ANSI_ARGS_((ClientData clientData,			    Tcl_Interp *interp, int argc, CONST char **argv)); static void 		tclOSAClose _ANSI_ARGS_((ClientData clientData));/*static void 		tclOSACloseAll _ANSI_ARGS_((ClientData clientData));*/static tclOSAComponent *tclOSAMakeNewComponent _ANSI_ARGS_((Tcl_Interp *interp,			    char *cmdName, char *languageName,			    OSType scriptSubtype, long componentFlags));  static int 		prepareScriptData _ANSI_ARGS_((int argc, CONST char **argv,			    Tcl_DString *scrptData ,AEDesc *scrptDesc)); static void 		tclOSAResultFromID _ANSI_ARGS_((Tcl_Interp *interp,			    ComponentInstance theComponent, OSAID resultID));static void 		tclOSAASError _ANSI_ARGS_((Tcl_Interp * interp,			    ComponentInstance theComponent, char *scriptSource));static int 		tclOSAGetContextID _ANSI_ARGS_((tclOSAComponent *theComponent, 			    CONST char *contextName, OSAID *theContext));static void 		tclOSAAddContext _ANSI_ARGS_((tclOSAComponent *theComponent, 			    char *contextName, const OSAID theContext));						static int 		tclOSAMakeContext _ANSI_ARGS_((tclOSAComponent *theComponent, 			    CONST char *contextName, OSAID *theContext));						static int 		tclOSADeleteContext _ANSI_ARGS_((tclOSAComponent *theComponent,			    CONST char *contextName)); static int 		tclOSALoad _ANSI_ARGS_((Tcl_Interp *interp, 			    tclOSAComponent *theComponent, CONST char *resourceName, 			    int resourceNumber, CONST char *fileName,OSAID *resultID));static int 		tclOSAStore _ANSI_ARGS_((Tcl_Interp *interp, 			    tclOSAComponent *theComponent, CONST char *resourceName, 			    int resourceNumber, CONST char *scriptName, CONST char *fileName));static int 		tclOSAAddScript _ANSI_ARGS_((tclOSAComponent *theComponent,			    char *scriptName, long modeFlags, OSAID scriptID)); 		static int 		tclOSAGetScriptID _ANSI_ARGS_((tclOSAComponent *theComponent,			    CONST char *scriptName, OSAID *scriptID)); static tclOSAScript *	tclOSAGetScript _ANSI_ARGS_((tclOSAComponent *theComponent,			    CONST char *scriptName)); static int 		tclOSADeleteScript _ANSI_ARGS_((tclOSAComponent *theComponent,			    CONST char *scriptName,char *errMsg));/* * "export" is a MetroWerks specific pragma.  It flags the linker that   * any symbols that are defined when this pragma is on will be exported  * to shared libraries that link with this library. */ #pragma export onint Tclapplescript_Init( Tcl_Interp *interp );#pragma export reset/* *---------------------------------------------------------------------- * * Tclapplescript_Init -- * *	Initializes the the OSA command which opens connections to *	OSA components, creates the AppleScript command, which opens an  *	instance of the AppleScript component,and constructs the table of *	available languages. * * Results: *	A standard Tcl result. * * Side Effects: *	Opens one connection to the AppleScript component, if  *	available.  Also builds up a table of available OSA languages, *	and creates the OSA command. * *---------------------------------------------------------------------- */int Tclapplescript_Init(    Tcl_Interp *interp)		/* Tcl interpreter. */{    char *errMsg = NULL;    OSErr myErr = noErr;    Boolean gotAppleScript = false;    Boolean GotOneOSALanguage = false;    ComponentDescription compDescr = {	kOSAComponentType,	(OSType) 0,	(OSType) 0,	(long) 0,	(long) 0    }, *foundComp;    Component curComponent = (Component) 0;    ComponentInstance curOpenComponent;    Tcl_HashTable *ComponentTable;    Tcl_HashTable *LanguagesTable;    Tcl_HashEntry *hashEntry;    int newPtr;    AEDesc componentName = { typeNull, NULL };    char nameStr[32];			    Size nameLen;    long appleScriptFlags;	    /*      * Perform the required stubs magic...     */     	    if (!Tcl_InitStubs(interp, "8.2", 0)) {	return TCL_ERROR;    }    /*      * Here We Will Get The Available Osa Languages, Since They Can Only Be      * Registered At Startup...  If You Dynamically Load Components, This     * Will Fail, But This Is Not A Common Thing To Do.     */	     LanguagesTable = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));	    if (LanguagesTable == NULL) {	panic("Memory Error Allocating Languages Hash Table");    }	    Tcl_SetAssocData(interp, "OSAScript_LangTable", NULL, LanguagesTable);    Tcl_InitHashTable(LanguagesTable, TCL_STRING_KEYS);				    while ((curComponent = FindNextComponent(curComponent, &compDescr)) != 0) {	int nbytes = sizeof(ComponentDescription);	foundComp = (ComponentDescription *)	    ckalloc(sizeof(ComponentDescription));	myErr = GetComponentInfo(curComponent, foundComp, NULL, NULL, NULL);	if (foundComp->componentSubType ==		kOSAGenericScriptingComponentSubtype) {	    /* Skip the generic component */	    ckfree((char *) foundComp);	} else {	    GotOneOSALanguage = true;	    /*	     * This is gross: looks like I have to open the component just  	     * to get its name!!! GetComponentInfo is supposed to return	     * the name, but AppleScript always returns an empty string.	     */		 		    curOpenComponent = OpenComponent(curComponent);	    if (curOpenComponent == NULL) {		Tcl_AppendResult(interp,"Error opening component",			(char *) NULL);		return TCL_ERROR;	    }			 	    myErr = OSAScriptingComponentName(curOpenComponent,&componentName);	    if (myErr == noErr) {		myErr = GetCStringFromDescriptor(&componentName,			nameStr, 31, &nameLen);		AEDisposeDesc(&componentName);	    }	    CloseComponent(curOpenComponent);	    if (myErr == noErr) {		hashEntry = Tcl_CreateHashEntry(LanguagesTable,			nameStr, &newPtr);		Tcl_SetHashValue(hashEntry, (ClientData) foundComp);	    } else {		Tcl_AppendResult(interp,"Error getting componentName.",			(char *) NULL);		return TCL_ERROR;	    }				    /*	     * Make sure AppleScript is loaded, otherwise we will	     * not bother to make the AppleScript command.	     */	    if (foundComp->componentSubType == kAppleScriptSubtype) {		appleScriptFlags = foundComp->componentFlags;		gotAppleScript = true;	    }				}    }				    /*     * Create the OSA command.     */	    if (!GotOneOSALanguage) {	Tcl_AppendResult(interp,"Could not find any OSA languages",		(char *) NULL);	return TCL_ERROR;    }	    /*     * Create the Component Assoc Data & put it in the interpreter.     */	    ComponentTable = (Tcl_HashTable *) ckalloc(sizeof(Tcl_HashTable));	    if (ComponentTable == NULL) {	panic("Memory Error Allocating Hash Table");    }	    Tcl_SetAssocData(interp, "OSAScript_CompTable", NULL, ComponentTable);			    Tcl_InitHashTable(ComponentTable, TCL_STRING_KEYS);    /*     * The OSA command is not currently supported.	     Tcl_CreateCommand(interp, "OSA", Tcl_OSACmd, (ClientData) NULL,	    (Tcl_CmdDeleteProc *) NULL);     */         /*      * Open up one AppleScript component, with a default context     * and tie it to the AppleScript command.     * If the user just wants single-threaded AppleScript execution     * this should be enough.     *     */	     if (gotAppleScript) {	if (tclOSAMakeNewComponent(interp, "AppleScript",		"AppleScript English", kAppleScriptSubtype,		appleScriptFlags) == NULL ) {	    return TCL_ERROR;	}    }    return Tcl_PkgProvide(interp, "OSAConnect", "1.0");}/* *----------------------------------------------------------------------  * * Tcl_OSACmd -- * *	This is the command that provides the interface to the OSA *	component manager.  The subcommands are: close: close a component,  *	info: get info on components open, and open: get a new connection *	with the Scripting Component * * Results: *  	A standard Tcl result. * * Side effects: *  	Depends on the subcommand, see the user documentation *	for more details. * *---------------------------------------------------------------------- */ int Tcl_OSACmd(    ClientData clientData,    Tcl_Interp *interp,    int argc,    CONST char **argv){    static unsigned short componentCmdIndex = 0;    char autoName[32];    char c;    int length;    Tcl_HashTable *ComponentTable = NULL;	    if (argc == 1) {	Tcl_AppendResult(interp, "Wrong # of arguments, should be \"",		argv[0], " option\"", (char *) NULL);	return TCL_ERROR;    }	    c = *argv[1];    length = strlen(argv[1]);	    /*     * Query out the Component Table, since most of these commands use it...     */	    ComponentTable = (Tcl_HashTable *) Tcl_GetAssocData(interp,	    "OSAScript_CompTable", (Tcl_InterpDeleteProc **) NULL);	    if (ComponentTable == NULL) {	Tcl_AppendResult(interp, "Error, could not get the Component Table",		" from the Associated data.", (char *) NULL);	return TCL_ERROR;    }	    if (c == 'c' && strncmp(argv[1],"close",length) == 0) {	Tcl_HashEntry *hashEntry;	if (argc != 3) {	    Tcl_AppendResult(interp, "Wrong # of arguments, should be \"",		    argv[0], " ",argv[1], " componentName\"",		    (char *) NULL);	    return TCL_ERROR;	}			if ((hashEntry = Tcl_FindHashEntry(ComponentTable,argv[2])) == NULL) {	    Tcl_AppendResult(interp, "Component \"", argv[2], "\" not found",		    (char *) NULL);	    return TCL_ERROR;	} else {	    Tcl_DeleteCommand(interp,argv[2]);	    return TCL_OK;	}    } else if (c == 'o' && strncmp(argv[1],"open",length) == 0) {	/*	 * Default language is AppleScript.	 */	OSType scriptSubtype = kAppleScriptSubtype;	char *languageName = "AppleScript English";	char *errMsg = NULL;	ComponentDescription *theCD;	argv += 2;	argc -= 2;		 	while (argc > 0 ) {	    if (*argv[0] == '-') {		c = *(argv[0] + 1);		if (c == 'l' && strcmp(argv[0] + 1, "language") == 0) {		    if (argc == 1) {			Tcl_AppendResult(interp,				"Error - no language provided for the -language switch",				(char *) NULL);			return TCL_ERROR;		    } else {			Tcl_HashEntry *hashEntry;			Tcl_HashSearch search;			Boolean gotIt = false;			Tcl_HashTable *LanguagesTable;									/*			 * Look up the language in the languages table			 * Do a simple strstr match, so AppleScript			 * will match "AppleScript English"...			 */									LanguagesTable = Tcl_GetAssocData(interp,				"OSAScript_LangTable",				(Tcl_InterpDeleteProc **) NULL);										for (hashEntry =				 Tcl_FirstHashEntry(LanguagesTable, &search);			     hashEntry != NULL;			     hashEntry = Tcl_NextHashEntry(&search)) {			    languageName = Tcl_GetHashKey(LanguagesTable,				    hashEntry);			    if (strstr(languageName,argv[1]) != NULL) {				theCD = (ComponentDescription *)				    Tcl_GetHashValue(hashEntry);				gotIt = true;				break;			    }			}			if (!gotIt) {			    Tcl_AppendResult(interp,				    "Error, could not find the language \"",				    argv[1],				    "\" in the list of known languages.",				    (char *) NULL);			    return TCL_ERROR;			}		    }		}		argc -= 2;		argv += 2;					    } else {		Tcl_AppendResult(interp, "Expected a flag, but got ",			argv[0], (char *) NULL);		return TCL_ERROR;	    }	}				sprintf(autoName, "OSAComponent%-d", componentCmdIndex++);	if (tclOSAMakeNewComponent(interp, autoName, languageName,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人免费观看| 国产福利视频一区二区三区| 蜜臀久久久99精品久久久久久| 国产真实乱子伦精品视频| 91久久精品午夜一区二区| 欧美mv日韩mv| 亚洲成人免费电影| 色综合天天综合狠狠| 久久精品日产第一区二区三区高清版| 亚洲一区二区成人在线观看| 不卡免费追剧大全电视剧网站| 欧美成人一区二区三区片免费| 一区二区三区美女| 暴力调教一区二区三区| 久久久久久久久一| 麻豆成人久久精品二区三区红| 在线视频国内一区二区| 国产欧美日韩卡一| 国产一区二区毛片| 精品福利二区三区| 免费成人你懂的| 欧美另类高清zo欧美| 亚洲一卡二卡三卡四卡无卡久久| 国产 日韩 欧美大片| 国产欧美一区二区精品婷婷| 久久爱www久久做| 日韩无一区二区| 麻豆91精品91久久久的内涵| 91精品国产综合久久精品性色| 亚洲国产一区二区三区| 欧美性一二三区| 亚洲成人av电影| 欧美精品丝袜中出| 免费高清在线一区| 26uuuu精品一区二区| 国产精品亚洲专一区二区三区| 亚洲精品在线电影| 国产 欧美在线| 亚洲视频在线观看三级| 色婷婷久久综合| 香蕉久久一区二区不卡无毒影院 | 中文字幕一区av| 成人免费毛片aaaaa**| 国产免费观看久久| 91碰在线视频| 日韩极品在线观看| 精品福利一区二区三区| 成人av第一页| 亚洲一区二区三区视频在线播放 | 国产美女精品一区二区三区| 欧美成人r级一区二区三区| 国产一区二区三区视频在线播放| 久久久电影一区二区三区| 91亚洲精华国产精华精华液| 一区二区欧美视频| 日韩欧美一级二级三级久久久| 九九**精品视频免费播放| 国产午夜亚洲精品理论片色戒| yourporn久久国产精品| 亚洲午夜电影网| 精品国一区二区三区| 99久久精品国产精品久久| 亚洲一级二级在线| 国产亚洲午夜高清国产拍精品 | 亚洲激情五月婷婷| 日韩欧美专区在线| av电影天堂一区二区在线观看| 亚洲成人av资源| 日本一区二区成人在线| 欧美色图在线观看| 国产 欧美在线| 日韩极品在线观看| 亚洲另类在线一区| 精品国产91亚洲一区二区三区婷婷| 91丨九色丨国产丨porny| 久久99国产精品久久| 亚洲图片一区二区| 欧美激情一区二区三区蜜桃视频| 欧美日韩亚州综合| a在线欧美一区| 久久99精品国产91久久来源| 亚洲精品日韩综合观看成人91| 欧美xxxxx牲另类人与| 在线免费亚洲电影| 成人性生交大合| 久久精品国产99| 亚洲国产另类av| 亚洲三级在线播放| 久久久久久日产精品| 91精品国产麻豆| 欧美三级日本三级少妇99| 不卡欧美aaaaa| 国产69精品久久99不卡| 经典一区二区三区| 青青草91视频| 午夜视频久久久久久| 亚洲综合色区另类av| 国产精品二区一区二区aⅴ污介绍| 精品99一区二区三区| 欧美一区二区免费视频| 国产精品网站一区| 久久影音资源网| 久久久久国产精品人| 欧美一区二区三区四区视频| 精品视频123区在线观看| 日本乱码高清不卡字幕| 色综合中文综合网| 国产乱码精品一区二区三| 麻豆成人综合网| 激情六月婷婷久久| 久久国产人妖系列| 免费观看在线综合| 久久se这里有精品| 激情欧美一区二区| 国产91精品一区二区麻豆亚洲| 国产成人av一区二区三区在线| 国产美女一区二区三区| 国产福利一区二区三区视频在线| 国产一区二区视频在线| 国产成人综合亚洲网站| 成人手机电影网| 99精品1区2区| 91国在线观看| 91精品综合久久久久久| 欧美xxxxx牲另类人与| 久久久精品日韩欧美| 中文在线一区二区| 中文字幕永久在线不卡| 亚洲综合一区二区| 日韩一区精品字幕| 国内外成人在线视频| 国产成人精品免费网站| 2017欧美狠狠色| 国产精品久久久久婷婷| 亚洲视频每日更新| 亚洲成人福利片| 国内成人自拍视频| 色综合色综合色综合 | 免费亚洲电影在线| 国产麻豆精品久久一二三| 北条麻妃国产九九精品视频| 欧美亚洲国产一区二区三区va| 7777精品伊人久久久大香线蕉 | 国产精品一区二区你懂的| 99久久夜色精品国产网站| 欧美日本在线播放| 久久蜜臀中文字幕| 亚洲自拍另类综合| 精品一区二区三区在线观看国产 | 国产精品一二三区在线| 欧美中文字幕一区二区三区| 欧美电视剧免费观看| 亚洲日本成人在线观看| 日韩电影免费一区| 91原创在线视频| 精品久久久久久久久久久久久久久久久 | 日本一区二区三区视频视频| 亚洲国产视频a| 成人短视频下载| 欧美一区二区三区四区五区| 国产二区国产一区在线观看| 日本精品裸体写真集在线观看| 欧美videossexotv100| 一级精品视频在线观看宜春院 | 日本在线不卡视频| aa级大片欧美| 欧美v日韩v国产v| 午夜精品一区二区三区电影天堂| 国产成人精品综合在线观看 | 国产精品1区二区.| 91精品国产高清一区二区三区蜜臀 | 91影视在线播放| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲国产精品精华液网站| 成人综合婷婷国产精品久久免费| 在线播放亚洲一区| 亚洲精品五月天| 国产91精品久久久久久久网曝门 | 91精品国产综合久久精品| 亚洲色欲色欲www| 高清av一区二区| 精品精品国产高清一毛片一天堂| 亚洲福中文字幕伊人影院| 国产视频911| 国产精品亚洲专一区二区三区 | 日韩欧美黄色影院| 偷偷要91色婷婷| 欧美日韩视频专区在线播放| 亚洲精品中文字幕在线观看| 成人性生交大片免费看视频在线| 久久久久九九视频| 国产一区二区三区免费在线观看| 日韩欧美中文一区| 男人的j进女人的j一区| 欧美视频精品在线| 午夜一区二区三区视频| 欧美丰满美乳xxx高潮www| 日本中文字幕一区二区视频| 91精品欧美久久久久久动漫| 日本欧美在线看|