> Main > Products and Services > Purchase > Company
English / Russian

Documentation

CNSearch 1.5.1

© "CN-Software" Ltd. 2002-2008
support@cn-software.com
www.cn-software.com
Previous | Table of Contents  | Next

Creating Plugin

To create a plugin, you should unpack 'plugin.zip', located in '/manual' folder of the distribution kit. This file contains the source code of the plugin processing test files.

For correct functioning, plugin must have a correct extension and possess the following set of functions:

Name of a function

Description of a function

char *get_info(void)

The function returns a string - information about plugin (its name)

char *get_mime(void)

The function returns a string - list of MIME TYPEs, separated by vertical line "|" and processed by this plugin;

char* get_shortdesc(void)

The function returns a string - short name of a file type

char* get_range(void)

The function returns a string - field "Range" of HTTP header (see RFC2068); if field "Range" is not used, the function returns NULL.

char* get_title(void)

The function returns a string - document title. If value is NULL, URL of the document is displayed.

TPluginWord* get_word(unsigned char *d, unsigned long filesize) The main function returns a pointer to 'TpluginWord' structure, containing a word which should be added to the search index. This function must return words contained in a document in series.

  • d - pointer to the document being indexed. The document ends with code \0x0;
  • filesize - size of the document being indexed. It is used if the document contains code \0x0 (for example, Microsoft Word Document)

TpluginWord structure looks as follows:

typedef struct {

char word[32];

int rel;

bool end;

} TPluginWord;

where:

Methods, used by the system for generation of plugin functions:


Previous | Table of Contents  | Next