/* ** Copyright (c) 2013-2023 Mahmoud Fayed ** Include Files */ #include "ring.h" void ring_vm_listfuncs_list ( void *pPointer ) { unsigned int nSize ; int x, y; Items *pItems ; Item *pItem ; List *pList ; VM *pVM ; nSize = 1 ; pVM = (VM *) pPointer ; if ( RING_API_PARACOUNT > 0 ) { for ( x = RING_API_PARACOUNT ; x > 0; x-- ) { if ( ! RING_API_ISNUMBER(x) ) { break ; } y = RING_API_GETNUMBER(x) ; if ( y <= 0 ) { break ; } nSize = nSize * y ; } if ( x == 0 ) { pList = RING_API_NEWLIST ; /* Allocate Memory */ pItems = (Items *)ring_calloc((nSize+1),sizeof(Items)); pList->pItemsBlock = pItems ; ring_vm_listfuncs_rec(pPointer,pList,pList,0); /* reset after recursion */ pList->pItemsBlock = pItems ; RING_API_RETNEWREF(pList); } else { RING_API_ERROR(RING_API_BADPARATYPE); } } else { RING_API_ERROR(RING_API_BADPARACOUNT); } }