ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Definition at line 54 of file prompt.c.

Referenced by Batch(), ReadCommand(), ReadLine(), and RunInstance().

{
    static TCHAR default_pr[] = _T("$P$G");
    TCHAR  szPrompt[256];
    LPTSTR pr;

    if (GetEnvironmentVariable (_T("PROMPT"), szPrompt, 256))
        pr = szPrompt;
    else
        pr = default_pr;

    while (*pr)
    {
        if (*pr != _T('$'))
        {
            ConOutChar (*pr);
        }
        else
        {
            pr++;

            switch (_totupper (*pr))
            {
                case _T('A'):
                    ConOutChar (_T('&'));
                    break;

                case _T('B'):
                    ConOutChar (_T('|'));
                    break;

                case _T('C'):
                    ConOutChar (_T('('));
                    break;

                case _T('D'):
                    ConOutPrintf(_T("%s"), GetDateString());
                    break;

                case _T('E'):
                    ConOutChar (_T('\x1B'));
                    break;

                case _T('F'):
                    ConOutChar (_T(')'));
                    break;

                case _T('G'):
                    ConOutChar (_T('>'));
                    break;

                case _T('H'):
                    ConOutChar (_T('\x08'));
          ConOutChar (_T(' '));
          ConOutChar (_T('\x08'));
                    break;

                case _T('L'):
                    ConOutChar (_T('<'));
                    break;

                case _T('N'):
                    {
                        TCHAR szPath[MAX_PATH];
                        GetCurrentDirectory (MAX_PATH, szPath);
                        ConOutChar (szPath[0]);
                    }
                    break;

                case _T('P'):
                    {
                        TCHAR szPath[MAX_PATH];
                        GetCurrentDirectory (MAX_PATH, szPath);
                        ConOutPrintf (_T("%s"), szPath);
                    }
                    break;

                case _T('Q'):
                    ConOutChar (_T('='));
                    break;

        case _T('S'):
                    ConOutChar (_T(' '));
                    break;

                case _T('T'):
                    ConOutPrintf(_T("%s"), GetTimeString());
                    break;

                case _T('V'):
                    switch (osvi.dwPlatformId)
                    {
                        case VER_PLATFORM_WIN32_WINDOWS:
                            if (osvi.dwMajorVersion == 4 &&
                                osvi.dwMinorVersion == 1)
                                ConOutPrintf (_T("Windows 98"));
                            else
                                ConOutPrintf (_T("Windows 95"));
                            break;


                        case VER_PLATFORM_WIN32_NT:
                            ConOutPrintf (_T("Windows NT Version %lu.%lu"),
                                          osvi.dwMajorVersion, osvi.dwMinorVersion);
                            break;
                    }
                    break;

                case _T('_'):
                    ConOutChar (_T('\n'));
                    break;

                case '$':
                    ConOutChar (_T('$'));
                    break;

#ifdef FEATURE_DIRECTORY_STACK
                case '+':
                    {
                        INT i;
                        for (i = 0; i < GetDirectoryStackDepth (); i++)
                            ConOutChar (_T('+'));
                    }
                    break;
#endif
            }
        }
        pr++;
    }
}

Generated on Fri May 25 2012 04:44:43 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.