---
name: "libolecf"
section: "3"
platform: "linux"
package: "libolecf-dev"
version: "20181231-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libolecf"
---

# libolecf(3)

Library to access the Object Linking and Embedding (OLE) Compound File (CF) format

## NAME

**libolecf.h** – Library to access the Object Linking and Embedding (OLE) Compound File (CF) format

## LIBRARY

library “libolecf”

## SYNOPSIS

**#include \<libolecf.h\>**

Support functions

*const* *char* *\**\

**libolecf\_get\_version**(*void*);

*uint8\_t*\

**libolecf\_get\_access\_flags\_read**(*void*);

*int*\

**libolecf\_get\_codepage**(*int \*codepage, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_set\_codepage**(*int codepage, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_check\_file\_signature**(*const char \*filename, libolecf\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libolecf\_check\_file\_signature\_wide**(*const wchar\_t \*filename, libolecf\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libolecf\_check\_file\_signature\_file\_io\_handle**(*libbfio\_handle\_t \*file\_io\_handle, libolecf\_error\_t \*\*error*);

Notify functions

*void*\

**libolecf\_notify\_set\_verbose**(*int verbose*);

*int*\

**libolecf\_notify\_set\_stream**(*FILE \*stream, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_notify\_stream\_open**(*const char \*filename, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_notify\_stream\_close**(*libolecf\_error\_t \*\*error*);

Error functions

*void*\

**libolecf\_error\_free**(*libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_error\_fprint**(*libolecf\_error\_t \*error, FILE \*stream*);

*int*\

**libolecf\_error\_sprint**(*libolecf\_error\_t \*error, char \*string, size\_t size*);

*int*\

**libolecf\_error\_backtrace\_fprint**(*libolecf\_error\_t \*error, FILE \*stream*);

*int*\

**libolecf\_error\_backtrace\_sprint**(*libolecf\_error\_t \*error, char \*string, size\_t size*);

File functions

*int*\

**libolecf\_file\_initialize**(*libolecf\_file\_t \*\*file, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_free**(*libolecf\_file\_t \*\*file, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_signal\_abort**(*libolecf\_file\_t \*file, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_open**(*libolecf\_file\_t \*file, const char \*filename, int access\_flags, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_close**(*libolecf\_file\_t \*file, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_sector\_size**(*libolecf\_file\_t \*file, size32\_t \*sector\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_short\_sector\_size**(*libolecf\_file\_t \*file, size32\_t \*short\_sector\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_ascii\_codepage**(*libolecf\_file\_t \*file, int \*ascii\_codepage, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_set\_ascii\_codepage**(*libolecf\_file\_t \*file, int ascii\_codepage, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_format\_version**(*libolecf\_file\_t \*file, uint16\_t \*major\_version, uint16\_t \*minor\_version, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_number\_of\_unallocated\_blocks**(*libolecf\_file\_t \*file, int \*number\_of\_unallocated\_blocks, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_unallocated\_block**(*libolecf\_file\_t \*file, int unallocated\_block\_index, off64\_t \*offset, size64\_t \*size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_root\_item**(*libolecf\_file\_t \*file, libolecf\_item\_t \*\*root\_item, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_item\_by\_utf8\_path**(*libolecf\_file\_t \*file, const uint8\_t \*utf8\_string, size\_t utf8\_string\_length, libolecf\_item\_t \*\*item, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_file\_get\_item\_by\_utf16\_path**(*libolecf\_file\_t \*file, const uint16\_t \*utf16\_string, size\_t utf16\_string\_length, libolecf\_item\_t \*\*item, libolecf\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libolecf\_file\_open\_wide**(*libolecf\_file\_t \*file, const wchar\_t \*filename, int access\_flags, libolecf\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libolecf\_file\_open\_file\_io\_handle**(*libolecf\_file\_t \*file, libbfio\_handle\_t \*file\_io\_handle, int access\_flags, libolecf\_error\_t \*\*error*);

Item functions

*int*\

**libolecf\_item\_free**(*libolecf\_item\_t \*\*item, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_type**(*libolecf\_item\_t \*item, uint8\_t \*type, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_utf8\_name\_size**(*libolecf\_item\_t \*item, size\_t \*utf8\_string\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_utf8\_name**(*libolecf\_item\_t \*item, uint8\_t \*utf8\_string, size\_t utf8\_string\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_utf16\_name\_size**(*libolecf\_item\_t \*item, size\_t \*utf16\_string\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_utf16\_name**(*libolecf\_item\_t \*item, uint16\_t \*utf16\_string, size\_t utf16\_string\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_size**(*libolecf\_item\_t \*item, uint32\_t \*size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_creation\_time**(*libolecf\_item\_t \*item, uint64\_t \*filetime, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_modification\_time**(*libolecf\_item\_t \*item, uint64\_t \*filetime, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_number\_of\_sub\_items**(*libolecf\_item\_t \*item, int \*number\_of\_sub\_items, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_sub\_item**(*libolecf\_item\_t \*item, int sub\_item\_index, libolecf\_item\_t \*\*sub\_item, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_sub\_item\_by\_utf8\_name**(*libolecf\_item\_t \*item, const uint8\_t \*utf8\_string, size\_t utf8\_string\_length, libolecf\_item\_t \*\*sub\_item, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_sub\_item\_by\_utf16\_name**(*libolecf\_item\_t \*item, const uint16\_t \*utf16\_string, size\_t utf16\_string\_length, libolecf\_item\_t \*\*sub\_item, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_sub\_item\_by\_utf8\_path**(*libolecf\_item\_t \*item, const uint8\_t \*utf8\_string, size\_t utf8\_string\_length, libolecf\_item\_t \*\*sub\_item, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_item\_get\_sub\_item\_by\_utf16\_path**(*libolecf\_item\_t \*item, const uint16\_t \*utf16\_string, size\_t utf16\_string\_length, libolecf\_item\_t \*\*sub\_item, libolecf\_error\_t \*\*error*);

Stream functions

*ssize\_t*\

**libolecf\_stream\_read\_buffer**(*libolecf\_item\_t \*stream, uint8\_t \*buffer, size\_t size, libolecf\_error\_t \*\*error*);

*off64\_t*\

**libolecf\_stream\_seek\_offset**(*libolecf\_item\_t \*stream, off64\_t offset, int whence, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_stream\_get\_offset**(*libolecf\_item\_t \*stream, off64\_t \*offset, libolecf\_error\_t \*\*error*);

Property set stream functions

*int*\

**libolecf\_property\_set\_stream\_get\_set**(*libolecf\_item\_t \*property\_set\_stream, libolecf\_property\_set\_t \*\*property\_set, libolecf\_error\_t \*\*error*);

Property set functions

*int*\

**libolecf\_property\_set\_free**(*libolecf\_property\_set\_t \*\*property\_set, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_set\_get\_class\_identifier**(*libolecf\_property\_set\_t \*property\_set, uint8\_t \*guid\_data, size\_t guid\_data\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_set\_get\_number\_of\_sections**(*libolecf\_property\_set\_t \*property\_set, int \*number\_of\_sections, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_set\_get\_section\_by\_index**(*libolecf\_property\_set\_t \*property\_set, int section\_index, libolecf\_property\_section\_t \*\*property\_section, libolecf\_error\_t \*\*error*);

Property section functions

*int*\

**libolecf\_property\_section\_free**(*libolecf\_property\_section\_t \*\*property\_section, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_section\_get\_class\_identifier**(*libolecf\_property\_section\_t \*property\_section, uint8\_t \*guid\_data, size\_t guid\_data\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_section\_get\_number\_of\_properties**(*libolecf\_property\_section\_t \*property\_section, int \*number\_of\_properties, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_section\_get\_property\_by\_index**(*libolecf\_property\_section\_t \*property\_section, int property\_index, libolecf\_property\_value\_t \*\*property\_value, libolecf\_error\_t \*\*error*);

Property value functions

*int*\

**libolecf\_property\_value\_free**(*libolecf\_property\_value\_t \*\*property\_value, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_identifier**(*libolecf\_property\_value\_t \*property\_value, uint32\_t \*identifier, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_value\_type**(*libolecf\_property\_value\_t \*property\_value, uint32\_t \*value\_type, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_size**(*libolecf\_property\_value\_t \*property\_value, size\_t \*data\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data**(*libolecf\_property\_value\_t \*property\_value, uint8\_t \*data, size\_t data\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_boolean**(*libolecf\_property\_value\_t \*property\_value, uint8\_t \*value\_boolean, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_16bit\_integer**(*libolecf\_property\_value\_t \*property\_value, uint16\_t \*value\_16bit, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_32bit\_integer**(*libolecf\_property\_value\_t \*property\_value, uint32\_t \*value\_32bit, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_64bit\_integer**(*libolecf\_property\_value\_t \*property\_value, uint64\_t \*value\_64bit, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_filetime**(*libolecf\_property\_value\_t \*property\_value, uint64\_t \*filetime, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_utf8\_string\_size**(*libolecf\_property\_value\_t \*property\_value, size\_t \*utf8\_string\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_utf8\_string**(*libolecf\_property\_value\_t \*property\_value, uint8\_t \*utf8\_string, size\_t utf8\_string\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_utf16\_string\_size**(*libolecf\_property\_value\_t \*property\_value, size\_t \*utf16\_string\_size, libolecf\_error\_t \*\*error*);

*int*\

**libolecf\_property\_value\_get\_data\_as\_utf16\_string**(*libolecf\_property\_value\_t \*property\_value, uint16\_t \*utf16\_string, size\_t utf16\_string\_size, libolecf\_error\_t \*\*error*);

## DESCRIPTION

The **libolecf\_get\_version**() function is used to retrieve the library version.

## RETURN VALUES

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libolecf.h".

## ENVIRONMENT

None

## FILES

None

## NOTES

libolecf allows to be compiled with wide character support (wchar\_t).

To compile libolecf with wide character support use: *./configure* *--enable-wide-character-type=yes*\
  or define: *\_UNICODE*\
  or *UNICODE*\
  during compilation.

*LIBOLECF\_WIDE\_CHARACTER\_TYPE*\
  in libolecf/features.h can be used to determine if libolecf was compiled with wide character support.

## BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libolecf/issues

## AUTHOR

These man pages are generated from "libolecf.h".

## COPYRIGHT

Copyright (C) 2008-2018, Joachim Metz \<joachim.metz@gmail.com\>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

the libolecf.h include file
