"NANIKA"
Documents - Head Line Sensor -


Abstract

Embryo can get and shows headlines of the sites of your preferences.

If you make a suitable directory under "plugin" directory, and place all required files into there, you can shows the site name of the plugin which is get the headlines from, in the "headline sensor" submenu under the main menu.
home
  +-plugin
      +-techside
          +-techside.dll
          +-descript.txt
          +-banner.png

HEADLINE/1.1

The bodies of the headline sensor are two files, a configuration file named "descript.txt", and a DLL file to export the execute function.
  • descript.txt
    name,TECHSIDE
    dllname,techside.dll
    host,www.iris.dti.ne.jp
    path,/~spec/news2/bbsf.html
        
    The "name" entry is the name of the site. It is used in the menu, etc.
    The "dll" entry is the name of the dll file that is used as a plugin.
    The "host" entry is the host name of the site that has files gotten by the plugin.
    The "path" entry is the relative path to the file to read.
  • DLL
    extern "C" __declspec(dllexport) HGLOBAL __cdecl getversion(long *len);
    function getversion(var len: longint): hglobal; cdecl; export;
        
    Just after loading the DLL file, this function is called at first before other functions are imported. The plugin for the headline sensor MUST return 12byte-strings as "HEADLINE/1.1".
    extern "C" __declspec(dllexport) HGLOBAL __cdecl execute(HGLOBAL h, long *len);
    function execute(h: hglobal; var len: longint): hglobal; cdecl; export;
        
    The function "execute" is called just after downloading the designated file, and the full-path of the file is given by "gmem_fixed" as the argument. This file certainly exists. The dll files must read the file using the given path, and make the headline, and finally return this headline data using "gmem_fixed".

    The return value is NOT the fragments of the sakura script. Thus, you can not use tags, etc. You must format the strings into the complete plain text with CR+LF as the code of line feed.

    The text formatting is free. But generally it is formatted as follows.
    - Headline0[CR+LF]- Headline1[CR+LF]- Headline2[CR+LF]....
        
    The headline sensor MUST NOT return the formatted headline text which includes more than 10 lines (which includes more than 10 CR+LF codes).

    When the process is completed successfully but the headline data is not exists, you must return empty string data.

    When the process is uncompleted with various errors undoubtedly, i.e. mistaken the formatting or the target file has different html structure, etc, you must return value 0 without allocation memory. If the value 0 returns, embryo interpret this value as some error occurs, and give the notice of "analyze uncompleted" to users.
    The following functions are called when .dll file is load or unload.
    extern "C" __declspec(dllexport) BOOL __cdecl load(HGLOBAL h, long len);
    function load(h: thandle; len: longint): boolean; export; cdecl;
    
    extern "C" __declspec(dllexport) BOOL __cdecl unload();
    function unload: boolean; export; cdecl;
        
    The first argument of function "load" is the directory path to the headline sensor DLL. If it has its own data, you must get the current directory path from the first argument, and make data files, if necessary. (You must put whole files for headline sensor DLL into its own directory.)

    And you must be cautious with that you must release the handle if the directory path is not necessary.
    The return value is boolean, but embryo does not currently refer this value.(Embryo keeps processing whatever values returned.)

return to homepage

This page is based on phase 102.00 (2001/09/01)
This page was translated by:Hiro with SERIKO
Published by:Yoshiyuki.Sakakibara