Ejemplo n.º 1
0
void ring_vm_addnewcpointervar ( VM *pVM,const char *cStr,void *pPointer,const char *cStr2 )
{
	List *pList, *pList2  ;
	pList = ring_vm_newvar2(cStr,pVM->pActiveMem);
	ring_list_setint(pList,RING_VAR_TYPE,RING_VM_LIST);
	ring_list_setlist(pList,RING_VAR_VALUE);
	pList2 = ring_list_getlist(pList,RING_VAR_VALUE);
	/* Add Pointer */
	ring_list_addpointer(pList2,pPointer);
	/* Add Type */
	ring_list_addstring(pList2,cStr2);
	/* Add Status Number */
	ring_list_addint(pList2,RING_CPOINTERSTATUS_NOTCOPIED);
}
Ejemplo n.º 2
0
void ring_vm_newvar ( VM *pVM,const char *cStr )
{
	List *pList  ;
	assert(pVM->pActiveMem);
	pList = ring_vm_newvar2(cStr,pVM->pActiveMem);
	pVM->nSP++ ;
	RING_VM_STACK_SETPVALUE(pList);
	RING_VM_STACK_OBJTYPE = RING_OBJTYPE_VARIABLE ;
	/* Set the scope of the new variable */
	if ( (ring_list_getsize(pVM->pMem) == 1) && (pVM->pActiveMem == ring_list_getlist(pVM->pMem,RING_MEMORY_GLOBALSCOPE)) ) {
		pVM->nVarScope = RING_VARSCOPE_GLOBAL ;
	}
	else if ( pVM->pActiveMem == ring_list_getlist(pVM->pMem,ring_list_getsize(pVM->pMem)) ) {
		pVM->nVarScope = RING_VARSCOPE_LOCAL ;
	} else {
		pVM->nVarScope = RING_VARSCOPE_NOTHING ;
	}
	/* Add Scope to aLoadAddressScope */
	ring_list_addint(pVM->aLoadAddressScope,pVM->nVarScope);
}