当前位置: 首页>>代码示例>>C++>>正文


C++ PrintHeader函数代码示例

本文整理汇总了C++中PrintHeader函数的典型用法代码示例。如果您正苦于以下问题:C++ PrintHeader函数的具体用法?C++ PrintHeader怎么用?C++ PrintHeader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PrintHeader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Emit

void Emit(char * filename)
{
	Var * var;

	EmitOpen(filename);

	VarUse();

	if (Verbose(NULL)) {

		PrintHeader(1, "Variables");

		for(var = VarFirst(); var != NULL; var = VarNext(var)) {
			if (var->write >= 1 || var->read >= 1) {
				if (var->mode == INSTR_VAR && !VarIsReg(var) && !VarIsLabel(var)) {
					PrintVar(var); PrintEOL();
				}
			}
		}

		PrintHeader(1, "Output");
	} // verbose

	EmitLabels();

	//TODO: ProcessUsedProc
//	if (!EmitProc(&ROOT_PROC)) goto failure;
	EmitProc(&ROOT_PROC);
	EmitProcedures();
	EmitAsmIncludes();	
	EmitInstrOp(INSTR_CODE_END, NULL, NULL, NULL);
	VarEmitAlloc();
	EmitInstrOp(INSTR_SRC_END, NULL, NULL, NULL);
	EmitClose();
}
开发者ID:davidechiappetta,项目名称:atalan,代码行数:35,代码来源:emit.c

示例2: DumpASMSection

return_val DumpASMSection( section_ptr sec, unsigned_8 *contents, orl_sec_size size, unsigned pass )
{
    hash_data           *data_ptr;
    label_list          sec_label_list;
    label_entry         l_entry;
    ref_list            sec_ref_list;
    ref_entry           r_entry;
    return_val          err;

    data_ptr = HashTableQuery( HandleToLabelListTable, (hash_value) sec->shnd );
    if( data_ptr ) {
        sec_label_list = (label_list) *data_ptr;
        l_entry = sec_label_list->first;
    } else {
        sec_label_list = NULL;
        l_entry = NULL;
    }

    r_entry = NULL;
    data_ptr = HashTableQuery( HandleToRefListTable, (hash_value) sec->shnd );
    if( data_ptr ) {
        sec_ref_list = (ref_list) *data_ptr;
        if( sec_ref_list != NULL ) {
            r_entry = sec_ref_list->first;
        }
    }

    if( pass == 1 ) {
        DoPass1Relocs( contents, r_entry, 0, size );
        return( RC_OKAY );
    }

    if( size == 0 ) {
        if( IsMasmOutput() ) {
            PrintHeader( sec );
            dumpAsmLabel( l_entry, sec, 0, 0, NULL, NULL );
            PrintTail( sec );
        }
        return( RC_OKAY );
    }

    PrintHeader( sec );
    err = DumpASMDataFromSection( contents, 0, size, &l_entry, &r_entry, sec );
    if( size > 0 ) {
        l_entry = dumpAsmLabel( l_entry, sec, size, size, NULL, NULL );
    }
    BufferConcatNL();
    BufferPrint();
    if( err == RC_OKAY ) {
        PrintTail( sec );
    }
    return( err );
}
开发者ID:NoSuchProcess,项目名称:open-watcom-v2,代码行数:53,代码来源:formasm.c

示例3: ClearStr

bool MiniApache::PendingRequest(){
	if (_serve_status == 1){ // Waiting for client
		client = _server->available();  // try to get client
		if (client) {  // got client?
			ClearStr(_HTTP_request, REQUEST_BUFFER_SIZE);
			_serve_status = 2;
		}
	}
	if (_serve_status == 2){ // Reading request
        if (client.connected()){
            while (client.available()){ // client data available to read
				char c = client.read();
				if (_request_index < (REQUEST_BUFFER_SIZE - 1)){ // save HTTP request character
					_HTTP_request[_request_index] = c; 
					_request_index++;
				} else {
					PrintHeader(400, "Bad request", "text/html", false);
					ReportClientServed(400);
					break;
				}
				if (c == '\r' || c == '\n'){
					_serve_status = 3;
					delete [] GET_data;
					delete [] request_path;
					request_path = ExtractRequestPath(); // Get path of the HTTP request, ignore type (assume GET)
					GET_data = ExtractRequestData();     // Get GET data of the HTTP request
					
					if (_error_status){ // Error was detected (earlier)
						PrintHeader(500, "Internal Server Error", "text/html", false);
						client.println("<thml><hrad><title>Internal Server Error</title></head><body>500: Internal Server Error<br>Error code:");
						client.println(_error_status);
						client.println("<br>Error message:");
						client.println(GetErrorMessage());
						client.println("<hr>MiniApache</body></html>");
						ReportClientServed(500);
					}
					
                    #if SERIAL_DEBUG == 1
                        Serial.print("Free memory: ");
                        Serial.println(freeRam());
	                #endif
					
					break; // Ignore rest of the HTTP request
				} 
            }
        }
	}
	return (_serve_status == 3);
}
开发者ID:sim1234,项目名称:MiniApache,代码行数:49,代码来源:MiniApache.cpp

示例4: PrintHeader

int MiniApache::ServeFile(char *path){ // Not used
    _storageFile = SD.open(path);
    if (_storageFile){ // Serve file
    	PrintHeader(200, "OK", GetMIMEType(path), true);
        while(_storageFile.available()){
            client.write(_storageFile.read());
        }
        _storageFile.close();
        return 200;
    } else { // Return 404 error
    	PrintHeader(404, "Not Found", "text/html", true);
        client.println("File Not Found");
        return 404;
    }
}
开发者ID:sim1234,项目名称:MiniApache,代码行数:15,代码来源:MiniApache.cpp

示例5: main

int main()
{
	PrintHeader("Nick Francke", 'A', 7);

	Rectangle myRect;
	Triangle myTri;

	int width, height, side1, side2, side3;

	width = ValidateInput<int>("Enter a rectangle width from 1 - 1000: ", 1, 1000);
	height = ValidateInput<int>("Enter a rectangle height from 1 - 1000: ", 1, 1000);

	std::cout << "Attributes of the rectangle: " << std::endl;
	myRect.setAttributes(width, height);
	PrintPerimeter(&myRect);
	PrintArea(&myRect);

	std::cout << std::endl;

	side1 = ValidateInput<int>("Enter a triangle's first side from 1 - 1000: ", 1, 1000);
	side2 = ValidateInput<int>("Enter a triangle's second side from 1 - 1000: ", 1, 1000);
	side3 = ValidateInput<int>("Enter a triangle's third side from 1 - 1000: ", 1, 1000);
	myTri.setAttributes(side1, side2, side3);
	PrintPerimeter(&myTri);
	PrintArea(&myTri);

	return 0;
}
开发者ID:GoldHorizon,项目名称:CS1C,代码行数:28,代码来源:main.cpp

示例6: WebResponse

void WebResponse (const prog_char *response, long strsize)
{
//  P(WebHeaderMsg) = SERVER_HEADER_HTML;
//  printP(WebHeaderMsg);
	PrintHeader(strsize,0);
	PROGMEMprint(response);
}
开发者ID:bondolo,项目名称:Libraries,代码行数:7,代码来源:RA_Wifi.cpp

示例7: PrintHeader

void StdoutConsumer::Consume(const Log::Entry& entry)
{
   PrintHeader(entry);
   PrintMessage(std::cout, entry, true);
   PrintContext(entry);
   PrintNewLine(std::cout, true);
}
开发者ID:eProsima,项目名称:Fast-RTPS,代码行数:7,代码来源:StdoutConsumer.cpp

示例8: Usage

/**
**  Display the usage.
*/
static void Usage()
{
	PrintHeader();
	printf(
		"\n\nUsage: %s [OPTIONS] [map.smp|map.smp.gz]\n"
		"\t-c file.lua\tConfiguration start file (default stratagus.lua)\n"
		"\t-d datapath\tPath to stratagus data (default current directory)\n"
		"\t-D depth\tVideo mode depth = pixel per point\n"
		"\t-e\t\tStart editor (instead of game)\n"
		"\t-E file.lua\tEditor configuration start file (default editor.lua)\n"
		"\t-F\t\tFull screen video mode\n"
		"\t-h\t\tHelp shows this page\n"
		"\t-I addr\t\tNetwork address to use\n"
		"\t-l\t\tDisable command log\n"
		"\t-L lag\t\tNetwork lag in # frames (default 10 = 333ms)\n"
		"\t-n server\tNetwork server host preset\n"
		"\t-N name\t\tName of the player\n"
		"\t-o\t\tDo not use OpenGL or OpenGL ES 1.1\n"
		"\t-O\t\tUse OpenGL or OpenGL ES 1.1\n"
		"\t-P port\t\tNetwork port to use\n"
		"\t-s sleep\tNumber of frames for the AI to sleep before it starts\n"
		"\t-S speed\tSync speed (100 = 30 frames/s)\n"
		"\t-U update\tNetwork update rate in # frames (default 5=6x per s)\n"
		"\t-v mode\t\tVideo mode resolution in format <xres>x<yres>\n"
		"\t-W\t\tWindowed video mode\n"
		"map is relative to StratagusLibPath=datapath, use ./map for relative to cwd\n",
		Parameters::Instance.applicationName.c_str());
}
开发者ID:ajaykon,项目名称:Stratagus,代码行数:31,代码来源:stratagus.cpp

示例9: main

void main( int argc, char *argv[] )
{
    int         fp;
    HelpHeader  header;
    unsigned    i;

    if( argc != 2 ) {
        printf( "Usage: helpdump <help file name>\n" );
        return;
    }
    fp = open( argv[1], O_RDONLY | O_BINARY );
    if( fp == -1 ) {
        printf( "Unable to open %s\n", argv[1] );
        return;
    }
    read( fp, &header, sizeof( HelpHeader ) );
    PrintHeader( &header );
    read( fp, Buffer, header.str_size );
    PrintStrings( Buffer );
    read( fp, Buffer, header.datapagecnt * sizeof( uint_16 ) );
    PrintItemIndex( &header );
    for( i = 0; i < header.indexpagecnt + header.datapagecnt; i++ ) {
        read( fp, Buffer, HLP_PAGE_SIZE );
        PrintPage();
    }
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:26,代码来源:dmp.c

示例10: DEBUG

bool CHTTPSock::PrintErrorPage(unsigned int uStatusId, const CString& sStatusMsg, const CString& sMessage) {
	if (SentHeader()) {
		DEBUG("PrintErrorPage(): Header was already sent");
		return false;
	}

	CString sPage =
		"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
		"<!DOCTYPE html>\r\n"
		"<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\r\n"
			"<head>\r\n"
				"<meta charset=\"UTF-8\"/>\r\n"
				"<title>" + CString(uStatusId) + " " + sStatusMsg.Escape_n(CString::EHTML) + "</title>\r\n"
			"</head>\r\n"
			"<body>\r\n"
				"<h1>" + sStatusMsg.Escape_n(CString::EHTML) + "</h1>\r\n"
				"<p>" + sMessage.Escape_n(CString::EHTML) + "</p>\r\n"
				"<hr/>\r\n"
				"<address>" +
					CZNC::GetTag(false, /* bHTML = */ true) +
					" at " + GetLocalIP().Escape_n(CString::EHTML) + " Port " + CString(GetLocalPort()) +
				"</address>\r\n"
			"</body>\r\n"
		"</html>\r\n";

	PrintHeader(sPage.length(), "text/html; charset=utf-8", uStatusId, sStatusMsg);
	Write(sPage);
	Close(Csock::CLT_AFTERWRITE);

	return true;
}
开发者ID:NeilHanlon,项目名称:znc,代码行数:31,代码来源:HTTPSock.cpp

示例11: PrintHeader

size_t DumpBuffer::Print()
{
  cout << endl;
  size_t size =  PrintHeader();
  cout << "Buffer not templated to allow formatted output" << endl;
  return size;
}
开发者ID:Brainiarc7,项目名称:TS,代码行数:7,代码来源:dumper.cpp

示例12: DrawHistogram_Vertical

int DrawHistogram_Vertical(int lengths[], int arraySize)
{

	int i, f;
	
	//int maxActualLength = GetMaxNonZeroIntegerArrayElement(lengths, arraySize) + 1;
	
	PrintHeader();
	
	//Loop down through frequencies and draw each horizontal part of vertical histogram
	for (f = GetMaxIntegerArrayValue(lengths, arraySize); f >= 1; f--)
	{
		for (i = 0; i < arraySize; i++)
		{
			if (lengths[i] >= f)
			{
				printf(" | ");
			}
			else
			{
				printf("   ");
			}
		}
		printf("\n");
	}
	
	//Write out column names
	for (i = 1; i <= arraySize; i++)
	{
		printf("%2d ", i);
	}
	printf("\n");
	
	return 0;
}
开发者ID:alexdgarland,项目名称:KRC,代码行数:35,代码来源:DrawHistograms.c

示例13: PrintFunction

void PrintFunction(const Proto* tf)
{
 int i,n=tf->nkproto;
 PrintHeader(tf);
 PrintCode(tf);
 for (i=0; i<n; i++) PrintFunction(tf->kproto[i]);
}
开发者ID:jessicah,项目名称:Vision,代码行数:7,代码来源:print.c

示例14: NET_QueryPrintCallback

static void NET_QueryPrintCallback(net_addr_t *addr,
                                   net_querydata_t *data,
                                   unsigned int ping_time,
                                   void *user_data)
{
    // If this is the first server, print the header.

    if (!printed_header)
    {
        PrintHeader();
        printed_header = true;
    }

    formatted_printf(5, "%4i", ping_time);
    formatted_printf(18, "%s: ", NET_AddrToString(addr));
    formatted_printf(8, "%i/%i", data->num_players, 
                                 data->max_players);

    if (data->gamemode != indetermined)
    {
        printf("(%s) ", GameDescription(data->gamemode, 
                                        data->gamemission));
    }

    if (data->server_state)
    {
        printf("(game running) ");
    }

    NET_SafePuts(data->description);
}
开发者ID:Krazygamr,项目名称:D-Touch,代码行数:31,代码来源:net_query.c

示例15: PrintResults

void PrintResults(void)
{
    int ix;
#ifdef DEBUG
    fprintf(ofp, "Debug dump of globals global struct:\n");
    fprintf(ofp, "  files_are_different = %d\n", globals.files_are_different);
    fprintf(ofp, "  file1_size          = %d\n", globals.file1_size);
    fprintf(ofp, "  file2_size          = %d\n", globals.file2_size);
    fprintf(ofp, "  compare_size        = %d\n", globals.compare_size);
    fprintf(ofp, "  filename1           = '%s'\n", globals.filename1);
    fprintf(ofp, "  filename2           = '%s'\n", globals.filename2);
    fprintf(ofp, "  rng_size            = %d\n", globals.rng_size);
    fprintf(ofp, "  rng_numel           = %d\n", globals.rng_numel);
    fprintf(ofp, "Debug dump of range array:\n");
    for (ix = 0; ix < globals.rng_numel; ix++) {
        fprintf(ofp, "  %8d %8d\n", globals.rng[ix].start, globals.rng[ix].end);
    }
#endif
    if (histogram) {
        PrintHistogram();
    } else {
        PrintHeader();
        PrintSeparator();
        for (ix = 0; ix < globals.rng_numel; ix++) {
            PrintRange(globals.rng[ix].start, globals.rng[ix].end);
        }
    }
}
开发者ID:akipta,项目名称:hobbyutil,代码行数:28,代码来源:bd.c


注:本文中的PrintHeader函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。