Mercurial > urweb
comparison src/c/urweb.c @ 740:b302b6e35f93
Add MIME type to file
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 25 Apr 2009 14:47:16 -0400 |
parents | 4bb7e1c0550a |
children | f7e2026dd5ae |
comparison
equal
deleted
inserted
replaced
739:4bb7e1c0550a | 740:b302b6e35f93 |
---|---|
630 | 630 |
631 switch (ctx->inputs[n].kind) { | 631 switch (ctx->inputs[n].kind) { |
632 case UNSET: | 632 case UNSET: |
633 { | 633 { |
634 char *data = uw_malloc(ctx, 0); | 634 char *data = uw_malloc(ctx, 0); |
635 uw_Basis_file f = {"", {0, data}}; | 635 uw_Basis_file f = {NULL, "", {0, data}}; |
636 return f; | 636 return f; |
637 } | 637 } |
638 case FIL: | 638 case FIL: |
639 return ctx->inputs[n].data.file; | 639 return ctx->inputs[n].data.file; |
640 case NORMAL: | 640 case NORMAL: |
2126 | 2126 |
2127 uw_Basis_string uw_Basis_fileName(uw_context ctx, uw_Basis_file f) { | 2127 uw_Basis_string uw_Basis_fileName(uw_context ctx, uw_Basis_file f) { |
2128 return f.name; | 2128 return f.name; |
2129 } | 2129 } |
2130 | 2130 |
2131 uw_Basis_string uw_Basis_fileMimeType(uw_context ctx, uw_Basis_file f) { | |
2132 return f.type; | |
2133 } | |
2134 | |
2131 uw_Basis_blob uw_Basis_fileData(uw_context ctx, uw_Basis_file f) { | 2135 uw_Basis_blob uw_Basis_fileData(uw_context ctx, uw_Basis_file f) { |
2132 return f.data; | 2136 return f.data; |
2133 } | 2137 } |