本文整理汇总了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();
}
示例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 );
}
示例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);
}
示例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;
}
}
示例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;
}
示例6: WebResponse
void WebResponse (const prog_char *response, long strsize)
{
// P(WebHeaderMsg) = SERVER_HEADER_HTML;
// printP(WebHeaderMsg);
PrintHeader(strsize,0);
PROGMEMprint(response);
}
示例7: PrintHeader
void StdoutConsumer::Consume(const Log::Entry& entry)
{
PrintHeader(entry);
PrintMessage(std::cout, entry, true);
PrintContext(entry);
PrintNewLine(std::cout, true);
}
示例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());
}
示例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();
}
}
示例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;
}
示例11: PrintHeader
size_t DumpBuffer::Print()
{
cout << endl;
size_t size = PrintHeader();
cout << "Buffer not templated to allow formatted output" << endl;
return size;
}
示例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;
}
示例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]);
}
示例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);
}
示例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);
}
}
}