Пример #1
0
int infGetString(char *szDirectory)
{
    if ( szDirectory[0] == '\0' ){
        write_log(LT_BOTH,"Error: Please specify the source root path after '-s'\n");
        return 0;
    }

    get_path_or_filename(szDirectory);
    if ( is_a_valid_directory(szDirectory) == 0 )
        return 0;

    // init log file system which is used to record some error for get string
    if ( str_operate_init(szDirectory, NULL) == 0){
        write_log(LT_BOTH,"Error: Can't init 'get string' module!\n");
        return 0;
    }

    if ( db_init(0) == 0 ){
        write_log(LT_BOTH,"Error: Can't init 'database operation' module!\n");
        return 0;
    }

    write_log(LT_BOTH,"Current task:\n");
    write_log(LT_BOTH,"--------------------------------------------------------\n");
    write_log(LT_BOTH,"Get all chinese string from directory:\n\t'%s'\n", szDirectory);
    write_log(LT_BOTH,"The string will be inserted into translate database!\n");
    write_log(LT_BOTH,"--------------------------------------------------------\n\n");

    return start_work();
}
Пример #2
0
int main(int argc, const char *argv[])
{
    //capure http protocol packets from kernel

    //new_task(1, 1, start_work);
    //task_manage();

    start_work(NULL);
    return 0;
}
Пример #3
0
int main(int argc, char* argv[]) {
  if (argc < 2) {
    cout << "usage: client config_file.ini" << endl;
    return 1;
  }

  auto collector = createCollector(argv[1]);

  collector->start_session();
  collector->start_work();
  return 0;
}
Пример #4
0
void startThread(void *in)
{
	struct sockParams *sp = (struct sockParams *)in;
	start_work(sp->newsockfd);
}