Esempio n. 1
0
void TiXmlDeclaration::StreamOut( TIXML_OSTREAM * stream ) const
{
	(*stream) << "<?xml ";

	if ( !version.empty() )
	{
		(*stream) << "version=\"";
		PutString( version, stream );
		(*stream) << "\" ";
	}
	if ( !encoding.empty() )
	{
		(*stream) << "encoding=\"";
		PutString( encoding, stream );
		(*stream ) << "\" ";
	}
	if ( !standalone.empty() )
	{
		(*stream) << "standalone=\"";
		PutString( standalone, stream );
		(*stream) << "\" ";
	}
	(*stream) << "?>";
}
Esempio n. 2
0
void VT102DispStr (INT8U x, INT8U y, char *s, INT8U fgcolor, INT8U bgcolor)
{
    INT8U err;

    OSSemPend(DispStrSem, 0, &err);                     /* Acquire semaphore to display string              */
    VT102Attribute(fgcolor, bgcolor);
    PutChar(0x1B);
    PutChar('[');
    PutDec(y);
    PutChar(';');
    PutDec(x);
    PutChar('H');
    PutString(s);
    OSSemPost(DispStrSem);                              /* Release semaphore                                */
}
Esempio n. 3
0
void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const
{
	TIXML_STRING n, v;

	PutString( name, &n );
	PutString( value, &v );

	if (value.find ('\"') == TIXML_STRING::npos) {
		if ( cfile ) {
		fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() );
		}
		if ( str ) {
			(*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\"";
		}
	}
	else {
		if ( cfile ) {
		fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() );
		}
		if ( str ) {
			(*str) += n; (*str) += "='"; (*str) += v; (*str) += "'";
		}
	}
}
Esempio n. 4
0
void BeginProgram(void)
{
	int i;

	ORG = 0;
	FloatNum = TempNum = 0;
	for (i = EAX; i <= EDI; ++i)
	{
		if (X86Regs[i] != NULL)
		{
			X86Regs[i]->link = NULL;
		}
	}

	PutString("# Code auto-generated by UCC\n\n");
}
Esempio n. 5
0
void afficher_zone(void *adresse, size_t taille, int free) {
    decompte_zone(adresse, taille, free);
    PutString("\n");
    PutString("zone ");
    if(free)
    	PutString(" libre ");
    else
    	PutString(" occupee ");
    PutString(" adresse : ");
    PutInt((unsigned int)adresse);
    PutString(" taille : ");
    PutInt(taille);
    PutString("\n");
}
Esempio n. 6
0
int main()
{
	OpenFileId id;
	char c;
	int n;
	if(Create("test", 128) == -1)
	{
		PutString("Erreur create\n");
		Exit(0);
	}
	id = Open("test");
	if(id == -1)
	{
		PutString("erreur open test\n");
		Exit(0);
	}
	if(Write("coucou\n", 7, id) != 7)
	{
		PutString("erreur write\n");
		Exit(0);
	}
	if(Close(id) == -1)
	{
		PutString("erreur close test\n");
		Exit(0);
	}

	id = Open("files/small");
	if(id == -1)
	{
		PutString("erreur open small\n");
		Exit(0);
	}
	while((n = Read(&c, sizeof(char), id)))
	{
		PutChar(c);
	}
	if(n == -1)
	{
		PutString("erreur read\n");
		Exit(0);
	}
	if(Close(id) == -1)
	{
		PutString("erreur close small\n");
		Exit(0);
	}
    return 0;
}
Esempio n. 7
0
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test threadParallele3 : \n");
	PutString("Lance un thread qui lance un autre thread etc. (cree 3 threads).\n");
	PutString("Tous les threads doivent se terminer avant que le processus s'arrete.\n");
	PutString("-----------------------------------------\n");
	UserThreadCreate(f, 0);
	PutString("Thread main fini\n");
    return 0;
}
Esempio n. 8
0
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test threadMulJoin : \n");
	PutString("Test le Join multiple sur le meme thread.\n");
	PutString("Doit afficher \"Erreur join ...\".\n");
	PutString("-----------------------------------------\n");
	int tidf, tidg;
	tidg = UserThreadCreate(g, 0);
	tidf = UserThreadCreate(f, &tidg);
	if(UserThreadJoin(tidg, 0) == -1)
		PutString("Erreur join du main sur g\n");
	PutString("Fin du main\n");
    return 0;
}
Esempio n. 9
0
File: pcx11e.c Progetto: cjg/grads
int
printf (const char *format, ...)
{
    char c, buffer[2048];
    va_list ap;
    va_start (ap, format);
    buffer[0] = 0;
    vsprintf (buffer, format, ap);
    va_end (ap);
    if ( x11_initialized ) {
        PutString (buffer);
        Redraw();
        return(0);
    } else {
        fprintf(stdout,"%s",buffer);
        return(0);
    }
}
Esempio n. 10
0
int trace(int line, char* file)
{
    KEY_STATUS KS;
    char buffer[256];

    memset(buffer, ' ', 80);
    snprintf(buffer, sizeof(buffer), "%s <%d>", file, line);
    strcpy(_buffer, buffer);
    PutString(1, 5, buffer);
    __dcache_writeback_all();
    _lcd_set_frame();
    _kbd_get_status(&KS);
    if (KS.status & CONTROL_BUTTON_START) {
        exit(0);
    }
    mdelay(500);
    return EXIT_SUCCESS;
}
Esempio n. 11
0
void TiXmlText::toStream( std::ostream& stream, int depth ) const
{
	if ( cdata )
	{
		int i;
		stream << "\n";
		for ( i=0; i<depth; i++ ) {
			stream << "    ";
		}
		stream << "<![CDATA[" << value << "]]>\n";
	}
	else
	{
		TIXML_STRING buffer;
		PutString( value, &buffer );
		stream << buffer;
	}
}
Esempio n. 12
0
void Find_Card(void)
{
    if(PcdRequest(0x52,Temp)==MI_OK)
    {
      if(Temp[0]==0x04&&Temp[1]==0x00)  
          PutString("MFOne-S50");
        else if(Temp[0]==0x02&&Temp[1]==0x00)
          PutString("MFOne-S70");
        else if(Temp[0]==0x44&&Temp[1]==0x00)
          PutString("MF-UltraLight");
        else if(Temp[0]==0x08&&Temp[1]==0x00)
          PutString("MF-Pro");
        else if(Temp[0]==0x44&&Temp[1]==0x03)
          PutString("MF Desire");
        else
          PutString("Unknown");
        PutString("SUCCESS!");
    }
    else PutString("Faile!");                                             
}
Esempio n. 13
0
void drawTrackLayoutGraph(char track) {
    char *trackA =
    "\033[2;44H"    "-- Track A --"
    "\033[4;24H"    "---------12--11----------------------------------\\"
    "\033[5;24H"    "-------4/   /  ---------13--------10-----------\\  \\"
    "\033[6;24H"    "          14--/           \\   |  /              \\  \\"
    "\033[7;24H"    "          /                \\  |/155              \\--9"
    "\033[8;24H"    "         |                156\\|                    |"
    "\033[9;24H"    "         |                    |\\154                |"
    "\033[10;24H"   "          \\               153/|  \\               /--8"
    "\033[11;24H"   "          15--\\            /  |   \\             /  /"
    "\033[12;24H"   "--------\\   \\  ----------S---------S-----------/  /"
    "\033[13;24H"   "---------1\\  \\---------6------------7------------/"
    "\033[14;24H"   "-----------2\\           \\          /"
    "\033[15;24H"   "-------------3-----------18--------5------------";

    char *trackB =
    "\033[2;44H"    "-- Track B --"
    "\033[4;24H"    "       ------------5--------18-----------3-------------"
    "\033[5;24H"    "                   /          \\           \\2-----------"
    "\033[6;24H"    "     /------------7------------6---------\\  \\1---------"
    "\033[7;24H"    "    /  /-----------17--------16---------  \\   \\"
    "\033[8;24H"    "   /  /              \\  |  /            \\--15  \\-\\"
    "\033[9;24H"    "  8--/                \\ |/153               \\     -\\"
    "\033[10;24H"   "  |                 154\\|                    |     |"
    "\033[11;24H"   "  |                     |\\156                |     |"
    "\033[12;24H"   " 9--\\               155/|  \\                /    /-/"
    "\033[13;24H"   "   \\  \\              /  |   \\           /--14   /"
    "\033[14;24H"   "    \\  \\-----------10--------13---------  /   /4-------"
    "\033[15;24H"   "     \\----------------------------------11--12---------";

    assert(STR_MAX_LEN > strlen(trackA));
    assert(STR_MAX_LEN > strlen(trackB));

    String s;
    sinit(&s);
    sputstr(&s, VT_CURSOR_SAVE);
    vt_pos(&s, VT_TRACK_GRAPH_ROW, VT_TRACK_GRAPH_COL);
    sputstr(&s, VT_RESET);
    sputstr(&s, track == 'a' ? trackA : trackB);
    sputstr(&s, VT_RESET);
    sputstr(&s, VT_CURSOR_RESTORE);
    PutString(COM2, &s);
}
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test threadMulJoin : \n");
	PutString("Cree un thread et recupere sa valeur de retour avec Join puis l'affiche.\n");
	PutString("-----------------------------------------\n");
	int tidf;
	int ret;
	tidf = UserThreadCreate(f, 0);
	if(UserThreadJoin(tidf, &ret) == -1)
		PutString("Erreur join du main sur f\n");
	else
	{
		PutString("Code retour f :  ");
		PutInt(ret);
		PutString("\n");
	}
	PutString("Fin du main\n");
    return 0;
}
Esempio n. 15
0
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test testJoinThreadFini2 : \n");
	PutString("Lance 2 threads et les attend, le 2e attendu est deja termine.\n");
	PutString("-----------------------------------------\n");
	int tidf, tidg;
	int th_ret;
	tidg = UserThreadCreate(g, 0);
	tidf = UserThreadCreate(f, 0);
	if(UserThreadJoin(tidf, &th_ret) == -1)
		PutString("Erreur join sur f\n");
	if(UserThreadJoin(tidg, &th_ret) == -1)
		PutString("Erreur join sur g\n");
	PutString("Fin du main\n");
    return 0;
}
Esempio n. 16
0
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test threadBadArg : \n");
	PutString("Lance un thread avec une mauvaise adresse d'argument.\n");
	PutString("Doit afficher \"Erreur de creation de thread\".\n");
	PutString("-----------------------------------------\n");
	if(UserThreadCreate(f, (void*)-1) == -1)
	{
		PutString("Erreur de creation de thread.\n");
	}
	else
	{
		PutString("Creation reussie.\n");
	}
    return 0;
}
Esempio n. 17
0
char* Itoa(int variable){
	 	 int i,sign;
	 	 char *s = malloc(MAX_LENGTH * sizeof(char));
	 	 if(s == 0){
	 		 PutString("Erreur Malloc\n");
	 		 Exit(0);
	 	 }
	     if ((sign = variable) < 0)
	         variable = -variable;  // on met notre variable positive pour faire notre transformation
	     i = 0;
	     do {  //on crée les variables mais dans l'autre sens
	         s[i++] = variable % 10 + '0';
	     } while ((variable /= 10) > 0);
	     if (sign < 0)
	         s[i++] = '-';
	     s[i] = '\0';
	     s = reverse(s);	//on le remet dans le bon sens
	     return s;
}
Esempio n. 18
0
void CAutomateEmbeddingApp::WriteScriptParameters(PIActionDescriptor descriptor)
   {
   // path for output files
   PutString(descriptor, keyOutput, m_sData->sOutput);
   // system options
   if(m_sData->bJpeg)
      PutBoolean(descriptor, keyJpeg, m_sData->bJpeg);
   // range of embedding strengths
   PutFloat(descriptor, keyStrengthMin, m_sData->dStrengthMin);
   PutFloat(descriptor, keyStrengthMax, m_sData->dStrengthMax);
   PutFloat(descriptor, keyStrengthStep, m_sData->dStrengthStep);
   // range of JPEG compression quality (if requested)
   if(m_sData->bJpeg)
      {
      PutInteger(descriptor, keyJpegMin, m_sData->nJpegMin);
      PutInteger(descriptor, keyJpegMax, m_sData->nJpegMax);
      PutInteger(descriptor, keyJpegStep, m_sData->nJpegStep);
      }
   }
Esempio n. 19
0
int
main()
{
	pthread tid;
	UserThreadCreate(f, (void *) THIS, &tid);
	UserThreadCreate(f, (void *) THIS, &tid);
	// UserThreadCreate(f, (void *) THIS, &tid);
	// UserThreadCreate(f, (void *) THIS, &tid);
	// UserThreadCreate(f, (void *) THIS, &tid);
	
	ForkExec("multiplethreads");

	b((void*) THAT);
	b((void*) THAT);
	b((void*) THAT);

	PutString("\nUserPages0 has terminated...\n");
	return 0;
}
Esempio n. 20
0
void TiXmlText::Print( FILE* cfile, int depth ) const
{
	assert( cfile );
	if ( cdata )
	{
		int i;
		fprintf( cfile, "\n" );
		for ( i=0; i<depth; i++ ) {
			fprintf( cfile, "    " );
		}
		fprintf( cfile, "<![CDATA[%s]]>\n", value.c_str() );	// unformatted output
	}
	else
	{
		TIXML_STRING buffer;
		PutString( value, &buffer );
		fprintf( cfile, "%s", buffer.c_str() );
	}
}
int main()
{
    file = Open("test");
    char id[NB_THREADS];

    int i;
    for(i=0;i<NB_THREADS; i++)
    {
        id[i] = UserThreadCreate(fun,(void*) i);
    }

    for(i=0;i<NB_THREADS; i++)
    {
        UserThreadJoin(id[i],NULL);
    }
    PutString("END\n");
    Close(file);
    return 0;
}
Esempio n. 22
0
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test testFin : \n");
	PutString("Teste la terminaison des threads sans appel explicite a UserThreadExit.\n");
	PutString("-----------------------------------------\n");
	PutString("Main, Tid : \n");
	PutInt(GetTid());
	PutString("\n");
	UserThreadCreate(f, 0);
	UserThreadCreate(g, 0);
	UserThreadCreate(fin, 0);
    return 0;
}
Esempio n. 23
0
/*
 * Teste la creation de thread avec une grande adresse de fonction.
 * La pile est alors placee en dehors de la memoire du MIPS, ce qui provoque une erreur.
 * Ce test est cense afficher "Erreur de creation de thread."
 */
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test threadBadStack : \n");
	PutString("Lance un thread avec une trop grand adresse de fonction.\n");
	PutString("Doit afficher \"Erreur de creation de thread\".\n");
	PutString("-----------------------------------------\n");
	int a = 0;
	if(UserThreadCreate((void(*)(void*))32700, &a) == -1)
	{
		PutString("Erreur de creation de thread.\n");
	}
	else
	{
		PutString("Creation reussie.\n");
	}
    return 0;
}
Esempio n. 24
0
void DrawLabel(const struct zzLabel* label)
{
	short state = GetControlState(label);

	DrawBackground(&label->ctrl, state);
	DrawBoundary(&label->ctrl, state);	
	
	if(label->link)
	{
		PutString(GetXPositoinText(&label->ctrl, label->link) + 1,
						GetYPositoinText(&label->ctrl, label->link) + 1,
						label->ctrl.font,
						label->link,
						label->ctrl.color,
						label->ctrl.bgColor,
						&label->ctrl.rect,
						FLG_TEXT);
	
	}
}
//////////////////////////////////////////////////////////////////////////
// char*
HRESULT CBPersistMgr::Transfer(char* Name, char** Val)
{
	if(m_Saving)
	{
		PutString(*Val);
		return S_OK;
	}
	else
	{
		char* str = GetString();
		if(str)
		{

			*Val = new char[strlen(str)+1];
			strcpy(*Val, str);
		}
		else *Val = NULL;
		return S_OK;
	}
}
Esempio n. 26
0
void DrawButton(const struct zzButton* button) {

	short state = GetControlState(button);
	
	struct rectangle rect;

	DrawBackground(&button->ctrl, state);
	DrawBoundary(&button->ctrl, state);	

	if(button->link)
	{
		PutString(GetXPositoinText(&button->ctrl,button->link) + ((state & STATE_CLICKED) && (state & STATE_FOCUSED)),
				GetYPositoinText(&button->ctrl,button->link) + ((state & STATE_CLICKED)  && (state & STATE_FOCUSED)),
				button->ctrl.font,
				button->link,
				(button->ctrl.style & STYLE_TRANSPARENT) ? button->ctrl.color + (state & STATE_FOCUSED) : 0,
				button->ctrl.color,
				&button->ctrl.rect,
				FLG_TEXT);
	}
}
Esempio n. 27
0
void TiXmlText::Print(NXU_FILE *cfile, int depth)const
{
	if (cdata)
	{
		int	i;
		nxu_fprintf(cfile, "\n");
		for	(i = 0;	i	<	depth; i++)
		{
			nxu_fprintf(cfile, "		");
		}
		nxu_fprintf(cfile, "<![CDATA[");
		nxu_fprintf(cfile, "%s", value.c_str()); //	unformatted	output
		nxu_fprintf(cfile, "]]>\n");
	}
	else
	{
		TIXML_STRING buffer;
		PutString(value, &buffer);
		nxu_fprintf(cfile, "%s", buffer.c_str());
	}
}
Esempio n. 28
0
void DrawTextField(const struct zzTextField* textField)
{
	unsigned short state = GetControlState(textField);

	DrawBackground(&textField->ctrl,state);
	DrawBoundary(&textField->ctrl, state);

	if(textField->link)
	{
		PutString(GetXPositoinText(&textField->ctrl, textField->link) + 1,
						GetYPositoinText(&textField->ctrl, textField->link) + 1,
						textField->ctrl.font,
						textField->link,
						textField->ctrl.color,
						textField->ctrl.bgColor,
						&textField->ctrl.rect,
						FLG_TEXT);
	
	}
	
}
Esempio n. 29
0
int main()
{
	PutString("\n-----------------------------------------\n");
	PutString("Lancement du test testJoinAttenteRec : \n");
	PutString("Lance 3 threads f, g et h. Le main attend f qui attend g qui attend h.\n");
	PutString("-----------------------------------------\n");
	int tidf, tidg, tidh;
	tidh = UserThreadCreate(h, 0);
	tidg = UserThreadCreate(g, &tidh);
	tidf = UserThreadCreate(f, &tidg);

	if(UserThreadJoin(tidf, 0) == -1)
		PutString("Erreur join du main sur f\n");
	PutString("Fin du main\n");
    return 0;
}
/**
 * バイアント値を格納する
 */
void tTJSBinarySerializer::PutVariant( tTJSBinaryStream* stream, tTJSVariant& v )
{
	tTJSVariantType type = v.Type();
	switch( type ) {
	case tvtVoid: {
		tjs_uint8 tmp[1];
		tmp[0] = TYPE_VOID;
		stream->Write( tmp, sizeof(tmp) );
		break;
	}
	case tvtObject:
		break;
/*
		{
		iTJSDispatch2* obj = v.AsObjectNoAddRef();
		iTJSDispatch2* objthis = v.AsObjectThisNoAddRef();
		if( obj == NULL && objthis == NULL ) {
			Put( TYPE_NIL );
		} else {
			SaveStructured
		}
		break;
	}
*/
	case tvtString:
		PutString( stream, v.AsStringNoAddRef() );
		break;
	case tvtOctet:
		PutOctet( stream, v.AsOctetNoAddRef() );
		break;
	case tvtInteger:
		PutInteger( stream, v.AsInteger() );
		break;
	case tvtReal:
		PutDouble( stream, v.AsReal() );
		break;
	default:
		break;
	}
}