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

INT cmd_call ( LPTSTR  param)

Definition at line 38 of file call.c.

{
    TCHAR line[CMDLINE_LENGTH + 1];
    TCHAR *first;
    BOOL bInQuote = FALSE;

    TRACE ("cmd_call: (\'%s\')\n", debugstr_aw(param));
    if (!_tcsncmp (param, _T("/?"), 2))
    {
        ConOutResPaging(TRUE,STRING_CALL_HELP);
        return 0;
    }

    /* Do a second round of %-variable substitutions */
    if (!SubstituteVars(param, line, _T('%')))
        return nErrorLevel = 1;

    /* Find start and end of first word */
    first = line;
    while (_istspace(*first))
        first++;

    for (param = first; *param; param++)
    {
        if (!bInQuote && (_istspace(*param) || _tcschr(_T(",;="), *param)))
            break;
        bInQuote ^= (*param == _T('"'));
    }

    /* Separate first word from rest of line */
    memmove(param + 1, param, (_tcslen(param) + 1) * sizeof(TCHAR));
    *param++ = _T('\0');

    if (*first == _T(':') && (bc))
    {
        /* CALL :label - call a subroutine of the current batch file */
        while (*param == _T(' '))
            param++;
        nErrorLevel = Batch(bc->BatchFilePath, first, param, NULL);
        return nErrorLevel;
    }

    nErrorLevel = DoCommand(first, param, NULL);
    return nErrorLevel;
}

Generated on Sun May 27 2012 04:45:36 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.