本文整理汇总了C++中output_string函数的典型用法代码示例。如果您正苦于以下问题:C++ output_string函数的具体用法?C++ output_string怎么用?C++ output_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了output_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: output_string_key
static int
output_string_key(char *string, int width, format_key_t *key)
{
if (strlen(string) == 0)
string = key_empty(key);
return output_string(string, width, key_align(key));
}
示例2: dumpsw
/**
* dump switch table
*/
dumpsw(loop_t *loop) {
int i,j;
data_segment_gdata ();
generate_label (loop->body_label);
if (loop->test_label != swstp) {
j = loop->test_label;
while (j < swstp) {
gen_def_word ();
i = 4;
while (i--) {
output_number (swstcase[j]);
output_byte (',');
print_label (swstlab[j++]);
if ((i == 0) | (j >= swstp)) {
newline ();
break;
}
output_byte (',');
}
}
}
gen_def_word ();
print_label (loop->cont_label);
output_string (",0");
newline ();
code_segment_gtext ();
}
示例3: header
/**
* print all assembler info before any code is generated
*/
void header (void) {
output_string ("; Small C Debug\n;\tCoder (ac0)\n;");
frontend_version();
newline ();
output_line ("\t;program area SMALLC_GENERATED is RELOCATABLE");
output_line ("\t.module SMALLC_GENERATED");
}
示例4: parse_timings_v1
static
void parse_timings_v1(confword_t* data)
{
mgconf_core_freq = &data[0];
if (!verbose_boot)
return;
output_string("timings\n"
" core frequency: ", 2);
output_uint(data[0], 2);
output_string("MHz\n"
" external memory bandwidth: ", 2);
output_uint(data[1], 2);
output_string(" x 1E6 bytes/s\n", 2);
}
示例5: gen_call
/**
* call the specified subroutine name
* @param sname subroutine name
*/
void gen_call(char *sname) {
output_with_tab ("call ");
output_string (sname);
output_byte(',');
output_number(args);
newline ();
}
示例6: main
// XIGNORE: *:D
int main(int argc, const char **argv) {
output_int(argc, 1);
output_char('\n', 1);
output_string(argv[0], 1);
output_char('\n',1);
return 0;
}
示例7: dumpglbs
/**
* dump all static variables
*/
void dumpglbs(void) {
int dim, i, list_size, line_count, value;
if (!glbflag)
return;
current_symbol_table_idx = rglobal_table_index;
while (current_symbol_table_idx < global_table_index) {
SYMBOL *symbol = &symbol_table[current_symbol_table_idx];
if (symbol->identity != FUNCTION) {
ppubext(symbol);
if (symbol->storage != EXTERN) {
output_string(symbol->name);
output_label_terminator();
dim = symbol->offset;
list_size = 0;
line_count = 0;
if (find_symbol_initials(symbol->name)) { // has initials
list_size = get_size(symbol->name);
if (dim == -1) {
dim = list_size;
}
}
for (i=0; i<dim; i++) {
if (symbol->type == STRUCT) {
dump_struct(symbol, i);
} else {
if (line_count % 10 == 0) {
newline();
if ((symbol->type & CINT) || (symbol->identity == POINTER)) {
gen_def_word();
} else {
gen_def_byte();
}
}
if (i < list_size) {
// dump data
value = get_item_at(symbol->name, i, &tag_table[symbol->tagidx]);
output_number(value);
} else {
// dump zero, no more data available
output_number(0);
}
line_count++;
if (line_count % 10 == 0) {
line_count = 0;
} else {
if (i < dim-1) {
output_byte( ',' );
}
}
}
}
newline();
}
} else {
fpubext(symbol);
}
current_symbol_table_idx++;
}
}
示例8: puts
static int puts(FILE *fp, const char *s) {
SkunkConsole *co = fp->data;
if(co != NULL) {
output_string(co, s);
return 0;
}
return EOF;
}
示例9: needbrack
/**
* enforces bracket
* @param str
* @return
*/
void needbrack(char *str) {
if (!match (str)) {
error ("missing bracket");
gen_comment ();
output_string (str);
newline ();
}
}
示例10: callstk
/**
* perform subroutine call to value on top of stack
*/
void callstk(void) {
gen_immediate ();
output_string ("#.+5");
newline ();
gen_swap_stack ();
output_line ("pchl");
stkp = stkp + INTSIZE;
}
示例11: added
static void
added (guestfs_h *g, struct file *file)
{
output_start_line ();
output_string ("+");
output_file (g, file);
output_end_line ();
}
示例12: erase_string
void erase_string(string& in_string,unsigned int erase_point,unsigned int erase_length) {
if (in_string.empty()) return;
if (!(in_string.length()>=erase_point+erase_length)) return;
string output_string(in_string.substr(0,erase_point));
output_string+=in_string.substr(erase_point+erase_length,in_string.length());
in_string=output_string;
}
示例13: net_service
static BOOL net_service(int operation, const WCHAR* service_name)
{
SC_HANDLE SCManager, serviceHandle;
BOOL result = 0;
WCHAR service_display_name[4096];
DWORD buffer_size;
SCManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if(!SCManager)
{
output_string(STRING_NO_SCM);
return FALSE;
}
serviceHandle = OpenServiceW(SCManager, service_name, SC_MANAGER_ALL_ACCESS);
if(!serviceHandle)
{
output_string(STRING_NO_SVCHANDLE);
CloseServiceHandle(SCManager);
return FALSE;
}
buffer_size = sizeof(service_display_name)/sizeof(*service_display_name);
GetServiceDisplayNameW(SCManager, service_name, service_display_name, &buffer_size);
if (!service_display_name[0]) lstrcpyW(service_display_name, service_name);
switch(operation)
{
case NET_START:
output_string(STRING_START_SVC, service_display_name);
result = StartServiceW(serviceHandle, 0, NULL);
if(result) output_string(STRING_START_SVC_SUCCESS, service_display_name);
else
{
if (!output_error_string(GetLastError()))
output_string(STRING_START_SVC_FAIL, service_display_name);
}
break;
case NET_STOP:
output_string(STRING_STOP_SVC, service_display_name);
result = StopService(SCManager, serviceHandle);
if(result) output_string(STRING_STOP_SVC_SUCCESS, service_display_name);
else
{
if (!output_error_string(GetLastError()))
output_string(STRING_STOP_SVC_FAIL, service_display_name);
}
break;
}
CloseServiceHandle(serviceHandle);
CloseServiceHandle(SCManager);
return result;
}
示例14: gen_get_memory
/**
* fetch a static memory cell into the primary register
* @param sym
*/
void gen_get_memory(SYMBOL *sym) {
if ((sym->identity != POINTER) && (sym->type == CCHAR)) {
output_with_tab ("lda\t");
output_string (sym->name);
newline ();
gen_call ("ccsxt");
} else if ((sym->identity != POINTER) && (sym->type == UCHAR)) {
output_with_tab("lda\t");
output_string(sym->name);
newline();
output_line("mov \tl,a");
output_line("mvi \th,#0");
} else {
output_with_tab ("lhld\t");
output_string (sym->name);
newline ();
}
}
示例15: parse_layout_v1
static
void parse_layout_v1(confword_t* data)
{
mgconf_layout_data = &data[0];
if (!verbose_boot)
return;
output_string("place layout\n", 2);
}