Example #1
0
int p_map(char* text, int* consumed){
	char* map;  // declarations
	char* check = tokenize(text, consumed, "\x1" "s", &map);
	if (!check) return 0;

	return map_cmd(map);
}
Example #2
0
void bf_map_cmd(bf_t *bf, const char **s)
{
  int i;
  bg_t *bg;
  map_cmd(s);
  
  bf_Log(bf, "Map: exclude=%d from=%ld to=%ld map=%ld", is_exclude, range_from, range_to, map_to);
  
  for( i = 0; i < bf->glyph_cnt; i++ )
  {
    bg = bf->glyph_list[i];
    if ( bg->encoding >= range_from && bg->encoding <= range_to )
    {
      if ( is_exclude != 0 )
      {
	bg->map_to = -1;
      }
      else
      {
	bg->map_to = bg->encoding - range_from + map_to;
      }
    }
  }
  
}
Example #3
0
/*
 * rebuild -- rebuilds hashmap and measures execution time
 */
static void
rebuild(void)
{
	printf("rebuild ");
	fflush(stdout);
	time_t t1 = time(NULL);

	map_cmd(mapc, map, HASHMAP_CMD_REBUILD, 0);

	printf("%lus\n", time(NULL) - t1);
}