Пример #1
0
// compte les points sur le polygone convexe  //the points on the convex polygon
int DocRecord::CountPointsOnHull()
{
	PointNumero p, p2, temp;
	int i, n=numPoints;

	if(points[0].adjacent == NULL)
		return 0;
	i = 1;
	p = 0;
	p2 = First(0);
	while((p2 != 0) && (i < n)) {
		i++;
		temp = p2;
		p2 = Successor(p2, p);
		p = temp;
	}
	return (i <= n) ? i : -1;
}
Пример #2
0
Track *TrackListIterator::StartWith(Track * val)
{
   if (val == NULL) {
      return First();
   }

   if (l == NULL) {
      return NULL;
   }

   cur = (TrackListNode *) val->GetNode();

   if (cur) {
      return cur->t;
   }

   return NULL;
}
Пример #3
0
/* Create a list of parameters from the type t, using the file_line_node Node for 
 * file and line numbering for the parameters */
ParmList *SwigType_function_parms(const SwigType *t, Node *file_line_node) {
  List *l = SwigType_parmlist(t);
  Hash *p, *pp = 0, *firstp = 0;
  Iterator o;

  for (o = First(l); o.item; o = Next(o)) {
    p = file_line_node ? NewParm(o.item, 0, file_line_node) : NewParmWithoutFileLineInfo(o.item, 0);
    if (!firstp)
      firstp = p;
    if (pp) {
      set_nextSibling(pp, p);
      Delete(p);
    }
    pp = p;
  }
  Delete(l);
  return firstp;
}
Пример #4
0
void cChannels::DeleteDuplicateChannels(void)
{
  cList<cChannelSorter> ChannelSorter;
  for (cChannel *channel = First(); channel; channel = Next(channel)) {
      if (!channel->GroupSep())
         ChannelSorter.Add(new cChannelSorter(channel));
      }
  ChannelSorter.Sort();
  cChannelSorter *cs = ChannelSorter.First();
  while (cs) {
        cChannelSorter *next = ChannelSorter.Next(cs);
        if (next && cs->channelID == next->channelID) {
           dsyslog("deleting duplicate channel %s", *next->channel->ToText());
           Del(next->channel);
           }
        cs = next;
        }
}
Пример #5
0
OP_STATUS DataStream_SequenceBase::ReadRecordSequenceFromStreamL(DataStream *src, DataStream *last_element)
{
	OP_STATUS op_err;

	DS_Debug_Printf1("DataStream_SequenceBase::ReadStructureRecordsFromStreamL: Step %u Starting to process structure\n", step);

	if(current_item == NULL)
	{
		step = 0;
		ReadActionL(step++, DataStream_SequenceBase::STRUCTURE_START);
		current_item = First();
	}
	
	while(current_item)
	{
		if(current_item->GetEnabledRecord())
		{
			op_err = current_item->ReadRecordFromStreamL(GetInputSource(src));
			if(op_err == OpRecStatus::OK || op_err == OpRecStatus::WAIT_FOR_DATA)
				return op_err;
			else if(op_err != OpRecStatus::FINISHED)
			{
					DS_LEAVE(OpRecStatus::IsError(op_err) ? op_err : OpRecStatus::RECORD_TOO_SHORT);
			}
			DS_Debug_Printf1("DataStream_SequenceBase::ReadStructureRecordsFromStreamL:  Step %u read item\n", step);
		}
		else
		{
			DS_Debug_Printf1("DataStream_SequenceBase::ReadStructureRecordsFromStreamL:  Step %u bypassed disabled entry\n", step);
		}

		ReadActionL(step++, current_item->GetItemID());

		BOOL is_last_element = (current_item == last_element ? TRUE : FALSE);

		current_item = current_item->Suc();

		if(current_item && is_last_element)
			return OpRecStatus::FINISHED;
	}
	ReadActionL(step, DataStream_SequenceBase::STRUCTURE_FINISHED);

	return OpRecStatus::FINISHED;
}
Пример #6
0
SwigType *SwigType_default_create(const SwigType *ty) {
  SwigType *r = 0;
  List *l;
  Iterator it;
  int numitems;

  if (!SwigType_isvarargs(ty)) {
    SwigType *t = SwigType_typedef_resolve_all(ty);
    r = NewStringEmpty();
    l = SwigType_split(t);
    numitems = Len(l);

    if (numitems >= 1) {
      String *last_subtype = Getitem(l, numitems-1);
      if (SwigType_isenum(last_subtype))
	Setitem(l, numitems-1, NewString("enum SWIGTYPE"));
      else
	Setitem(l, numitems-1, NewString("SWIGTYPE"));
    }

    for (it = First(l); it.item; it = Next(it)) {
      String *subtype = it.item;
      if (SwigType_isarray(subtype)) {
	if (Equal(subtype, "a()."))
	  Append(r, NewString("a()."));
	else
	  Append(r, NewString("a(ANY)."));
      } else if (SwigType_isfunction(subtype)) {
	Append(r, NewString("f(ANY).SWIGTYPE"));
	break;
      } else if (SwigType_ismemberpointer(subtype)) {
	Append(r, NewString("m(CLASS).SWIGTYPE"));
	break;
      } else {
	Append(r, subtype);
      }
    }

    Delete(l);
    Delete(t);
  }

  return r;
}
Пример #7
0
void OpenSeq(TSequencer * s, char * n)
{
        midiFILE *      f;
        int             i;
        
 // initialisation
 
 	s->ref = MidiOpen("msMidiPlayer");
        s->state = idle;
        s->seq = MidiNewSeq();
        s->playtask = 0;
	s->looptask = 0;
		
        
 // read the midi file
        
        f = MidiFileOpen(n, MidiFileRead);
		
        if (!f) {
                printf ("Error opening MidiFile %s (%d)\n", n, MidiFile_errno);
                CloseSeq(s);
                exit(MidiFile_errno);
        }
        for (i = f->ntrks; i; i--){ MixSeq( MidiFileReadTrack(f), s->seq); }
	           
        if (smpte(f)) 
                TrsfSmpteSeq(s->seq, frame_par_sec(f), ticks_par_frame(f));
        else
                TrsfTempoSeq(s->seq, ticks_par_quarterNote(f));
	
	if (First(s->seq))
	 	printf("File : %s, Format : %d, Tracks : %d, Length : %d, Duration : %d\n",
                        n, f->format, f->ntrks, LenSeq(s->seq), Date(Last(s->seq)) );
	           
        (void) MidiFileClose(f);
       
 // installation
    	
        MidiSetInfo(s->ref, s);
        MidiSetRcvAlarm(s->ref, NullRcv);
        
        MidiConnect(s->ref, 0, 1);
        MidiConnect(0, s->ref, 1);
}
Пример #8
0
void scStream::STRCopy( scStream*& dst ) const
{
	scContUnit* srcPara = First();
	scContUnit* dstPara;

	try {
		dst 	= 0;
		dstPara = 0;
		for ( ; srcPara; srcPara = srcPara->GetNext( ) ) {
			dstPara = srcPara->Copy( dstPara );
			if ( dst == NULL )
				dst = dstPara->GetStream();
		}
	} catch( ... ) {
		if ( dst )
			dst->STRFree(), dst = 0;
		throw;
	} 
}
Пример #9
0
void TestFindRecursively() {
	// make list 1
	List l1 = NULL;
	l1 = MakeArrayStackEmpty(l1);
	Position curl1 = l1;
	for (int i = 0; i < 30000; ++i) {
		curl1 = Insert(i * 3, l1, curl1);
	}
	time_t stime, etime;
	stime = clock();
	Position re = FindRecursively(87300, First(l1));
	etime = clock();

	printf("recursively %d, runtime: %d\n", re->Element, etime - stime);
	stime = clock();
	Position re1 = Find(87300, l1);
	etime = clock();
	printf("normally %d, runtime: %d\n", re1->Element, etime - stime);
}
Пример #10
0
	virtual int GetNextIFrame(int Index, bool Forward, uint16_t *FileNumber = NULL, off_t *FileOffset = NULL, int *Length = NULL) {
		cMutexLock lock(&idx_lock);
		std::vector<tLiveIndex>::iterator item = GetIndex(Index);
		if(item == idx.end()) {
			if(Index < First() && Forward)
				item = idx.begin();
			else
				return -1;
		}
		if(Forward) {
			do {
				item++;
				if(item == idx.end()) return -1;
			} while(!item->independent);
		} else {
			do {
				if(item == idx.begin()) return -1;
				item--;
			} while(!item->independent);
		} // if
		uint16_t fn;
		if (!FileNumber)
			FileNumber = &fn;
		off_t fo;
		if (!FileOffset)
			FileOffset = &fo;
		*FileNumber = item->number;
		*FileOffset = item->offset;
		item++;
		if(item == idx.end()) return -1;
		if (Length) {
			// all recordings end with a non-independent frame, so the following should be safe:
			uint16_t fn = item->number;
			off_t fo = item->offset;
			if (fn == *FileNumber) {
				*Length = int(fo - *FileOffset);
			} else {
				esyslog("ERROR: 'I' frame at end of file #%d", *FileNumber);
				*Length = -1;
			} // if
		} // if
		return Index;
	}; // GetNextIFrame
Пример #11
0
// rename a file from oldArkFilename to newArkFilename
// you can cahnge the full filepath not just the filename using this
// 
// args:	new ark filename
//			old ark filename
// returns:	true if renamed successfully
bool ArkHdrPair::RenameFile(const char* newArkFilename, const char* oldArkFilename)
{
	// get old file entry
	// no need to search using First and Next as if the filename exists
	// it will be found first go and returned first go
	FileEntrySetIter iter;
	const FileEntry* p_entry = First(iter, oldArkFilename);
	if(p_entry == NULL)
		return false;
	
	// create new file entry
	FileEntry new_entry(newArkFilename, p_entry->Filename(),
		p_entry->Filesize(), p_entry->Offset(), p_entry->Encrypted());
	
	// replace file entry
	mFileCollection.Remove(iter);
	mHasChanged = true;
	return mFileCollection.Insert(new_entry);
}
Пример #12
0
void cRecsDone::RemoveSearchID(int ID)
{
    if (ID == -1)
	return;
    cMutexLock RecsDoneLock(this);
    if (Count() == 0)
	Load(AddDirectory(CONFIGDIR, "epgsearchdone.data"));
    cRecDone* recDone = First();
    while (recDone)
    {
	if (recDone->searchID == ID)
	{
	    recDone->searchID = -1;
	    LogFile.Log(2,"search timer %d removed in recording %s~%s", ID, recDone->title?recDone->title:"unknown title", recDone->shortText?recDone->shortText:"unknown subtitle");
	}
	recDone = Next(recDone);
    }
    Save();
}
Пример #13
0
nsTreeRows::iterator
nsTreeRows::FindByResource(nsIRDFResource* aResource)
{
    // XXX Mmm, scan through the rows one-by-one...
    iterator last = Last();
    iterator iter;

    nsresult rv;
    nsAutoString resourceid;
    bool stringmode = false;

    for (iter = First(); iter != last; ++iter) {
        if (!stringmode) {
            nsCOMPtr<nsIRDFResource> findres;
            rv = iter->mMatch->mResult->GetResource(getter_AddRefs(findres));
            if (NS_FAILED(rv)) return last;

            if (findres == aResource)
                break;

            if (! findres) {
                const char *uri;
                aResource->GetValueConst(&uri);
                CopyUTF8toUTF16(uri, resourceid);

                // set stringmode and fall through
                stringmode = true;
            }
        }

        // additional check because previous block could change stringmode
        if (stringmode) {
            nsAutoString findid;
            rv = iter->mMatch->mResult->GetId(findid);
            if (NS_FAILED(rv)) return last;

            if (resourceid.Equals(findid))
                break;
        }
    }

    return iter;
}
Пример #14
0
void botmeld(){
	sortcard(&Hand(player_who_play),1);
	addressCard T = First(Hand(player_who_play));
	addressCard X = NULL;
	while(T != NULL){
		int t = trees(Hand(player_who_play),Card(T));
		int i = 1;	
		if(t>2){
			while(i <= t){
				X = T;
				T = Next(T);
				doMeld(Card(X));
				i++;
			}
		}else{
			T = Next(T);
		}
	}
}
Пример #15
0
//
//#############################################################################
// GetNthImplementation
//#############################################################################
//
void*
	PlugIterator::GetNthImplementation(
		CollectionSize index
	)
{
	Check_Object(this);
	CollectionSize i = 0;
	void *item;

	First();
	while ((item = GetCurrentImplementation()) != NULL)
	{
		if (i == index)
			return item;
      Next();
		i++;
	}
	return NULL;
}
Пример #16
0
void InsertLast (List *L,address P) {
/* I.S. Sembarang, P sudah dialokasi */
/* F.S. P ditambahkan sebagai elemen terakhir yang baru, */
/*yaitu menjadi elemen sebelum dummy */
	//Kamus Lokal
	address Pt;
	//Algoritma
	if (IsListEmpty(*L)) 
		InsertFirst(L,P);
	else {
		Pt = First(*L);
		Prev(Pt) = P;
		Next(P) = Pt;
		Pt = Last(*L);
		Next(Pt) = P;
		Prev(P) = Pt;
		Last(*L) = P;
	}
}
Пример #17
0
void Swig_print_node(Node *obj) {
  Iterator ki;
  Node *cobj;

  print_indent(0);
  Printf(stdout, "+++ %s ----------------------------------------\n", nodeType(obj));
  ki = First(obj);
  while (ki.key) {
    String *k = ki.key;
    if ((Cmp(k, "nodeType") == 0) || (Cmp(k, "firstChild") == 0) || (Cmp(k, "lastChild") == 0) ||
	(Cmp(k, "parentNode") == 0) || (Cmp(k, "nextSibling") == 0) || (Cmp(k, "previousSibling") == 0) || (*(Char(k)) == '$')) {
      /* Do nothing */
    } else if (Cmp(k, "parms") == 0) {
      print_indent(2);
      Printf(stdout, "%-12s - %s\n", k, ParmList_protostr(Getattr(obj, k)));
    } else {
      DOH *o;
      char *trunc = "";
      print_indent(2);
      if (DohIsString(Getattr(obj, k))) {
	o = Str(Getattr(obj, k));
	if (Len(o) > 80) {
	  trunc = "...";
	}
	Printf(stdout, "%-12s - \"%(escape)-0.80s%s\"\n", k, o, trunc);
	Delete(o);
      } else {
	Printf(stdout, "%-12s - 0x%x\n", k, Getattr(obj, k));
      }
    }
    ki = Next(ki);
  }
  cobj = firstChild(obj);
  if (cobj) {
    indent_level += 6;
    Printf(stdout, "\n");
    Swig_print_tree(cobj);
    indent_level -= 6;
  } else {
    print_indent(1);
    Printf(stdout, "\n");
  }
}
Пример #18
0
TLFObject* TLFList::Pop(TLFObject* object)
{
	if (m_headNode == NULL)
		return NULL;
	if (First() == object)
	{
		// удаляем первый элемент. 
		TLFListNode* node = m_headNode->NextNode();
		delete m_headNode;
		m_headNode = node;
		if (node != NULL)
			return node->GetElement();
		else
			return NULL;
	}
	else if (Last() == object)
	{
		PopBack();
		return NULL;
	}
	else
	{
		TLFListNode* node  = m_headNode;
		TLFListNode* node1 = m_headNode->NextNode();
		if (node1 == NULL)
			return NULL;
		while (node1->NextNode() != NULL)
		{
			if (node1->GetElement() == object)
			{
				node->SetNextNode(node1->NextNode());
				delete node1;
				if (node->NextNode() != NULL)
					return node->NextNode()->GetElement();
				else
					return NULL;
			}
			node = node1;
			node1 = node1->NextNode();
		}
	}
	return NULL;
}
Пример #19
0
HRESULT CNktDvModulesEnumerator::FindExportedFunctionByName(__deref_out CNktDvExportedFunction **lplpFunc,
                                                            __in_z LPCWSTR szDllFuncW)
{
  TNktComPtr<CNktDvModule> cMod;
  CNktDvTools::FUNCTION_PARSE_INFO sFuncParseInfo;
  LPWSTR sW;
  HRESULT hRes;

  if (lplpFunc == NULL)
    return E_POINTER;
  *lplpFunc = NULL;
  hRes = CNktDvTools::ParseFunctionName(sFuncParseInfo, szDllFuncW);
  if (FAILED(hRes))
    return hRes;
  if (sFuncParseInfo.nDllNameLen == 0)
    return E_INVALIDARG;
  //find module
  hRes = First(&cMod);
  while (SUCCEEDED(hRes))
  {
    sW = cMod->GetFileName();
    if (_wcsnicmp(sW, szDllFuncW, sFuncParseInfo.nDllNameLen) == 0 &&
        sW[sFuncParseInfo.nDllNameLen] == 0)
      break;
    cMod.Release();
    hRes = Next(&cMod);
  }
  if (FAILED(hRes))
  {
    if (hRes == E_FAIL)
      hRes = NKT_DVERR_NotFound;
    return hRes;
  }
  //find export
  if (sFuncParseInfo.nApiOrdinal != NKT_SIZE_T_MAX)
    hRes = cMod->FindExportedFunctionByOrdinal(lplpFunc, sFuncParseInfo.nApiOrdinal);
  else
    hRes = cMod->FindExportedFunctionByName(lplpFunc, szDllFuncW+sFuncParseInfo.nApiNameStart,
                                            sFuncParseInfo.nApiNameLen);
  //done
  return hRes;
}
Пример #20
0
HlExprList *HlExprList::simp_tan()
{
    switch (First()->typeOfHead())
    {
    case NUMBER:
        if (eval_functions)
        {
            changed = true;
            double v = evalF();
            delete this;
            return N(v);
        }
        break;

    default:
        break;
    }

    return this;
}
Пример #21
0
void deleteFirst(List &L, address &P)
{
     if(First(L)==NULL) {
        cout<<"DATA TIDAK DITEMUKAN";
    }
    else if (First(L)!=Last(L)) {
    P = First(L);
    First(L) = Next(P);
    Next(P) = NULL;
    Prev(P) = NULL;
        Prev(First(L))=Last(L);
        Next(Last(L))=First(L);
    }
    else{

            P=First(L);
            Next(P)=NULL;
            Prev(P)=NULL;
            First(L)=NULL;
            Last(L)=NULL; 
    }
}
Пример #22
0
void CTLinkedList<T>::Add_First(T Element)
{
    if(List == 0)
    {
        List = new St_Element<T>;
        List->Object = new T;
        List->Next = 0;
        List->Prev = 0;
        *List->Object = Element;
    }
    else
    {
        First();
        List->Prev = new St_Element<T>;
        List->Prev->Next = List;
        List->Prev->Prev = 0;
        *List->Prev->Object = Element;
        List = List->Prev;
    }
}
Пример #23
0
void CpAlokList (List Lin, List *Lout) {
    /* Kamus Lokal */
    address P, Pt;
    boolean gagal;

    /* Algoritma */
    CreateList(Lout);
    gagal = false;
    P = First(Lin);
    while ((P != Nil)&&(!gagal)) {
      Pt = Alokasi(Info(P));
      if (Pt != Nil) {
        InsertLast(Lout,Pt);
        P = Next(P);
      } else {
        gagal = true;
        DelAll(Lout);
      }
    }
}
Пример #24
0
/*--------------------------------------------------------------------------*/
void PegStatusBar::SetTextField(WORD wId, PEGCHAR *Text)
{
    PegPrompt *pPrompt;
    PegThing *pTest = First();

    while(pTest)
    {
        if (pTest->Type() == TYPE_PROMPT && pTest->Id() == wId)
        {
            BeginDraw();
            pPrompt = (PegPrompt *) pTest;
            pPrompt->DataSet(Text);
            pPrompt->Draw();
            CheckDrawDragMap(pPrompt);
            EndDraw();
            return;
        }
        pTest = pTest->Next();
    }
}
Пример #25
0
String *Swig_new_subdirectory(String *basedirectory, String *subdirectory) {
  String *error = 0;
  struct stat st;
  int current_directory = basedirectory ? (Len(basedirectory) == 0 ? 1 : 0) : 0;

  if (current_directory || is_directory(basedirectory)) {
    Iterator it;
    String *dir = basedirectory ? NewString(basedirectory) : NewString("");
    List *subdirs = Split(subdirectory, SWIG_FILE_DELIMITER[0], INT_MAX);

    for (it = First(subdirs); it.item; it = Next(it)) {
      int statdir;
      String *subdirectory = it.item;
      Printf(dir, "%s", subdirectory);
      statdir = stat(Char(dir), &st);
      if (statdir == 0) {
	Printf(dir, SWIG_FILE_DELIMITER);
	if (S_ISDIR(st.st_mode)) {
	  continue;
	} else {
	  error = NewStringf("Cannot create directory %s", dir);
	  break;
	}
      } else {
#ifdef _WIN32
	int result = _mkdir(Char(dir));
#else
	int result = mkdir(Char(dir), 0777);
#endif
	Printf(dir, SWIG_FILE_DELIMITER);
	if (result != 0 && errno != EEXIST) {
	  error = NewStringf("Cannot create directory %s", dir);
	  break;
	}
      }
    }
  } else {
    error = NewStringf("Cannot create subdirectory %s under the base directory %s. Either the base does not exist as a directory or it is not readable.", subdirectory, basedirectory);
  }
  return error;
}
Пример #26
0
void Application::run()
{
	if (!MMEnu)
	{
		cout << "Pas de menu accocher à l'application en cours! " << endl;
		return;
	}

	this->Again = true;


	do
	{
		this->MMEnu->display(cout);

		switch (this->MMEnu->askChoice(cout))
		{

		case eCREATE:		Create();	break;
		case eREAD:			Read();		break;
		case eUPDATE:		Update();	break;
		case eDELETE:		Delete();	break;
		case eDELETEALL:	DeleteAll(); break;
		case eLIST:			List();		break;
		case eFIRST:		First();	break;
		case eNEXT:			Next();		break;
		case eLAST:			Last();		break;
		case ePREVIOUS:		Previous();	break;
		case eSORT:			Sort();		break;
		case eSEARCH:		Shearch();	break;
		case eERROR:		Error();	break;
		case eQUIT:			Quit();		break;
		default:			Bydefault(); break;

		}


	} while (this->Again);


}
Пример #27
0
infoCard whichcardoff(){
	addressCard O = First(Hand(player_who_play));
	addressCard R = O;
	int tree = trees(Hand(player_who_play),Card(O));
	int poin = point(Card(O));
	while(O != NULL){
		int t = trees(Hand(player_who_play),Card(O));
		int p = point(Card(O));
		if(t<tree){
			R = O;
			tree = t;
			poin = p;
		}else
		if(t==tree && p>poin){
			R = O;
			poin = p;	
		}
		O = Next(O);
	}
	return Card(R);
}
Пример #28
0
void Picture::drawClipped (
    Canvas* c, Coord l, Coord b, Coord r, Coord t, Graphic* gs
) {
    BoxObj box, clipBox(l, b, r, t);
    
    getBox(box, gs);

    if (clipBox.Intersects(box)) {
        Iterator i;
        FullGraphic gstemp;
        Transformer ttemp;
	gstemp.SetTransformer(&ttemp);

        for (First(i); !Done(i); Next(i)) {
	    Graphic* gr = GetGraphic(i);
	    concatGraphic(gr, gr, gs, &gstemp);
	    drawClippedGraphic(gr, c, l, b, r, t, &gstemp);
	}
	gstemp.SetTransformer(nil); /* to avoid deleting ttemp explicitly */
    }
}
void SInsVLast(Statistik *L, InfoStatistik X)
/* { I.S. L mungkin kosong } */
/* { F.S. X ditambahkan sebagai elemen terakhir L } */
/* { Proses : Melakukan alokasi sebuah elemen dan menambahkan elemen list di akhir :
elemen terakhir yang baru bernilai X jika alokasi berhasil.
Jika alokasi gagal: I.S.= F.S. } */
{
    /* Kamus Lokal */
    saddress P, Psec;
    /* Algoritma */
    if (SIsListEmpty(*L))
        SInsVFirst(L, X);
    else
    {
        Psec = SAlokasi(X);
        P = First(*L);
        while (Next(P) != Nil)
            P = Next(P);
        Next(P) = Psec;
    }
}
Пример #30
0
/****************** PROSES SEMUA ELEMEN LIST ******************/
void PrintInfo(List L)
/* I.S. List mungkin kosong */
/* F.S. Jika list tidak kosong, isi list dicetak ke kanan: [e1,e2,...,en] */
/* Contoh : jika ada tiga elemen bernilai 1, 20, 30 akan dicetak: [1,20,30] */
/* Jika list kosong : menulis [] */
/* Tidak ada tambahan karakter apa pun di awal, akhir, atau di tengah */
{
    printf("[");
    if (!IsEmptyList(L))
    {
        addressList P = First(L);
        printf("%d", Info(P));
        P = Next(P);
        while (P != NULL)
        {
            printf(",%d", Info(P));
            P = Next(P);
        }
    }
    printf("]");
}