OSDN Git Service

update libMiMic
[mimic/MiMicSDK.git] / lib / src / http / NyLPC_cMimeType.c
index 176ef98..4799cbf 100644 (file)
@@ -1,36 +1,36 @@
 #include <stdio.h>\r
 #include "NyLPC_cMimeType.h"\r
 struct TMimeTypeTable{\r
-       const char* ext;\r
-       const char* mimetype;\r
+    const char* ext;\r
+    const char* mimetype;\r
 };\r
 const static struct TMimeTypeTable table[]=\r
 {\r
-       {"zip" ,"application/zip"},\r
-       {"js"  ,"application/x-javascript"},\r
-       {"txt" ,"text/plain"},\r
-       {"html","text/html"},\r
-       {"htm","text/html"},\r
-       {"css" ,"text/css"},\r
-       {"jpeg","image/jpeg"},\r
-       {"jpg" ,"image/jpeg"},\r
-       {"png" ,"image/png"},\r
-       {"gif" ,"image/gif"},\r
-       {NULL,NULL}\r
+    {"zip" ,"application/zip"},\r
+    {"js"  ,"application/x-javascript"},\r
+    {"txt" ,"text/plain"},\r
+    {"html","text/html"},\r
+    {"htm","text/html"},    \r
+    {"css" ,"text/css"},\r
+    {"jpeg","image/jpeg"},\r
+    {"jpg" ,"image/jpeg"},\r
+    {"png" ,"image/png"},\r
+    {"gif" ,"image/gif"},\r
+    {NULL,NULL}\r
 };\r
 const static char* default_mimetype="application/octet-stream";\r
 \r
 const char* NyLPC_cMiMeType_getFileName2MimeType(const char* i_file_name)\r
 {\r
-       int i;\r
-       const char* p=strrchr(i_file_name,'.');\r
-       if(p==NULL){\r
-               return default_mimetype;\r
-       }\r
-       for(i=0;table[i].ext!=NULL;i++){\r
-               if(NyLPC_stricmp(table[i].ext,p+1)==0){\r
-                       return table[i].mimetype;\r
-               }\r
-       }\r
-       return default_mimetype;\r
+    int i;\r
+    const char* p=strrchr(i_file_name,'.');\r
+    if(p==NULL){\r
+        return default_mimetype;\r
+    }\r
+    for(i=0;table[i].ext!=NULL;i++){\r
+        if(NyLPC_stricmp(table[i].ext,p+1)==0){\r
+            return table[i].mimetype;\r
+        }\r
+    }\r
+    return default_mimetype;\r
 }\r