tag: no CamelCase
Renamed functions and variables.
This commit is contained in:
		
							
								
								
									
										16
									
								
								src/tag.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/tag.c
									
									
									
									
									
								
							@@ -62,7 +62,7 @@ const char *tag_item_names[TAG_NUM_OF_ITEM_TYPES] = {
 | 
				
			|||||||
	[TAG_MUSICBRAINZ_TRACKID] = "MUSICBRAINZ_TRACKID",
 | 
						[TAG_MUSICBRAINZ_TRACKID] = "MUSICBRAINZ_TRACKID",
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int8_t ignoreTagItems[TAG_NUM_OF_ITEM_TYPES];
 | 
					int8_t ignore_tag_items[TAG_NUM_OF_ITEM_TYPES];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static size_t items_size(const struct tag *tag)
 | 
					static size_t items_size(const struct tag *tag)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -80,14 +80,14 @@ void tag_lib_init(void)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/* parse the "metadata_to_use" config parameter below */
 | 
						/* parse the "metadata_to_use" config parameter below */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	memset(ignoreTagItems, 0, TAG_NUM_OF_ITEM_TYPES);
 | 
						memset(ignore_tag_items, 0, TAG_NUM_OF_ITEM_TYPES);
 | 
				
			||||||
	ignoreTagItems[TAG_ITEM_COMMENT] = 1;	/* ignore comments by default */
 | 
						ignore_tag_items[TAG_ITEM_COMMENT] = 1;	/* ignore comments by default */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	value = config_get_string(CONF_METADATA_TO_USE, NULL);
 | 
						value = config_get_string(CONF_METADATA_TO_USE, NULL);
 | 
				
			||||||
	if (value == NULL)
 | 
						if (value == NULL)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	memset(ignoreTagItems, 1, TAG_NUM_OF_ITEM_TYPES);
 | 
						memset(ignore_tag_items, 1, TAG_NUM_OF_ITEM_TYPES);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (0 == strcasecmp(value, "none"))
 | 
						if (0 == strcasecmp(value, "none"))
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -100,7 +100,7 @@ void tag_lib_init(void)
 | 
				
			|||||||
			*s = '\0';
 | 
								*s = '\0';
 | 
				
			||||||
			for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
 | 
								for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
 | 
				
			||||||
				if (strcasecmp(c, tag_item_names[i]) == 0) {
 | 
									if (strcasecmp(c, tag_item_names[i]) == 0) {
 | 
				
			||||||
					ignoreTagItems[i] = 0;
 | 
										ignore_tag_items[i] = 0;
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
@@ -453,15 +453,15 @@ tag_add_item_internal(struct tag *tag, enum tag_type type,
 | 
				
			|||||||
	g_free(p);
 | 
						g_free(p);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void tag_add_item_n(struct tag *tag, enum tag_type itemType,
 | 
					void tag_add_item_n(struct tag *tag, enum tag_type type,
 | 
				
			||||||
		    const char *value, size_t len)
 | 
							    const char *value, size_t len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (ignoreTagItems[itemType])
 | 
						if (ignore_tag_items[type])
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!value || !len)
 | 
						if (!value || !len)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	tag_add_item_internal(tag, itemType, value, len);
 | 
						tag_add_item_internal(tag, type, value, len);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								src/tag.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/tag.h
									
									
									
									
									
								
							@@ -65,7 +65,7 @@ struct tag *tag_new(void);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void tag_lib_init(void);
 | 
					void tag_lib_init(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void tag_clear_items_by_type(struct tag *tag, enum tag_type itemType);
 | 
					void tag_clear_items_by_type(struct tag *tag, enum tag_type type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void tag_free(struct tag *tag);
 | 
					void tag_free(struct tag *tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -83,13 +83,13 @@ void tag_begin_add(struct tag *tag);
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
void tag_end_add(struct tag *tag);
 | 
					void tag_end_add(struct tag *tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void tag_add_item_n(struct tag *tag, enum tag_type itemType,
 | 
					void tag_add_item_n(struct tag *tag, enum tag_type type,
 | 
				
			||||||
		    const char *value, size_t len);
 | 
							    const char *value, size_t len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void tag_add_item(struct tag *tag, enum tag_type itemType,
 | 
					static inline void
 | 
				
			||||||
				const char *value)
 | 
					tag_add_item(struct tag *tag, enum tag_type type, const char *value)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	tag_add_item_n(tag, itemType, value, strlen(value));
 | 
						tag_add_item_n(tag, type, value, strlen(value));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct tag *tag_dup(const struct tag *tag);
 | 
					struct tag *tag_dup(const struct tag *tag);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <stdint.h>
 | 
					#include <stdint.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern int8_t ignoreTagItems[TAG_NUM_OF_ITEM_TYPES];
 | 
					extern int8_t ignore_tag_items[TAG_NUM_OF_ITEM_TYPES];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,7 @@ void tag_print_types(struct client *client)
 | 
				
			|||||||
	int i;
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
 | 
						for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) {
 | 
				
			||||||
		if (ignoreTagItems[i] == 0)
 | 
							if (ignore_tag_items[i] == 0)
 | 
				
			||||||
			client_printf(client, "tagtype: %s\n",
 | 
								client_printf(client, "tagtype: %s\n",
 | 
				
			||||||
				      tag_item_names[i]);
 | 
									      tag_item_names[i]);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user