Esempio n. 1
0
static uint16_t
menu_get_num_rows(MenuLayer *menu_layer, uint16_t section_index, void *callback_context)
{
  user_data *ud = callback_context;
  uint16_t count = token_count();
  
  layer_set_hidden(menu_layer_get_layer(ud->ml), count == 0);
  layer_set_hidden(text_layer_get_layer(ud->tl), count != 0);
  return count;
}
Esempio n. 2
0
File: q3.c Progetto: Brahmdeepj/3370
void *consumer_thread(void *arg){

  char buffer[INPUT_SIZE];
  int i = (int)arg;
  int count;
  char *input_line = take(i);
  while(strcmp(input_line, SHUTDOWN) != 0){
    char_count[i] += strlen(input_line);
    count = token_count(input_line, DELIMS);
    word_count[i] += count;
    free(input_line);
    input_line = take(i);
  }
  pthread_exit(NULL);
} // end consumer_thread
Esempio n. 3
0
PyObject *
py_token_count (PyObject *self, PyObject *args)
{
    return PyInt_FromLong (token_count ());
}