int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { MSG msg; // Limit only one instance HANDLE hMutex = ::CreateMutex(NULL, FALSE, _T(MUTEX_SZ)); if (ERROR_ALREADY_EXISTS == ::GetLastError()) { if (hMutex) { CloseHandle(hMutex); hMutex = NULL; } return FALSE; } pIf = NULL; ProcessParameter(lpCmdLine); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow)) { if (pIf) { delete pIf; pIf = NULL; } return FALSE; } // Minimize physical memory once. ::SetProcessWorkingSetSize(::GetCurrentProcess(), -1, -1); // Main message loop: while (GetMessage(&msg, NULL, 0, 0)) { if (!IsDialogMessage(msg.hwnd,&msg) ) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam; }
api_bool InternalParameterEnumerator::ParameterCallback( meta_parameter_handle hParam, void* data ) { reinterpret_cast<Process::parameter_list*>( data )->Add( ProcessParameter( hParam ) ); return api_true; }
ProcessParameter ProcessParameter::ParentTable() const { return ProcessParameter( (*API->Process->GetParameterTable)( m_data->handle ) ); }
Term ProcImPrt(Term t, Term ind) { int spin, col, anti; Atom n, an; Term prt; Atom pcomm=0, ptname=0; if(!is_compound(t) || CompoundArity(t)<3 || CompoundArity(t)>5 || !is_integer(CompoundArg1(t)) || !is_integer(CompoundArg2(t)) || !is_integer(CompoundArgN(t,3)) || (CompoundArity(t)>3 && !is_atom(CompoundArgN(t,4))) || (CompoundArity(t)>4 && !is_atom(CompoundArgN(t,5))) ) { ErrorInfo(502); printf("AuxPrt: bad arguments ");WriteTerm(t);puts(""); return 0; } spin=IntegerValue(CompoundArg1(t)); col= IntegerValue(CompoundArg2(t)); anti=IntegerValue(CompoundArgN(t,3)); if(CompoundArity(t)>3) pcomm=CompoundArgN(t,4); if(CompoundArity(t)>4) ptname=CompoundArgN(t,5); FreeAtomic(t); n=NewName(); if(anti) an=NewName(); else an=n; if(1) { prt=MakeCompound(OPR_PARTICLE,8); SetCompoundArg(prt,1,n); SetCompoundArg(prt,2,an); SetCompoundArg(prt,3,pcomm?pcomm:NewAtom("im particle",0)); SetCompoundArg(prt,4,NewInteger(spin?2:0)); SetCompoundArg(prt,5,spin==2?0:NewAtom("Maux",0)); if(spin<2) SetCompoundArg(prt,7,OPR_MLT); else SetCompoundArg(prt,7,A_GAUGE); if(col>1) { Term cl; if(col==8) cl=MakeCompound2(A_COLOR,NewAtom("c8",0),NewAtom("c8",0)); else cl=MakeCompound2(A_COLOR,NewAtom("c3",0),NewAtom("c3b",0)); SetCompoundArg(prt,8,AppendFirst(NewList(),cl)); } AddIMParticle(prt); if(ptname) { char bbb[64]; SetAtomProperty(n,A_TEXNAME,ptname); sprintf(bbb,"{\\bar{%s}}",AtomValue(ptname)); SetAtomProperty(an,A_TEXNAME,NewAtom(bbb,0)); } } if(spin<2) { if(!intr_param) { Term t1,t2,t3; t1=NewCompound(NewFunctor(OPR_PARAMETER,1)); t2=NewCompound(NewFunctor(OPR_EQSIGN,2)); t3=NewCompound(NewFunctor(OPR_COLON,2)); SetCompoundArg(t1,1,t2); SetCompoundArg(t2,1,NewAtom("Maux",0)); SetCompoundArg(t2,2,t3); SetCompoundArg(t3,1,NewInteger(1)); SetCompoundArg(t3,2,NewAtom("mass of aux particles",0)); ProcessParameter(t1,0); intr_param=1; } return n; } sprintf(nnbuf,"%s.t",AtomValue(n)); n=NewAtom(nnbuf,0); return n; }
List mk_im_field(int col, int spin, int ch, List hint) { Atom n, an, spp; int checked_hint=0; Term prt; n=0; check_hint(col, spin, ch, hint, &n, &an); if(n) checked_hint=1; if(n==0) { n=NewName(); if(ch) an=NewName(); else an=n; } sprintf(nnbuf,"%s%s%s%s",AtomValue(CompoundArg1(ListFirst(hint))), AtomValue(CompoundArg1(ListNth(hint,2))), AtomValue(CompoundArg1(ListNth(hint,3))), AtomValue(CompoundArg1(ListNth(hint,4)))); spp=NewAtom(nnbuf,0); used_fields=AppendLast(used_fields, MakeCompound2(OPR_MINUS, spp, MakeCompound2(OPR_DIV, n, an))); if(verb_imprt) { printf("Intermediate field %s/%s for vertex ",AtomValue(n), AtomValue(an)); WriteVertex(hint); printf(".\n"); } if(!checked_hint || spin<2) { char bbb[64]; prt=MakeCompound(OPR_PARTICLE,8); SetCompoundArg(prt,1,n); SetCompoundArg(prt,2,an); sprintf(bbb,"%s",AtomValue(spp)); SetCompoundArg(prt,3,NewAtom(bbb,0)); SetCompoundArg(prt,4,NewInteger(spin?2:0)); SetCompoundArg(prt,5,spin==2?0:NewAtom("Maux",0)); if(spin<2) SetCompoundArg(prt,7,OPR_MLT); else SetCompoundArg(prt,7,A_GAUGE); if(col) { Term cl; if(col==3) cl=MakeCompound2(A_COLOR,NewAtom("c8",0),NewAtom("c8",0)); else cl=MakeCompound2(A_COLOR,NewAtom("c3",0),NewAtom("c3b",0)); SetCompoundArg(prt,8,AppendFirst(NewList(),cl)); } AddIMParticle(prt); } if(spin<2) { if(!intr_param) { Term t1,t2,t3; t1=NewCompound(NewFunctor(OPR_PARAMETER,1)); t2=NewCompound(NewFunctor(OPR_EQSIGN,2)); t3=NewCompound(NewFunctor(OPR_COLON,2)); SetCompoundArg(t1,1,t2); SetCompoundArg(t2,1,NewAtom("Maux",0)); SetCompoundArg(t2,2,t3); SetCompoundArg(t3,1,NewInteger(1)); SetCompoundArg(t3,2,NewAtom("mass of im particles",0)); ProcessParameter(t1,0); intr_param=1; } return MakeList2(an,n); } sprintf(nnbuf,"%s.t",AtomValue(n)); n=NewAtom(nnbuf,0); sprintf(nnbuf,"%s.t",AtomValue(an)); an=NewAtom(nnbuf,0); return MakeList2(an,n); }