static void DumpAliases(void) { int i; oprintf(icdFile, "Alias Dump:\n"); for (i=0; i < DAGSIZE; i++) { ALIASADDRESS *aa = addresses[i]; while (aa) { ALIASLIST *al; ALIASADDRESS *aa1 = aa; while (aa1->merge) aa1 = aa1->merge; al = aa1->pointsto; PrintName(aa->name, aa->offset); oprintf(icdFile, ": "); while (al) { PrintName(al->address->name, al->address->offset); oprintf(icdFile," "); al = al->next; } PrintTemps(aa1->modifiedBy); oprintf(icdFile, "\n"); aa = aa->next; } } for (i=0; i < cachedTempCount; i++) { if (tempInfo[i]->pointsto) { ALIASLIST *al = tempInfo[i]->pointsto; oprintf(icdFile, "T%d:", i); while (al) { PrintName(al->address->name, al->address->offset); oprintf(icdFile," "); al = al->next; } PrintTemps(tempInfo[i]->modifiedBy); oprintf(icdFile, "\n"); } } { ALIASLIST *al = parmList; oprintf(icdFile, "UIV: "); while (al) { ALIASADDRESS *aa1 = al->address; while (aa1->merge) aa1 = aa1->merge; PrintName(aa1->name, aa1->offset); oprintf(icdFile," "); al = al->next; } PrintTemps(uivBytes); } }
void OutputLine_def_MS(FILE *fileDest, EXPORT *pexp) { PrintName(fileDest, pexp, &pexp->strName, 0); if (gbImportLib) { /* Redirect to a stub function, to get the right decoration in the lib */ fprintf(fileDest, "=_stub_%.*s", pexp->strName.len, pexp->strName.buf); } else if (pexp->strTarget.buf) { if (pexp->strName.buf[0] == '?') { fprintf(stderr, "warning: ignoring C++ redirection %.*s -> %.*s\n", pexp->strName.len, pexp->strName.buf, pexp->strTarget.len, pexp->strTarget.buf); } else { fprintf(fileDest, "="); /* If the original name was decorated, use decoration in the forwarder as well */ if ((giArch == ARCH_X86) && ScanToken(pexp->strName.buf, '@') && !ScanToken(pexp->strTarget.buf, '@') && ((pexp->nCallingConvention == CC_STDCALL) || (pexp->nCallingConvention == CC_FASTCALL)) ) { PrintName(fileDest, pexp, &pexp->strTarget, 1); } else { /* Write the undecorated redirection name */ fprintf(fileDest, "%.*s", pexp->strTarget.len, pexp->strTarget.buf); } } } else if (((pexp->uFlags & FL_STUB) || (pexp->nCallingConvention == CC_STUB)) && (pexp->strName.buf[0] == '?')) { /* C++ stubs are forwarded to C stubs */ fprintf(fileDest, "=stub_function%d", pexp->nNumber); } else if (gbTracing && ((pexp->uFlags & FL_NORELAY) == 0) && (pexp->nCallingConvention == CC_STDCALL) && (pexp->strName.buf[0] != '?')) { /* Redirect it to the relay-tracing trampoline */ fprintf(fileDest, "=$relaytrace$%.*s", pexp->strName.len, pexp->strName.buf); } }
void OutputLine_def_GCC(FILE *fileDest, EXPORT *pexp) { /* Print the function name, with decoration for export libs */ PrintName(fileDest, pexp, &pexp->strName, gbImportLib); DbgPrint("Generating def line for '%.*s'\n", pexp->strName.len, pexp->strName.buf); /* Check if this is a forwarded export */ if (pexp->strTarget.buf) { int fIsExternal = !!ScanToken(pexp->strTarget.buf, '.'); DbgPrint("Got redirect '%.*s'\n", pexp->strTarget.len, pexp->strTarget.buf); /* print the target name, don't decorate if it is external */ fprintf(fileDest, "="); PrintName(fileDest, pexp, &pexp->strTarget, !fIsExternal); } else if (((pexp->uFlags & FL_STUB) || (pexp->nCallingConvention == CC_STUB)) && (pexp->strName.buf[0] == '?')) { /* C++ stubs are forwarded to C stubs */ fprintf(fileDest, "=stub_function%d", pexp->nNumber); } /* Special handling for stdcall and fastcall */ if ((giArch == ARCH_X86) && ((pexp->nCallingConvention == CC_STDCALL) || (pexp->nCallingConvention == CC_FASTCALL))) { /* Is this the import lib? */ if (gbImportLib) { /* Is the name in the spec file decorated? */ const char* pcDeco = ScanToken(pexp->strName.buf, '@'); if (pcDeco && (pcDeco < pexp->strName.buf + pexp->strName.len)) { /* Write the name including the leading @ */ fprintf(fileDest, "==%.*s", pexp->strName.len, pexp->strName.buf); } } else if (!pexp->strTarget.buf) { /* Write a forwarder to the actual decorated symbol */ fprintf(fileDest, "="); PrintName(fileDest, pexp, &pexp->strName, 1); } } }
/************************************************************************** * * PrintMacro * * SYNOPSIS * void PrintMacro (MakeMacro *macro) * * PURPOSE * * * INPUT * * * EFFECTS * * * RETURN VALUE * * * BUGS * * * HISTORY * * * SEE ALSO * */ void PrintMacro (MakeMacro *macro) { NameType *name; name = (NameType*)LST_Head (¯o->Names); while (!LST_EndOfList (name)) { name = PrintName (name); } } /* PrintMacro */
int main(void) { printf("Give me your name:\n"); string s; do { s = GetString(); printf("Your name is required. Please try again.\n"); } while (strlen(s) == 0); PrintName(s); }
Composite::~Composite() { int ElementCount = _ComponentMap.GetSize(); while(ElementCount > 0) { ElementCount--; delete _ComponentMap[ElementCount]; _ComponentMap.RemoveAt(ElementCount); } cout << "Deleting COMPOSITE!!:("; PrintName(); cout << ")" << endl; }
int main() { int c; int state; int len; state = 0; len = 0; do { c = getchar(); switch (state) { case 0: if (IsAlphaNum(c)) { buf[len] = c; len++; state = 1; } else { if (c != EOF) putchar(c); } break; case 1: if (IsAlphaNum(c)) { buf[len] = c; len++; } else { buf[len] = '\0'; PrintName(buf); len = 0; if (c != EOF) putchar(c); state = 0; } break; } } while (c != EOF); return 0; }
string Node::PrintEverything() { string output; output += "\t<NODE>\n"; output += PrintName(); output += PrintDefault(); output += PrintNodeNum(); output += PrintIPAddress(); output += PrintLocation(); output += PrintType(); output += PrintZone(); output += PrintParentNodeNum(); output += PrintParentDistance(); output += PrintStateChangeTime(); output += PrintChildren(); output += "\t</NODE>\n"; return output; }
void GetNetConfig::PrintAdapterInfo(PIP_ADAPTER_INFO pAdapter) { m_pAdapter = pAdapter; PrintName(); // Print Adepter Name & Description PrintMACaddress(); // Print MAC address PrintIndex(); // Print Combo Index & Index PrintIPV4Address(); PrintMaskAddress(); PrintGatewayAddress(); PrintDNSAddress(); if ((m_nOptions & pt_other) == pt_other) { printf("\n"); } PrintDHCP(); PrintWINS(); }
int main(void) { printf("What is your name?: "); string s = GetString(); PrintName(s); }
void ARBarFormat::print() const { PrintName (std::cout); PrintParameters (std::cout); }
DebugOverlayWidget::DebugOverlayWidget(CanvasWidget * MainCanvas) : CanvasWidget(Vector2n::ZERO, false, false) { { auto Content = []() -> std::string { std::ostringstream out; out << "Mouse.PntrMppng.m_Entries.size(): " << g_InputManager->m_MousePointer->ModifyPointerMapping().m_Entries.size(); for (auto & i : g_InputManager->m_MousePointer->ModifyPointerMapping().m_Entries) { PrintName(out, i); auto LocalPosition = dynamic_cast<Widget *>(&i->GetOwner())->GlobalToLocal(Vector2n(g_InputManager->m_MousePointer->GetPointerState().GetAxisState(0).GetPosition(), g_InputManager->m_MousePointer->GetPointerState().GetAxisState(1).GetPosition())); out << " [" << static_cast<Widget *>(&i->GetOwner())->GetDimensions().X() << ", " << static_cast<Widget *>(&i->GetOwner())->GetDimensions().Y() << "]"; out << " (" << LocalPosition.X() << ", " << LocalPosition.Y() << ")"; out << " <" << static_cast<Widget *>(&i->GetOwner())->m_DebugDescription << ">"; } out << "\nKB.PntrMppng.m_Entries.size(): " << g_InputManager->m_TypingPointer->ModifyPointerMapping().m_Entries.size(); for (auto & i : g_InputManager->m_TypingPointer->ModifyPointerMapping().m_Entries) { PrintName(out, i); } return out.str(); }; AddWidget(new LabelWidget(Vector2n(0, 18), Content)); } { auto Content = []() -> std::string { std::ostringstream out; out << "InputManager.m_IEQueue.m_Queue" << std::endl; for (auto & i : g_InputManager->m_InputEventQueue.m_Queue) { out << i.ToString() << std::endl; } return out.str(); }; AddWidget(new LabelWidget(Vector2n(0, 240), Content)); } // Visualizer of currently available shortcuts { auto Content = []() -> std::string { std::ostringstream out; std::map<GestureRecognizer::ShortcutEntry::Key, GestureRecognizer::ShortcutEntry &> AvailShortcuts; // Find all non-overlapping available shortcuts for (auto & i : g_InputManager->m_TypingPointer->ModifyPointerMapping().m_Entries) { for (auto & S : i->m_Shortcuts) { // TODO: Highlight shortcuts that can be activated in current state (e.g. Cmd+O does nothing when a folder is selected, etc.) // Only add this shortcut if there isn't any other overlapping one (i.e., with the same signature <Modifier, InputId>) auto Key = decltype(AvailShortcuts)::key_type(S.InputId, S.Modifiers); if (AvailShortcuts.end() == AvailShortcuts.find(Key)) AvailShortcuts.insert(decltype(AvailShortcuts)::value_type(Key, S)); } } // Print out all available shortcuts (in some sorted order) for (auto & aS : AvailShortcuts) { auto & S = aS.second; if (PointerState::Modifiers::Super == S.Modifiers) // TODO: Make this more general (Modifier -> string) out << "Cmd+"; switch (S.InputId) { case GLFW_KEY_F3: out << "F3"; break; default: out << static_cast<char>(S.InputId); break; } out << " - " << S.Description; out << endl; } return out.str(); }; // TODO: Make it right aligned to edge of screen AddWidget(new LabelWidget(Vector2n(1536 - 19 * charWidth, lineHeight + 2), Content)); } // Time in top right corner // TODO: Add support for reference frames other than top left corner as origin auto TimeWidget = new class TimeWidget(Vector2n(1536 - 13 * charWidth - 1, 1)); //TimeWidget->SetPosition(TimeWidget->GetPosition() - Vector2n(TimeWidget->GetDimensions().X(), 0)); // This doesn't work because its dimensions are updated after render... AddWidget(TimeWidget); // Visibility toggle { auto ToggleWidget = new class ToggleWidget(Vector2n(1, 1), [=](bool State) { // Toggle visibility of all widgets but the last one (i.e. this toggle) // TODO: Fix problem where upon initialize, OnChange is called before this widget has been added, so 2nd last widget is not hidden for (auto Widget = GetWidgets().begin(); GetWidgets().end() != Widget && GetWidgets().end() - 3 != Widget; ++Widget) { (*Widget)->m_Visible = State; } }, false); AddWidget(ToggleWidget); ProcessTimePassed(0); // HACK: Get all the widgets actually added ToggleWidget->UpdateHACK(); } }
int main(void) { printf("Your name: "); string s = GetString(); PrintName(s); }
int main() { PrintName("koye"); }
int main(void){ printf("what is your name?\n"); string name = GetString(); PrintName(name); }
int OutputLine_def(FILE *fileDest, EXPORT *pexp) { fprintf(fileDest, " "); PrintName(fileDest, pexp, "", 0, (giArch == ARCH_X86) && !gbKillAt); if (gbImportLib) { fprintf(fileDest, "="); PrintName(fileDest, pexp, "_stub_", 0, 0); } else if (pexp->pcRedirection) { if (gbMSComp && (pexp->pcName[0] == '?')) { /* ignore c++ redirection, since link doesn't like that! */ } else { int fDeco; fDeco = ((giArch == ARCH_X86) && !ScanToken(pexp->pcRedirection, '.')); fprintf(fileDest, "="); PrintName(fileDest, pexp, "", 1, fDeco && !gbMSComp); } } else if (((pexp->uFlags & FL_STUB) || (pexp->nCallingConvention == CC_STUB)) && (pexp->pcName[0] == '?')) { /* C++ stubs are forwarded to C stubs */ fprintf(fileDest, "="); fprintf(fileDest, "stub_function%d", pexp->nNumber); } else if ((giArch == ARCH_X86) && gbKillAt && !gbMSComp && (pexp->nCallingConvention == CC_STDCALL || pexp->nCallingConvention == CC_FASTCALL)) { fprintf(fileDest, "="); PrintName(fileDest, pexp, "", 0, 1); } if (pexp->nOrdinal != -1) { fprintf(fileDest, " @%d", pexp->nOrdinal); } if (pexp->nCallingConvention == CC_EXTERN) { fprintf(fileDest, " DATA"); } if (pexp->uFlags & FL_PRIVATE) { fprintf(fileDest, " PRIVATE"); } if (pexp->uFlags & FL_NONAME) { fprintf(fileDest, " NONAME"); } fprintf(fileDest, "\n"); return 1; }