示例#1
0
文件: server_main.cpp 项目: manut/TAO
int
parse_args (int argc, ACE_TCHAR *argv[])
{
  ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("p:o:"));
  int c;

  proc_mode_str.set (ACE_TEXT ("LOCAL_AND_REMOTE"));

  while ((c = get_opts ()) != -1)
  {
    switch (c)
      {
      case 'p':
        proc_mode_str.set (get_opts.opt_arg ());
        break;
      case 'o':
        output = get_opts.opt_arg ();
        break;
      case '?':
      default:
       return 0;
      }
  }
  // Indicates successful parsing of the command line
  return 0;
}
示例#2
0
// Parse the command-line arguments and set options.
static void
parse_args (int argc, ACE_TCHAR *argv[])
{
    ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("c:n:p:"));

    mutex_name.set (ACE_TEXT ("RW_Process_Mutex_Test.lock"));    // Default name
    int c;
    while ((c = get_opt ()) != -1)
        switch (c)
        {
        case 'c':
            child_nr = ACE_OS::atoi (get_opt.opt_arg ());
            break;
        case 'n':
            mutex_name.set (get_opt.opt_arg ());
            break;
        case 'p':
            reporting_port = (u_short)ACE_OS::atoi (get_opt.opt_arg ());
            break;
        default:
            print_usage_and_die ();
            break;
        }

    // Now that the mutex name is known, set up the checker file name.
    ACE_OS::strncpy (mutex_check, mutex_name.c_str (), MAXPATHLEN);
    ACE_OS::strncat (mutex_check, ACE_TEXT ("_checker"), MAXPATHLEN);
}
示例#3
0
int
ACE_Capabilities::getline (FILE *fp, ACE_TString &line)
{
  int ch;

  line.set (0, 0);

  while ((ch = ACE_OS::fgetc (fp)) != EOF && ch != ACE_TEXT ('\n'))
    line += (ACE_TCHAR) ch;

  if (ch == EOF && line.length () == 0)
    return -1;
  else
    return 0;
}