mirror of
				https://github.com/fumiama/C302.git
				synced 2025-11-04 04:45:07 +09:00 
			
		
		
		
	优化类型名
This commit is contained in:
		
							parent
							
								
									a4a53d8a31
								
							
						
					
					
						commit
						a813727662
					
				
							
								
								
									
										2
									
								
								c302.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								c302.c
									
									
									
									
									
								
							@ -6,7 +6,7 @@
 | 
			
		||||
#include <time.h>
 | 
			
		||||
#include "c302.h"
 | 
			
		||||
 | 
			
		||||
static void http_error(ERRCODE code, char* msg) {
 | 
			
		||||
static void http_error(errcode_enum_t code, char* msg) {
 | 
			
		||||
    uint32_t len = strlen(msg) + typel[code];
 | 
			
		||||
    char* str = malloc(len);
 | 
			
		||||
    sprintf(str, types[code], msg);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								c302.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								c302.h
									
									
									
									
									
								
							@ -14,8 +14,8 @@
 | 
			
		||||
#define H500 "HTTP/1.0 500 Internal Server Error\r\nContent-Type: text/html\r\n\r\n<P>%s\r\n"
 | 
			
		||||
const char* types[] = {H400, H404, H500};
 | 
			
		||||
const uint8_t typel[] = {59, 111, 69};
 | 
			
		||||
enum ERRCODE {HTTP400, HTTP404, HTTP500};
 | 
			
		||||
typedef enum ERRCODE ERRCODE;
 | 
			
		||||
enum errcode_enum_t {HTTP400, HTTP404, HTTP500};
 | 
			
		||||
typedef enum errcode_enum_t errcode_enum_t;
 | 
			
		||||
 | 
			
		||||
static const char* urls[] = {
 | 
			
		||||
    "https://bocchi.rocks/assets/img/page/character/hitori/main.png",   // 後藤ひとり
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user