⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cabin.3

📁 harvest是一个下载html网页得机器人
💻 3
📖 第 1 页 / 共 3 页
字号:
The function `cbmapdup' is used in order to copy a map..TP.B CBMAP *cbmapdup(CBMAP *map);`map' specifies a map handle.  The return value is a new map handle.  The iterator of the source map is initialized..PPThe function `cbmapclose' is used in order to close a map handle..TP.B void cbmapclose(CBMAP *map);`map' specifies a map handle.  Because the region of a closed handle is released, it becomes impossible to use the handle..PPThe function `cbmapput' is used in order to store a record..TP.B int cbmapput(CBMAP *map, const char *kbuf, int ksiz, const char *vbuf, int vsiz, int over);`map' specifies a map handle.  `kbuf' specifies the pointer to the region of a key.  `ksiz' specifies the size of the region of the key.  If it is negative, the size is assigned with `strlen(kbuf)'.  `vbuf' specifies the pointer to the region of a value.  `vsiz' specifies the size of the region of the value.  If it is negative, the size is assigned with `strlen(vbuf)'.  `over' specifies whether the value of the duplicated record is overwritten or not.  If `over' is false and the key is duplicated, the return value is false, else, it is true..PPThe function `cbmapout' is used in order to delete a record..TP.B int cbmapout(CBMAP *map, const char *kbuf, int ksiz);`map' specifies a map handle.  `kbuf' specifies the pointer to the region of a key.  `ksiz' specifies the size of the region of the key.  If it is negative, the size is assigned with `strlen(kbuf)'.  If successful, the return value is true.  False is returned when no record corresponds to the specified key..PPThe function `cbmapget' is used in order to retrieve a record..TP.B const char *cbmapget(const CBMAP *map, const char *kbuf, int ksiz, int *sp);`map' specifies a map handle.  `kbuf' specifies the pointer to the region of a key.  `ksiz' specifies the size of the region of the key.  If it is negative, the size is assigned with `strlen(kbuf)'.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  If successful, the return value is the pointer to the region of the value of the corresponding record.  `NULL' is returned when no record corresponds.  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string..PPThe function `cbmapmove' is used in order to move a record to the edge..TP.B int cbmapmove(CBMAP *map, const char *kbuf, int ksiz, int head);`map' specifies a map handle.  `kbuf' specifies the pointer to the region of a key.  `ksiz' specifies the size of the region of the key.  If it is negative, the size is assigned with `strlen(kbuf)'.  `head' specifies the destination which is head if it is true or tail if else.  If successful, the return value is true.  False is returned when no record corresponds to the specified key..PPThe function `cbmapiterinit' is used in order to initialize the iterator of a map handle..TP.B void cbmapiterinit(CBMAP *map);`map' specifies a map handle.  The iterator is used in order to access the key of every record stored in a map..PPThe function `cbmapiternext' is used in order to get the next key of the iterator..TP.B const char *cbmapiternext(CBMAP *map, int *sp);`map' specifies a map handle.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  If successful, the return value is the pointer to the region of the next key, else, it is `NULL'.  `NULL' is returned when no record is to be get out of the iterator.  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.  The order of iteration is assured to be the same of the one of storing..PPThe function `cbmaprnum' is used in order to get the number of the records stored in a map..TP.B int cbmaprnum(const CBMAP *map);`map' specifies a map handle.  The return value is the number of the records stored in the map..PPThe function `cbmapkeys' is used in order to get the list hanele contains all keys in a map..TP.B CBLIST *cbmapkeys(CBMAP *map);`map' specifies a map handle.  The return value is the list handle contains all keys in the map.  Because the handle of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use..PPThe function `cbmapvals' is used in order toget the list hanele contains all values in a map..TP.B CBLIST *cbmapvals(CBMAP *map);`map' specifies a map handle.  The return value is the list handle contains all values in the map.  Because the handle of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose' if it is no longer in use..PPThe function `cbmapdump' is used in order to serialize a map into a byte array..TP.B char *cbmapdump(const CBMAP *map, int *sp);`map' specifies a map handle.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  The return value is the pointer to the region of the result serial region.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbmapload' is used in order to redintegrate a serialized map..TP.B CBMAP *cbmapload(const char *ptr, int size);`ptr' specifies the pointer to a byte array.  `size' specifies the size of the region.  The return value is a new map handle..PPThe function `cbsprintf' is used in order to allocate a formatted string on memory..TP.B char *cbsprintf(const char *format, ...);`format' specifies a printf\-like format string.  The conversion character `%' can be used with such flag characters as `d', `o', `u', `x', `X', `e', `E', `f', `g', `G', `c', `s', and `%'.  Specifiers of the field length and the precision can be put between the conversion characters and the flag characters.  The specifiers consist of decimal characters, `.', `+', `\-', and the space character.  The other arguments are used according to the format string.  The return value is the pointer to the allocated region of the result string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbreplace' is used in order to replace some patterns in a string..TP.B char *cbreplace(const char *str, CBMAP *pairs);`str' specifies the pointer to a source string.  `pairs' specifies the handle of a map composed of pairs of replacement.  The key of each pair specifies a pattern before replacement and its value specifies the pattern after replacement.  The return value is the pointer to the allocated region of the result string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbsplit' is used in order to make a list by splitting a serial datum..TP.B CBLIST *cbsplit(const char *ptr, int size, const char *delim);`ptr' specifies the pointer to the region of the source content.  If it is `NULL', an empty datum is created.  `size' specifies the size of the region.  If it is negative, the size is assigned with `strlen(ptr)'.  `dalim' specifies a string containing delimiting characters.  If it is `NULL', zero code is used as a delimiter.  The return value is a list handle.  Because the handle of the return value is opened with the function `cblistopen', it should be closed with the function `cblistclose'..PPThe function `cbreadfile' is used in order to read whole data of a file..TP.B char *cbreadfile(const char *name, int *sp);`name' specifies the name of a file.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  The return value is the pointer to the allocated region of the read data.  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbreadlines' is used in order to read every line of a file..TP.B CBLIST *cbreadlines(const char *name);`name' specifies the name of a file.  The return value is a list handle of the lines if successful, else it is NULL.  Line separators are cut out..PPThe function `cbdirlist' is used in order to read names of files in a directory..TP.B CBLIST *cbdirlist(const char *name);`name' specifies the name of a directory.  The return value is a list handle of names if successful, else it is NULL..PPThe function `cbfileinfo' is used in order to get the status of a file or a directory..TP.B int cbfilestat(const char *name, int *isdirp, int *sizep, int *mtimep);`name' specifies the name of a file or a directory.  `dirp' specifies the pointer to a variable to which whether the file is a directory is assigned.  If it is `NULL', it is not used.  `sizep' specifies the pointer to a variable to which the size of the file is assigned.  If it is `NULL', it is not used.  `mtimep' specifies the pointer to a variable to which the last modified time of the file is assigned.  If it is `NULL', it is not used.  If successful, the return value is true, else, false.  False is returned when the file does not exist or the permission is denied..PPThe function `cburlencode' is used in order to encode a serial object with URL encoding..TP.B char *cburlencode(const char *ptr, int size);`ptr' specifies the pointer to a region.  `size' specifies the size of the region.  If it is negative, the size is assigned with `strlen(ptr)'.  The return value is the pointer to the result string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cburldecode' is used in order to decode a string encoded with URL encoding..TP.B char *cburldecode(const char *str, int *sp);`str' specifies the pointer to a source string.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  The return value is the pointer to the region of the result.  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbbaseencode' is used in order to encode a serial object with Base64 encoding..TP.B char *cbbaseencode(const char *ptr, int size);`ptr' specifies the pointer to a region.  `size' specifies the size of the region.  If it is negative, the size is assigned with `strlen(ptr)'.  The return value is the pointer to the result string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbbasedecode' is used in order to decode a string encoded with Base64 encoding..TP.B char *cbbasedecode(const char *str, int *sp);`str' specifies the pointer to a source string.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  The return value is the pointer to the region of the result.  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbquoteencode' is used in order to encode a serial object with quoted\-printable encoding..TP.B char *cbquoteencode(const char *ptr, int size);`ptr' specifies the pointer to a region.  `size' specifies the size of the region.  If it is negative, the size is assigned with `strlen(ptr)'.  The return value is the pointer to the result string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbquotedecode' is used in order to decode a string encoded with quoted\-printable encoding..TP.B char *cbquotedecode(const char *str, int *sp);`str' specifies the pointer to a source string.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  The return value is the pointer to the region of the result.  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use..PPThe function `cbdeflate' is used in order to compress a serial object with ZLIB..TP.B char *cbdeflate(const char *ptr, int size, int *sp);`ptr' specifies the pointer to a region.  `size' specifies the size of the region.  If it is negative, the size is assigned with `strlen(ptr)'.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If successful, the return value is the pointer to the result object, else, it is `NULL'.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.  This function is available only if QDBM is built with enabling ZLIB..PPThe function `cbinflate' is used in order to decompress a serial object compressed with ZLIB..TP.B char *cbinflate(const char *ptr, int size, int *sp);Decompress a serial object compressed with ZLIB.  `ptr' specifies the pointer to a region.  `size' specifies the size of the region.  `sp' specifies the pointer to a variable to which the size of the region of the return value is assigned.  If it is `NULL', it is not used.  If successful, the return value is the pointer to the result object, else, it is `NULL'.  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.  Because the region of the return value is allocated with the `malloc' call, it should be released with the `free' call if it is no longer in use.  This function is available only if QDBM is built with enabling ZLIB..PPEach functions of Cabin is not reentrant, and not thread\-safe..SH SEE ALSO.PP.BR qdbm (3),.BR depot (3),.BR curia (3),.BR relic (3),.BR hovel (3),.BR villa (3),.BR odeum (3),.BR ndbm (3),.BR gdbm (3)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -