add: endpoint /tags
fix: leaks from config (now using static length for config strings)
This commit is contained in:
		
							parent
							
								
									0f1cd9c02c
								
							
						
					
					
						commit
						a78815cb32
					
				
					 10 changed files with 147 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -25,15 +25,15 @@ typedef enum
 | 
			
		|||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
    char *file;
 | 
			
		||||
    char *database;
 | 
			
		||||
    char database[256];
 | 
			
		||||
    log_level_t log_level;
 | 
			
		||||
    run_type_t run_type;
 | 
			
		||||
    char server_port[6];
 | 
			
		||||
    uint16_t discovery_port;
 | 
			
		||||
    char *not_found_file;
 | 
			
		||||
    char *not_found_file_type;
 | 
			
		||||
    char *not_found_content;
 | 
			
		||||
    char *not_found_content_type;
 | 
			
		||||
    char not_found_file[256];
 | 
			
		||||
    char not_found_file_type[256];
 | 
			
		||||
    char not_found_content[256];
 | 
			
		||||
    char not_found_content_type[256];
 | 
			
		||||
    struct mg_serve_http_opts http_server_opts;
 | 
			
		||||
} config_t;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										9
									
								
								include/endpoints/api_v1_tags.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								include/endpoints/api_v1_tags.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
#ifndef CORE_ENDPOINTS_API_V1_TAGS_H
 | 
			
		||||
#define CORE_ENDPOINTS_API_V1_TAGS_H
 | 
			
		||||
 | 
			
		||||
#include <router.h>
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
api_v1_tags_GET(struct mg_connection *nc, struct http_message *hm, endpoint_args_t *args, endpoint_response_t *response);
 | 
			
		||||
 | 
			
		||||
#endif /* CORE_ENDPOINTS_API_V1_TAGS_H */
 | 
			
		||||
| 
						 | 
				
			
			@ -10,8 +10,10 @@ tag_remove(int id);
 | 
			
		|||
char*
 | 
			
		||||
tag_get_tag(int id);
 | 
			
		||||
 | 
			
		||||
char**
 | 
			
		||||
tag_get_all();
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
tag_get_id(const char* tag);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* CORE_MODELS_TAG_H */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue