Skip to content

Commit

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

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

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);
}

/////////////////////////////////
Loading

0 comments on commit 08c2c95

Please sign in to comment.