Lines Matching defs:filename
116 int process_file(FILE *data_file, FILE *struct_file, const char *filename);
117 int file_write_http_header(FILE *data_file, const char *filename, int file_size, u16_t *http_hdr_len,
124 static int ext_in_list(const char* filename, const char *ext_list);
125 static int file_to_exclude(const char* filename);
126 static int file_can_be_compressed(const char* filename);
158 printf(" Usage: htmlgen [targetdir] [-s] [-e] [-11] [-nossi] [-ssi:<filename>] [-c] [-f:<filename>] [-m] [-svr:<name>] [-x:<ext_list>] [-xc:<ext_list>" USAGE_ARG_DEFLATE NEWLINE NEWLINE);
164 printf(" switch -ssi: ssi filename (ssi support controlled by file list, not by extension)" NEWLINE);
166 printf(" switch -f: target filename (default is \"fsdata.c\")" NEWLINE);
532 static u8_t *get_file_data(const char *filename, int *file_size, int can_be_compressed, int *is_compressed)
540 inFile = fopen(filename, "rb");
542 printf("Failed to open file \"%s\"\n", filename);
834 static int is_ssi_file(const char *filename)
845 strncat(curSubdir, filename, freelen - 1);
860 if (strstr(filename, g_pcSSIExtensions[loop])) {
869 static int ext_in_list(const char* filename, const char *ext_list)
879 size_t filename_size = strlen(filename);
884 if ((filename[filename_size - ext_size - 1] == '.') &&
885 !strncmp(&filename[filename_size - ext_size], ext, ext_size)) {
895 static int file_to_exclude(const char *filename)
897 return (exclude_list != NULL) && ext_in_list(filename, exclude_list);
900 static int file_can_be_compressed(const char *filename)
902 return (ncompress_list == NULL) || !ext_in_list(filename, ncompress_list);
905 int process_file(FILE *data_file, FILE *struct_file, const char *filename)
923 sprintf(qualifiedName, "%s/%s", curSubdir, filename);
948 is_ssi = is_ssi_file(filename);
953 can_be_compressed = includeHttpHeader && !is_ssi && file_can_be_compressed(filename);
954 file_data = get_file_data(filename, &file_size, can_be_compressed, &is_compressed);
956 file_write_http_header(data_file, filename, file_size, &http_hdr_len, &http_hdr_chksum, has_content_len, is_compressed);
1023 int file_write_http_header(FILE *data_file, const char *filename, int file_size, u16_t *http_hdr_len,
1045 if (strstr(filename, "404") == filename) {
1050 } else if (strstr(filename, "400") == filename) {
1055 } else if (strstr(filename, "501") == filename) {
1081 file_ext = filename;
1089 printf("failed to get extension for file \"%s\", using default.\n", filename);
1139 if (stat(filename, &stat_data) != 0) {
1140 printf("stat(%s) failed with error %d\n", filename, errno);