deps/kb_meme/meme-5.0.1/src/html-monolith.c
/*
 * Echo the file to the dest
 */
Echo the file to the dest
Echo the file to the dest
static void echo_file(HTMLWR_T* htmlwr, bool is_style, char *secondary_source) {
  char buffer[CHUNK];
  size_t size_read;
  char *src_path;
  FILE *src_file;
  src_path = make_path_to_file(htmlwr->search_dir, secondary_source);
  src_file = fopen(src_path, "r");
  if (src_file) {
    fprintf(htmlwr->dest, "%s\n", (is_style ? STYLE_OPEN : SCRIPT_OPEN));
    while ((size_read = fread(buffer, sizeof(char), CHUNK, src_file)) != 0) {
      fwrite(buffer, sizeof(char), size_read, htmlwr->dest);
    }
    fclose(src_file);
    fprintf(htmlwr->dest, "\n    %s", (is_style ? STYLE_CLOSE : SCRIPT_CLOSE));
  } else {
    fprintf(stderr, "Can not open included file \"%s\".\n", src_path);
  }
  free(src_path);
}
static void echo_file ( HTMLWR_T * htmlwr , bool is_style , char * secondary_source ) { char buffer [ CHUNK ] ; size_t size_read ; char * src_path ; FILE * src_file ; src_path = make_path_to_file ( htmlwr -> search_dir , secondary_source ) ; src_file = fopen ( src_path , " " ) ; if ( src_file ) { fprintf ( htmlwr -> dest , " \n " , ( is_style ? STYLE_OPEN : SCRIPT_OPEN ) ) ; while ( ( size_read = fread ( buffer , sizeof ( char ) , CHUNK , src_file ) ) != 0 ) { fwrite ( buffer , sizeof ( char ) , size_read , htmlwr -> dest ) ; } fclose ( src_file ) ; fprintf ( htmlwr -> dest , " \n " , ( is_style ? STYLE_CLOSE : SCRIPT_CLOSE ) ) ; } else { fprintf ( stderr , " \" \" \n " , src_path ) ; } free ( src_path ) ; }
Echo the file to the dest
Echo the file to the dest
// can't find it, issue a warning