Makewebpage

Generate a webpage

The command line tool makewebpage.exe recursively scans a directory and all its subdirectories for possible web contents and converts it to static char arrays.

Installation

Copy the Windows executable makewebpage.exe (makewebpagef28.exe for F28x DSPs) to your PC and add this directory to your environment path variable or use setup_makewebpage.exe (setup_makewebpagef28.exe for F28x DSPs) from the utilities directory. setup_makewebpage.exe is executed automatically, if you use a D.SignT installer for the netlib support SW.

Parameters

Four options control the output

>makewebpage.exe -ooutfilename -dDATASECTION -pPath -z

If the outfilename is not specified, makewebpage uses by default "webpage" as outfilename. Example call:

makeweb2.jpg

Two files are generated (default option for outfilename assumed):

webpage.c

webpage.c contains a static char array and a direntry_type structure for each found web element. E.g. the dicon.gif file from the HTTP server examples will be converted to

#pragma DATA_SECTION(dicon_gif, ".sdram")
static char dicon_gif[] = {
0x1f,0x8b,0x08,0x08,0x5a,0xda,0x6d,0x3e,0x02,0x00,0x64,0x69,0x63,0x6f,0x6e,0x2e,
0x67,0x69,0x66,0x00,0x73,0xf7,0x74,0xb3,0xb0,0x4c,0x14,0x60,0x10,0x60,0xd8,0xcc,
0x00,0x02,0x0d,0x60,0xdc,0x00,0xa6,0x1a,0xc0,0xac,0x03,0x07,0x0e,0x34,0x34,0x34,
0xfc,0x07,0x0a,0xfc,0x67,0xf8,0x0f,0xa6,0xfe,0x83,0x59,0x40,0xa0,0xf8,0x93,0x05,
0xac,0x49,0x07,0x44,0x80,0xcc,0x60,0x66,0x71,0x9a,0x70,0xd2,0x73,0xf5,0xde,0xaf,
0x2f,0xff,0xf2,0x5d,0x73,0xaf,0x68,0x98,0xde,0xe6,0xf3,0xb8,0x30,0x4c,0x91,0x69,
0xc1,0xc2,0xab,0xfb,0x26,0x79,0x1c,0x7e,0xd7,0xd2,0x52,0xbe,0xf6,0xde,0x6e,0xe7,
0x7e,0xc3,0xcb,0x1f,0x23,0xec,0x67,0x08,0x74,0x66,0xb0,0x4d,0x96,0x9d,0x9f,0xe1,
0x65,0xed,0xe7,0x6a,0xe9,0x39,0x99,0xed,0x45,0x55,0x7b,0x2c,0x8f,0x1a,0x13,0x83,
0x35,0x00,0x2a,0x48,0xdd,0xcc,0x95,0x00,0x00,0x00};
direntry_type dicon = {"dicon.gif","dicon.gif",sizeof(dicon_gif),FTP_RW|FTP_RAM|HTTP_GZIP,'B',(uint32_t)dicon_gif};

After the generation process is finished the file webpage.c must be included in your main application to add the webpage content to your project.

Option -dDATASECTION controls the preprocessor #pragma DATA_SECTION directive before each array. Make sure this section exists in your linker command file.

Option -pPath specifies a search path for the web contents

Use option -z for previously gzip compressed files. The file name must be identical to the original uncompressed file.

Converted Files

Converted files in the webpage directories are:

  • *.html
  • *.htm
  • *.shtml
  • *.css
  • *.cgi
  • *.js
  • *.png
  • *.jpg
  • *.jpeg
  • *.bmp
  • *.gif
  • *.ico
  • *.class

webpage.gen

The second generated file webpage.gen contains a list of all generated web elements and pages including the webserver identifier name "webserver". E.g.:

#pragma DATA_SECTION(user, ".sdram")
/*******************************************************************************
user_type: used for creating a directory list for webserver. The passwordfree
username 'webserver' is the keyword for the HTTP-server to access all pages.
The first directory entry is the default webpage.
*******************************************************************************/
{"webserver", "*" ,&dicon,&e400,&e401,&e404,&e501,&favicon,&index,&secure,&test,0},
0 /* don't forget a final zero! */
};

This file may be included in your application or the user_type structure may be defined manually in your code when a different sequence of pages is required. The first entry (&dicon in the example above) is the default webpage. If another page is required as default or index page, use function http_set_index_page().