|SM_RDWR||Allow read/write open for storage files (default is false).|
|SM_PREOPEN||Open all storage files at startup time and keep them (default is false).|
The SMinit function calls the setup function for all of the configured methods based on SMsetup. This function should be called prior to all other storage API functions which begin with SM except SMsetup. It returns true if initialization is successful or returns false if not. SMinit returns true, unless all storage methods fail initialization.
The SMstore function stores an article specified with article. The headers and body of the article are supplied to SMstore using the iov and iovcnt members of ARTHANDLE. (data and private are ignored by SMstore.) If arrived is specified, SMstore uses its value as articles arrival time; otherwise SMstore uses the current time for it. SMstore returns the token type or returns TOKEN_EMPTY if the article is not stored because some error occurs or simply does not match any uwildmat(3) expression in storage.conf. SMstore fails if SM_RDWR has not been set to true with SMsetup.
The SMretrieve function retrieves an article specified with token. amount is the one of following which specifies retrieving type:
|RETR_ALL||Retrieve the whole article.|
|RETR_HEAD||Retrieve the headers of the article.|
|RETR_BODY||Retrieve the body of the article.|
|RETR_STAT||Just check to see if the article exists.|
The SMnext function is similar in function to SMretrieve except that it is intended for traversing the methods article store sequentially. To start a query, SMnext should be called with a NULL pointer ARTHANDLE. Then SMnext returns ARTHANDLE which should be used for the next query. If a NULL pointer ARTHANDLE is returned, no articles are left to be queried. If data of ARTHANDLE is NULL pointer or len of ARTHANDLE is 0, it indicates the article may be corrupted and should be cancelled by SMcancel. The data area indicated by ARTHANDLE should not be modified.
The SMfreearticle function frees all allocated memory used by SMretrieve and SMnext. If SMnext will be called with previously returned ARTHANDLE, SMfreearticle should not be called as SMnext frees allocated memory internally.
The SMcancel function removes the article specified with token. It returns true if cancellation is successful or returns false if not. SMcancel fails if SM_RDWR has not been set to true with SMsetup.
The SMprobe function checks the token on PROBETYPE. type is one of following:
|SELFEXPIRE||Check to see if the method of the token has self expire functionality.|
|SMARTNGNUM||Get the newsgroup name and the article number of the token.|
|EXPENSIVESTAT||Check to see whether checking the existence of an article is expensive or not.|
The SMflushcacheddata function flushes cached data on each storage method. type is one of following:
|SM_HEAD||Flush cached header.|
|SM_CANCELLEDART||Flush the articles which should be cancelled.|
|SM_ALL||Flush all cached data.|
The SMshutdown function calls the shutdown for each configured storage method and then frees any resources it has allocated for itself.
SMerrno and SMerrorstr indicate the reason of the last error concerning storage manager.
OVopen calls the setup function for configured method which is specified as ovmethod in inn.conf. mode is constructed from following:
|OV_READ||Allow read open for the overview method.|
|OV_WRITE||Allow write open for the overview method.|
The OVctl function probes or sets some parameters for the overview method. type is one of following:
|OVGROUPBASEDEXPIRE||Setup how group-based expiry is done.|
|OVCUTOFFLOW||Do not add overview data if the data is under the lowest article.|
|OVSORT||Probe which key is suitable for the overview method.|
|OVSPACE||Probe the overview space usage.|
|OVSTATALL||Stat all the articles when OVexpiregroup is called.|
|OVSTATICSEARCH||Setup if results of OVsearch are stored in a static buffer and must be copied before the next call to OVsearch.|
|OVCACHEKEEP||Setup whether the cache should be kept.|
|OVCACHEFREE||Free the cache.|
The OVgroupadd function informs the overview method that the specified newsgroup is being added.
The OVgroupdel function informs the overview method that the specified newsgroup is being removed.
The OVadd function stores an overview data.
The OVcancel function requests the overview method delete overview data specified with token.
The OVopensearch function requests the overview method prepare overview data retrieval. The request range is determined by low and high. The setting of OVSTATICSEARCH determines how search result data must be handled. (Note that with some storage methods, each call to OVopensearch may cause internal storage to be remapped. Therefore, multiple simultaneous searches may require data to be copied in between OVsearch calls even if OVSTATICSEARCH is false.)
The OVsearch function retrieves information, article number, overview data, or arrival time. It should be called with NULL handle when it is the first time; subsequent OVsearch calls should use the handle returned by the previous call to OVsearch. OVsearch returns true, unless it reaches high, which is specified by OVopensearch. Retrieved overview data are sorted by article number, and len is 0 if there is no overview data for the article. Note that the retrieved data is not necessarily null-terminated; you should only rely on len octets of overview data being present.
The OVclosesearch function frees all resources which have been allocated by OVopensearch.
The OVgetartinfo function retrieves the overview data and the token specified with artnum.
The OVexpiregroup function expires the overview data for the newsgroup. It checks the existence of the article and purges the overview data if the article no longer exists. If groupbaseexpiry in inn.conf is true, OVexpiregroup also expires articles.
The OVclose function frees all resources which are used by the overview method.
Written by Katsuhiro Kondou <email@example.com> for InterNetNews. Converted to POD by Julien Elie.
$Id: libstorage.pod 9073 2010-05-31 19:00:23Z iulius $
expire(8), fastrm(8), inn.conf(5), storage.conf(5).
|INN 2.6.0||LIBSTORAGE (3)||2015-09-12|