Example #1
0
static boolean winregpullhkeyfromtext (Handle htext, HKEY *hkey) {

	/*
	7.0.2b1 Radio PBS: get the base key from the text string. Remove
	it from the text string.

	If a string is HKCU/foo/bar/, then htext becomes foo\bar\, and *hkey
	becomes HKEY_CLASSES_USER.
	*/

	short ixslash;
	bigstring bsbase;
	boolean fl = false;
	
	ixslash = textpatternmatch (*htext, gethandlesize (htext), BIGSTRING ("\x01\\"), true);

	if (ixslash == -1) /*didn't find?*/
		return (false);

	pullfromhandle (htext, 0, ixslash, stringbaseaddress (bsbase));

	pullfromhandle (htext, 0, 1, nil); /*remove leading /*/

	setstringlength (bsbase, ixslash);

	allupper (bsbase); /*case insensitive*/

	if ((equalstrings (bsbase, STR_P_HKCU_SHORT)) || (equalstrings (bsbase, STR_P_HKCU_LONG))) {
		*hkey = HKEY_CURRENT_USER;
		fl = true;
		}

	if ((equalstrings (bsbase, STR_P_HKLM_SHORT)) || (equalstrings (bsbase, STR_P_HKLM_LONG))) {
		*hkey = HKEY_LOCAL_MACHINE;
		fl = true;
		}

	if ((equalstrings (bsbase, STR_P_HKCR_SHORT)) || (equalstrings (bsbase, STR_P_HKCR_LONG))) {
		*hkey = HKEY_CLASSES_ROOT;
		fl = true;
		}

	if ((equalstrings (bsbase, STR_P_HKU_SHORT)) || (equalstrings (bsbase, STR_P_HKU_LONG))) {
		*hkey = HKEY_USERS;
		fl = true;
		}

	if ((equalstrings (bsbase, STR_P_HKCC_SHORT)) || (equalstrings (bsbase, STR_P_HCC_LONG))) {
		*hkey = HKEY_CURRENT_CONFIG;
		fl = true;
		}
	
	return (fl);
	} /*winregpullhkeyfromtext*/
Example #2
0
int main(void)
{
	bool equalstrings(const char str1[], const char str2[]);
	const char s1[] = "Comparing String ";
	const char s2[] = "String";
	
	printf ("Comparing of string 1 and string 2 %i",equalstrings(s1,s2));
	printf ("\nComparing of string 1 and string 2 %i",equalstrings(s2,"String"));
	
	return 0;
}
Example #3
0
	boolean customicongetrnum (bigstring bstype, short *rnum) {
		
		/*
		7.0b9 PBS: get the rnum of a file containing custom icon.
		*/
		
		short i = 0;
		
		alllower (bstype);
		
		while (i < ixnexticon) {
			
			if (equalstrings (bstype, icontypes [i].bstype)) {
			
				*rnum = icontypes [i].rnum;
				
				return (true);
				} /*if*/
			
			i++;
			
			if (i == maxcustomicontypes)
			
				break;		
			} /*while*/
		
		return (false);	
		} /*customicongetresid*/
Example #4
0
void appsetmessage (hdlappwindow appwindow, bigstring bs) {
	
	hdlappwindow ha = appwindow;
	
	if (ha == nil)
		return;
		
	if (app.hasmessagearea) {
		
		Handle htext;
		
		/*8/29/94 DW: don't do anything if the message hasn't changed*/ {
			
			bigstring bscurrentmessage;
			
			texthandletostring ((**ha).hmessage, bscurrentmessage);
			
			if (equalstrings (bscurrentmessage, bs)) /*nothing to do*/
				return;
			}
	
		disposehandle ((**ha).hmessage);
		
		if (stringlength (bs) == 0)
			htext = nil;
		else
			newtexthandle (bs, &htext);
	
		(**ha).hmessage = htext;
	
		appdrawmessage (ha);
		}
	} /*appsetmessage*/
Example #5
0
int main(int argc, char *argv[]) {
	
	char * string1, *string2;
	string1 = malloc ( 100);
	string2 = malloc ( 100);
	printf("enter the string 1\n");
	gets(string1);
	printf("enter the second string\n");
	gets(string2);
	equalstrings(string1,string2);
	
}
Example #6
0
boolean winregwrite (Handle h, tyvaluerecord *val, bigstring bstype) {

	/*
	7.0.2b1 Radio PBS: write a value to the registry.
	*/
	
	DWORD regtype;
	HKEY hbasekey = HKEY_CURRENT_USER;
	bigstring subkey, bsitem;
	tyvaluerecord vcopy;
	boolean fl = false;

	if (equalstrings (bstype, emptystring)) /*no type specified*/
	
		winregfrontiertypetotype ((*val).valuetype, &regtype);

	else
		
		winregtypestringtotype (bstype, &regtype);

	if (!winregpullhkeyfromtext (h, &hbasekey))
		return (false);

	if (!winregiskey (h)) {

		texthandletostring (h, subkey);

		if (!pullstringsuffix (subkey, bsitem, '\\'))
			return (false);

		disposehandle (h);
		
		newtexthandle (subkey, &h); 
		} /*if*/

	initvalue (&vcopy, novaluetype);

	if (!copyvaluerecord (*val, &vcopy))
		return (false);

	winregcoercevalue (&vcopy, regtype);

	fl = winregdowrite (hbasekey, h, bsitem, &vcopy, regtype);

	disposevaluerecord (vcopy, false);

	return (fl);
	} /*winregwrite*/
Example #7
0
static boolean findheadlinevisit (hdlheadrecord hnode, ptrvoid refcon) {
	
	ptrfindinfo findinfo = (ptrfindinfo) refcon;
	bigstring bs;
	
	opgetheadstring (hnode, bs);
	
	if (equalstrings ((*findinfo).pfind, bs)) {
		
		(*findinfo).hfound = hnode;
		
		return (false);
		}
	
	return (true); /*keep visiting*/
	} /*findheadlinevisit*/
Example #8
0
static boolean equalsublists (hdllistrecord list1, hdllistrecord list2, long ixcompare, long ctcompare, boolean flbykey) {
	
	/*
	compare the sublist of list1 starting at ixcompare with list2.  if flbykey, 
	order doesn't matter and ixcompare is ignored.  ctcompare is expected to be 
	the size of list2
	
	5.0a24 dmb: with oplanglists, we can use EQvalue. which can recurse to here.
	*/
	
	register long ix;
	register long n = ctcompare;
	tyvaluerecord item1;
	tyvaluerecord item2;
	tyvaluerecord vequal;
	bigstring key1;
	bigstring key2;
	boolean fl = true;
	
	for (ix = 1; ix <= n; ++ix) {
		
		if (!getnthlistval (list2, ix, key1, &item2))
			return (false);
		
		if (flbykey) {
			
			fl = getnthlistval (list1, -1, key1, &item1);
			}
		else {
			if (!getnthlistval (list1, ix + ixcompare, key2, &item1))
				fl = false;
			else
				fl = equalstrings (key1, key2);
			}
		
		disablelangerror ();
		
		fl = fl && EQvalue (item1, item2, &vequal) && vequal.data.flvalue;
		
		enablelangerror ();
		
		if (!fl)
			break;
		}
	
	return (fl);
	} /*equalsublists*/
Example #9
0
static boolean claygetfolder (const tybrowserspec * fsfolder, tybrowserdir *dirid, boolean flinmemory) {
	
	tyvaluerecord val;
	hdlhashnode hnode;
	
	if ((*fsfolder).parID == nil) {
		
		assert (equalstrings ((*fsfolder).name, nameroottable));
		
		*dirid = roottable;
		
		goto tagandexit;
		}
	
	if (isemptystring ((*fsfolder).name)) {
		
		*dirid = (*fsfolder).parID;
		
		goto tagandexit;
		}
	
	if (!claylookupvalue (fsfolder, &val, &hnode))
		return (false);
	
	if (flinmemory) {
		
		hdlexternalvariable hv = (hdlexternalvariable) val.data.externalvalue;
		
		if (!(**hv).flinmemory)
			return (false);
		}
	
	if (!tablevaltotable (val, dirid, hnode))
		return (false);
	
tagandexit:
	
//	(***dirid).flmayaffectdisplay = true; // let tablesymbol calls know we may care
	
	return (true);
	} /*claygetfolder*/
Example #10
0
boolean opfindhead (hdlheadrecord hfirst, bigstring bs, hdlheadrecord *hnode) {
	
	/*
	search starting with hfirst and step through its siblings looking
	for a headline that exactly matches bs.
	*/
	
	register hdlheadrecord nomad, nextnomad;
	bigstring bsnomad;
	bigstring bslook;
	
	*hnode = nil; /*default returned value*/
	
	nomad = hfirst;
	
	copystring (bs, bslook); /*work on a copy*/
	
	alllower (bslook); /*unicase*/
	
	while (true) {
		
		opgetheadstring (nomad, bsnomad);
		
		alllower (bsnomad);
		
		if (equalstrings (bslook, bsnomad)) {
			
			*hnode = nomad;
			
			return (true);
			}
		
		nextnomad = (**nomad).headlinkdown;
		
		if (nextnomad == nomad)
			return (false);
			
		nomad = nextnomad;
		} /*while*/
	} /*opfindhead*/
Example #11
0
static boolean tablefunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
	
	/*
	bridges table.c with the language.  the name of the verb is bs, its first parameter
	is hparam1, and we return a value in vreturned.
	
	we use a limited number of support routines from lang.c to get parameters and
	to return values. 
	
	return false only if the error is serious enough to halt the running of the script
	that called us, otherwise error values are returned through the valuerecord, which
	is available to the script.
	
	if we return false, we try to provide a descriptive error message in the 
	returned string bserror.
	
	11/14/91 dmb: getcursorfunc returns address, not full path
	
	10/3/92 dmb: commented out setcolwidthfunc. (this verb still isn't "offical")
	
	4/2/93 dmb: added jettisonfunc
	
	6/1/93 dmb: when vreturned is nil, return whether or not verb token must 
	be run in the Frontier process
	
	5.1.5b11 dmb: fixed gotofunc silent failure
	*/
	
	register tyvaluerecord *v = vreturned;
	register boolean fl = false;
	WindowPtr targetwindow;
	
	if (v == nil) { /*need Frontier process?*/
		
		switch (token) {
			
			case sortbyfunc:
			case getcursorfunc:
			case getselectionfunc:
			case gotofunc:
			case gotonamefunc:
			case gofunc:
			case getdisplaysettings:
			case setdisplaysettings:
				return (true);
			
			default:
				return (false);
			}
		}
	
	setbooleanvalue (false, v); /*by default, table functions return false*/
	
	switch (token) { /*these verbs don't require an open table window*/
		
		/*
		case findfunc:
			if (!tablefindverb (hparam1, v))
				goto error;
			
			return (true);
		*/
		
		case validatefunc:
			return (tablevalidateverb (hparam1, v));
		
		case movefunc:
			return (tablemoveverb (hparam1, v));
		
		case copyfunc:
			return (tablecopyverb (hparam1, v));
		
		case renamefunc:
			return (tablerenameverb (hparam1, v));
		
		case moveandrenamefunc:
			return (tablemoveandrenameverb (hparam1, v));
		
		/*
		case lockfunc:
		case islockedfunc:
		*/
		
		case assignfunc:
			return (tableassignverb (hparam1, v));
			
		#ifdef MACVERSION
		case packtablefunc:
			return (tablepacktableverb (hparam1, v));
		#endif

		case emptytablefunc:
			return (tableemptytableverb (hparam1, v));
		
		case jettisonfunc: { /*toss an object w/out forcing it into memory. for database recovery.*/
			hdlhashtable htable;
			bigstring bs;
			
			if (!getvarparam (hparam1, 1, &htable, bs)) /*name of table*/
				return (false);
			
			pushhashtable (htable);
			
			(*v).data.flvalue = hashdelete (bs, true, false);
			
			pophashtable ();
			
			return (true);
			}
		} /*switch*/
	
	/*all other verbs require a table window in front*/
	
	if (!langfindtargetwindow (idtableprocessor, &targetwindow)) {
		
		getstringlist (tableerrorlist, notableerror, bserror);
		
		return (false);
		}
	
	shellpushglobals (targetwindow); /*following verbs assume that an table is pushed*/
	
	(*shellglobals.gettargetdataroutine) (idtableprocessor); /*set table globals*/
	
	switch (token) {
		
		/*
		case setcolwidthfunc: {
			short colnum, colwidth;
			
			if (!getintvalue (hparam1, 1, &colnum))
				break;
			
			flnextparamislast = true;
			
			if (!getintvalue (hparam1, 2, &colwidth))
				break;
			
			(*v).data.flvalue = (*(**tableformatsdata).adjustcolwidthroutine) (colnum - 1, colwidth);
			
			tablesmashdisplay ();
			
			fl = true;
			
			break;
			}
		*/
		
		case sortbyfunc: {
			bigstring bssort, bstitle;
			short ixcol;
			
			flnextparamislast = true;
			
			if (!getstringvalue (hparam1, 1, bssort))
				break;
			
			alllower (bssort);
			
			for (ixcol = namecolumn; ixcol <= kindcolumn; ++ixcol) {
				
				tablegettitlestring (ixcol, bstitle);
				
				alllower (bstitle);
				
				if (equalstrings (bssort, bstitle)) {
					
					hdlhashtable ht;
					bigstring bs;
					
					tablegetcursorinfo (&ht, bs, nil, nil);
	
					(*v).data.flvalue = tablesetsortorder (ht, ixcol);
					
					break;
					}
				}
			
			fl = true;
			
			break;
			}
		
		/*
		case centertablefunc: {
			boolean flcenter;
			
			flnextparamislast = true;
			
			if (!getbooleanvalue (hparam1, 1, &flcenter))
				break;
				
			(*v).data.flvalue = tablesetcenter (flcenter);
			
			fl = true;
			
			break;
			}
		*/
			
		case getcursorfunc: {
			hdlhashtable htable;
			bigstring bs;
			tyvaluerecord val;
			hdlhashnode hhashnode;
			
			if (!langcheckparamcount (hparam1, 0)) /*too many parameters were passed*/
				break;
			
			/*
			tablegetcursorpath (bspath);
			
			fl = setstringvalue (bspath, v);
			*/
			
			if (!tablegetcursorinfo (&htable, bs, &val, &hhashnode))
				fl = setstringvalue (zerostring, v);
			else
				fl = setaddressvalue (htable, bs, v);
			
			break;
			}
		
		case getselectionfunc:
			fl = tablegetselectionverb (hparam1, v);
			
			break;
		
		case gotofunc: {
			short row;
			hdlheadrecord hsummit;
			
			flnextparamislast = true;
			
			if (!getintvalue (hparam1, 1, &row))
				break;
			
			if (opnthsummit (row, &hsummit)) {
				
				opclearallmarks ();
				
				opmoveto (hsummit);
				
				(*v).data.flvalue = true;
				}
			
			fl = true;
			
			break;
			}
		
		case gotonamefunc: {
			hdlhashtable ht;
			bigstring bs;
			
			if (!tablegetcursorinfo (&ht, bs, nil, nil))
				ht = nil;
			
			flnextparamislast = true;
			
			if (!getstringvalue (hparam1, 1, bs))
				break;
			
			(*v).data.flvalue = tablemovetoname (ht, bs);
			
			fl = true;
			
			break;
			}
		
		case gofunc: {
			tydirection dir;
			short count;
			
			if (!getdirectionvalue (hparam1, 1, &dir))
				break;
			
			flnextparamislast = true;
			
			if (!getintvalue (hparam1, 2, &count))
				break;
			
			opsettextmode (false);
			
			if (dir == down)
				dir = flatdown;
			
			if (dir == up)
				dir = flatup;
			
			(*v).data.flvalue = opmotionkey (dir, count, false);
			
			fl = true;
			
			break;
			}
		
		case getdisplaysettings:
			fl = tablegetdisplaysettingsverb (hparam1, v);
			
			break;
		
		case setdisplaysettings:
			fl = tablesetdisplaysettingsverb (hparam1, v);
			
			break;

		case sortorderfunc: {
			hdlhashtable ht;
			bigstring bs;
			short ixcol;

			tablegetcursorinfo (&ht, bs, nil, nil);

			tablegetsortorder (ht, &ixcol);

			tablegettitlestring (ixcol, bs);

			fl = setstringvalue (bs, v);

			break;
			}
		} /*switch*/
	
	shellupdatescrollbars (shellwindowinfo);
	
	shellpopglobals ();
	
	return (fl);
	} /*tablefunctionvalue*/
Example #12
0
void xcmdcallback (void) {
	
	/*
	5/4/92 dmb: HyperCard 1.0 XCMD callback emulation
	
	7/8/92 dmb: set return code; use xresNotImp for unknown request
	
	9/25/92 dmb: added SendHCEvent callback support. also spotted & fixed 
	a bug in ExtToStr handler.
	
	10/3/92 dmb: it turns out that the protocol requires that the caller 
	of the xcmd put the xcmdptr into a global for us; the xcmd code 
	doesn't pass it to us consistently.
	
	11/6/92 dmb: use new truncatecstringhandle instead of just popping last char.
	also, fixed NumToHex, NumToStr
	*/
	
	register XCmdPtr pxcb;
	register long *args;
	register long *out;
	tyvaluerecord val;
	bigstring bs;
	hdlhashtable htable;
	hdlhashnode hnode;
	
	pxcb = plangxcmdrec; /*copy global into register*/
	
	args = (*pxcb).inArgs;
	out = (long *) &(*pxcb).outArgs;
	
	(*pxcb).result = xresSucc;
	
	switch ((*pxcb).request) {
		
		/*  HyperTalk Utilities  */
		case 0x02: /*Handle EvalExpr (StringPtr expr)*/
			
			if (!langrunstringnoerror ((ptrstring) args [0], bs))
				(*pxcb).result = xresFail;
			
			else {
				
				pushchar (chnul, bs);
				
				newtexthandle (bs, (Handle *) out);
				}
			
			break;
		
		case 0x01: /*void SendCardMessage (StringPtr msg)*/
		case 0x05: /*void SendHCMessage (StringPtr msg)*/
			
			if (!langrunstringnoerror ((ptrstring) args [0], bs))
				(*pxcb).result = xresFail;
			
			break;
		
		/*
		case 0x26: /*void RunHandler (Handle handler)%/
			
			break;
		*/
		
		
		/*  Memory Utilities  */
		case 0x12: /*Handle GetGlobal (StringPtr globName)*/
			
			resolvexcmdglobal ((ptrstring) args [0], &htable, bs);
			
			if (hashtablelookup (htable, bs, &val, &hnode)
				&& copyvaluerecord (val, &val)
				&& coercetostring (&val)
				&& enlargehandle (val.data.stringvalue, 1, zerostring)) {
				
				exemptfromtmpstack (&val);
				
				*out = (long) val.data.stringvalue;
				}
			else
				*out = 0L;
			
			break;
		
		case 0x13: /*void SetGlobal (StringPtr globName, Handle globValue)*/
			
			resolvexcmdglobal ((ptrstring) args [0], &htable, bs);
			
			initvalue (&val, stringvaluetype);
			
			if (!copyhandle ((Handle) args [1], &val.data.stringvalue))
				(*pxcb).result = xresFail;
			
			else {
				
				truncatecstringhandle (val.data.stringvalue); /*strip zero terminator*/
				
				if (!hashtableassign (htable, bs, val))
					disposevaluerecord (val, false);
				}
			
			break;
		
		case 0x06: /*void ZeroBytes (Ptr dstPtr, long longCount)*/
			clearbytes ((byte *) args [0], args [1]);
			
			break;
		
		
		/*  String Utilities  */
		case 0x1c: /*void ScanToReturn (Ptr *scanPtr)*/
			
			scantext (chreturn, (ptrbyte *) args [0]);
			
			/*** test: ++*(ptrbyte *) args [0]; /*point past return*/
			
			break;
		
		case 0x27: /*void ScanToZero (Ptr *scanPtr)*/
			
			scantext (chnul, (ptrbyte *) args [0]);
			
			break;
		
		case 0x1a: /*Boolean StringEqual (StringPtr str1, StringPtr str2)*/
			*out = (long) equalstrings ((ptrstring) args [0], (ptrstring) args [1]);
			
			break;
		
		case 0x03: { /*long StringLength (Ptr strPtr)*/
			
			*out = scanlength (chnul, (ptrbyte) args [0]);
			
			break;
			}
		
		case 0x04: { /*Ptr StringMatch (StringPtr pattern, Ptr target)*/
			
			tysearchparameters saveparams = searchparams;
			long ix = 0;
			long len;
			
			searchparams.flunicase = false;
			searchparams.flwholewords = false;
			searchparams.flregexp = false;
			copystring ((ptrstring) args [0], searchparams.bsfind);
			
			textsearch ((ptrbyte) args [1], infinity, &ix, &len);
			
			*out = (long) ((ptrbyte) args [1] + ix);
			
			searchparams = saveparams;
			
			break;
			}
		
		case 0x20: /*void ZeroTermHandle (Handle hndl)*/
			
			enlargehandle ((Handle) args [0], 1, zerostring);
			
			break;
		
		
		/*  String Conversions  */
		case 0x10: /*void BoolToStr (Boolean bool, StringPtr str)*/
			setbooleanvalue ((Boolean) args [0], &val);
			
			valtostring (&val, (ptrstring) args [1]);
			
			break;
		
		case 0x11: { /*void ExtToStr (extended num, StringPtr str)*/
			
			#if __powerc
			
				long double x;
				
				safex80told ((extended80 *) args [0], &x);
				
				setdoublevalue (x, &val);
			#else
			
				setdoublevalue (* (long double *) args [0], &val);
			
			#endif
			
			valtostring (&val, (ptrstring) args [1]);
				
			break;
			}
		
		case 0x0d: /*void LongToStr (long posNum, StringPtr str)*/
			setlongvalue ((unsigned long) args [0], &val); /*11/6/92 dmb*/
			
			valtostring (&val, (ptrstring) args [1]);
			
			break;
		
		case 0x0f: { /*void NumToHex (long num, short nDigits, StringPtr str)*/
			
			long n = args [0];
			byte hex [16];
			
			if (args [1] <= 4)
				n = (short) n;
			
			numbertohexstring (n, hex); /*11/6/92 dmb*/
			
			deletestring (hex, 1, 2); /*remove the "0x"*/
			
			copystring (hex, (ptrstring) args [2]);
			
			break;
			}
		
		case 0x0e: /*void NumToStr (long num, StringPtr str)*/
			setlongvalue ((long) args [0], &val); /*11/6/92 dmb*/
			
			valtostring (&val, (ptrstring) args [1]);
			
			break;
		
		case 0x07: /*Handle PasToZero (StringPtr str)*/
			copystring ((ptrstring) args [0], bs);
			
			pushchar (chnul, bs);
			
			newtexthandle (bs, (Handle *) out);
			
			break;
		
		case 0x2b: /*void PointToStr (Point pt, StringPtr str)*/
			setpointvalue (*(Point *) args [0], &val);
			
			valtostring (&val, (ptrstring) args [1]);
			
			break;
		
		case 0x2c: /*void RectToStr (Rect *rct, StringPtr str)*/
			newheapvalue ((Rect *) args [0], longsizeof (Rect), rectvaluetype, &val);
			
			valtostring (&val, (ptrstring) args [1]);
			
			break;
		
		case 0x1b: /*void ReturnToPas (Ptr zeroStr, StringPtr pasStr)*/
			texttostring ((ptrbyte) args [0], scanlength (chreturn, (ptrbyte) args [0]), (ptrstring) args [1]);
			
			break;
		
		case 0x0b: /*Boolean StrToBool (StringPtr str)*/
			stringtoval ((ptrstring) args [0], booleanvaluetype, &val);
			
			*out = (long) val.data.flvalue;
			
			break;
		
		case 0x0c: { /*extended StrToExt (StringPtr str)*/
			#if __powerc
			
				long double x;
				
				stringtoval ((ptrstring) args [0], doublevaluetype, &val);
				
				x = **val.data.doublevalue;
				
				safeldtox80 (&x, (extended80 *) args [1]);
				
			#else
				
				stringtoval ((ptrstring) args [0], doublevaluetype, &val);
				
				*(double *) args [1] = **val.data.doublevalue;
				
			#endif
			
			break;
			}
		
		case 0x09: /*long StrToLong (StringPtr str)*/
			stringtoval ((ptrstring) args [0], longvaluetype, &val);
			
			*out = abs (val.data.longvalue);
			
			break;
		
		case 0x0a: /*long StrToNum (StringPtr str)*/
			stringtoval ((ptrstring) args [0], longvaluetype, &val);
			
			*out = (long) val.data.longvalue;
			
			break;
		
		case 0x2d: /*void StrToPoint (StringPtr str, Point *pt)*/
			stringtoval ((ptrstring) args [0], pointvaluetype, &val);
			
			*(Point *) args [1] = val.data.pointvalue;
			
			break;
		
		case 0x2e: /*void StrToRect (StringPtr str, Rect *rct)*/
			stringtoval ((ptrstring) args [0], rectvaluetype, &val);
			
			*(Rect *) args [1] = **val.data.rectvalue;
			
			break;
		
		case 0x08: /*void ZeroToPas (Ptr zeroStr, StringPtr pasStr)*/
			texttostring ((ptrbyte) args [0], scanlength (chnul, (ptrbyte) args [0]), (ptrstring) args [1]);
			
			break;
		
		#if 0
		
		/*  Field Utilities  */
		case 0x16: /*Handle GetFieldByID (Boolean cardFieldFlag, short fieldID)*/
			newfilledhandle (zerostring, 1L, (Handle *) out);
			
			break;
		
		case 0x14: /*Handle GetFieldByName (Boolean cardFieldFlag, StringPtr fieldName)*/
			newfilledhandle (zerostring, 1L, (Handle *) out);
			
			break;
		
		case 0x15: /*Handle GetFieldByNum (Boolean cardFieldFlag, short fieldNum)*/
			newfilledhandle (zerostring, 1L, (Handle *) out);
			
			break;
		
		case 0x19: /*void SetFieldByID (Boolean cardFieldFlag, short fieldID, Handle fieldVal)*/
			break;
		
		case 0x17: /*void SetFieldByName (Boolean cardFieldFlag, StringPtr fieldName, Handle fieldVal)*/
			break;
		
		case 0x18: /*void SetFieldByNum (Boolean cardFieldFlag, short fieldNum, Handle fieldVal)*/
			break;
		
		case 0x2f: /*TEHandle GetFieldTE (Boolean cardFieldFlag, short fieldID, short fieldNum, StringPtr fieldNamePtr)*/
			*out = 0;
			
			break;
															
		case 0x30: /*void SetFieldTE (Boolean cardFieldFlag, short fieldID, short fieldNum, StringPtr fieldNamePtr, TEHandle fieldTE)*/
			break;
		
		#endif
		
		case 0x22: /*void SendHCEvent(EventRecord *event)*/
			
			/****component***/
			
			shellpostevent ((EventRecord *) &args [0]); /*yes, the event itself is in args*/
			
			shellforcebackgroundtask (); /*come back as soon as possible*/
			
			if (!processyield ()) /*we've been killed*/
				(*pxcb).result = xresFail;
			
			break;
		
		default:
			*out = 0L;
			
			(*pxcb).result = xresNotImp;
			
			break;
		}
	
	plangxcmdrec = pxcb; /*reset in case another xcmd ran in the background*/
	} /*xcmdcallback*/
Example #13
0
static boolean winregtypestringtotype (bigstring bstype, DWORD *regtype) {

	/*
	7.0.2b1 Radio PBS: Given a string identifying a type, return the numerical type.
	*/

	bigstring uppertype;
	boolean fl = false;

	copystring (bstype, uppertype);

	allupper (uppertype); /*case insensitive*/

	if (equalstrings (bstype, STR_P_REG_BINARY)) {

		*regtype = REG_BINARY;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_DWORD)) {

		*regtype = REG_DWORD;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_DWORD_BIG_ENDIAN)) {

		*regtype = REG_DWORD_BIG_ENDIAN;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_EXPAND_SZ)) {

		*regtype = REG_EXPAND_SZ;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_LINK)) {

		*regtype = REG_LINK;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_MULTI_SZ)) {

		*regtype = REG_MULTI_SZ;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_NONE)) {

		*regtype = REG_NONE;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_RESOURCE_LIST)) {

		*regtype = REG_RESOURCE_LIST;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_SZ)) {

		*regtype = REG_SZ;

		fl = true;
		} /*if*/

	if (equalstrings (bstype, STR_P_REG_BINARY)) {

		*regtype = REG_BINARY;

		fl = true;
		} /*if*/

	return (fl);
	} /*winregtypestringtotype*/