Exemplo n.º 1
0
int cmd_search(int argc, char **argv)
{
  char query[1024];
  int i;

  if (argc < 2) {
    search_usage();
    return -1;
  }

  query[0] = 0;
  for(i = 1; i < argc; i++)
    snprintf(query + strlen(query), sizeof(query) - strlen(query), "%s%s",
       i == 1 ? "" : " ", argv[i]);

  sp_search_create(g_session, query, 0, 100, 0, 100, 0, 100, &search_complete, NULL);
  return 0;
}
Exemplo n.º 2
0
int cmd_search(int argc, char **argv)
{
        char query[1024];
        int i;

        if (argc < 2) {
                search_usage();
                return -1;
        }

        query[0] = 0;
        for(i = 1; i < argc; i++)
                snprintf(query + strlen(query), sizeof(query) - strlen(query), "%s%s",
                         i == 1 ? "" : " ", argv[i]);
#ifdef USE_MYSQL
                _mysql_updateStats(g_conn, "search");
#endif
        sp_search_create(g_session, query, 0, 100, 0, 100, 0, 100, &search_complete, NULL);
        return 0;
}