Skip to content

Commit

Permalink
Revert "Updated the sourcecode with astyle to reflect my current taste."
Browse files Browse the repository at this point in the history
This reverts commit 08c2c95.
  • Loading branch information
sahib committed Apr 23, 2014
1 parent 6c8fb09 commit f6800dd
Show file tree
Hide file tree
Showing 105 changed files with 7,293 additions and 6,214 deletions.
30 changes: 16 additions & 14 deletions lib/blacklist.c
Expand Up @@ -23,41 +23,43 @@

/////////////////////////////////

GHashTable *lookup_table = NULL;
gchar *blacklist_array[] = {
GHashTable * lookup_table = NULL;
gchar * blacklist_array[] =
{
"http://ecx.images-amazon.com/images/I/11J2DMYABHL.jpg", /* blank image */
"http://cdn.recordshopx.com/cover/normal/5/53/53138.jpg%3Fcd" /* blank image */
};

/////////////////////////////////

void blacklist_build(void)
void blacklist_build (void)
{
lookup_table = g_hash_table_new(g_str_hash, g_str_equal);
gint b_size = sizeof(blacklist_array) / sizeof(gchar *);
for(gint it = 0; it < b_size; it++) {
if(blacklist_array[it] != NULL) {
g_hash_table_insert(lookup_table, blacklist_array[it], blacklist_array[it]);
lookup_table = g_hash_table_new (g_str_hash,g_str_equal);
gint b_size = sizeof (blacklist_array) / sizeof (gchar *);
for (gint it = 0; it < b_size; it++)
{
if (blacklist_array[it] != NULL)
{
g_hash_table_insert (lookup_table,blacklist_array[it],blacklist_array[it]);
}
}
}

/////////////////////////////////

void blacklist_destroy(void)
void blacklist_destroy (void)
{
g_hash_table_destroy(lookup_table);
g_hash_table_destroy (lookup_table);
}

/////////////////////////////////

gboolean is_blacklisted(gchar *URL)
gboolean is_blacklisted (gchar * URL)
{
if(lookup_table == NULL || URL == NULL) {
if (lookup_table == NULL || URL == NULL)
return FALSE;
}

return !(g_hash_table_lookup(lookup_table, URL) == NULL);
return ! (g_hash_table_lookup (lookup_table,URL) == NULL);
}

/////////////////////////////////

0 comments on commit f6800dd

Please sign in to comment.