Library (.LIB .SLB) file format specification

(C) Tim Worthington

Document history

  • 2018-04-08 Released.

File format history

  • V1.0 - First and only version to date.

About

This document describes the format of the symbol library (.LIB) and geometry library (.SLB) files for PCB Elegance. The file is binary with little endian byte order. A symbol library must have the appropriate Identification string in its header and contain only symbols in its Data section. A geometry library must have the appropriate Identification string in its header and contain only geometies in its Data section.


Limits  
LibraryFileSize 32 Mbyte
SymbolFileSize 1024 kbyte
GeometryFileSize 4096 kbyte


Structure

Section Start address Contains
Header 0x0000 1 Header record.
Names 0x0050 LibName records * NrLibEntries
Data *MaxNrLibEntries * sizeof(LibName) + sizeof(Header) Symbol (or geometry) * NrLibEntries

Header section

Header record

Address Size Type Name Note
0x00 32 char Identification [1] Version string
0x20 32 char EditingPerson Not used
0x40 4 int32 FileVersion Not used
0x44 4 int32 Revision Not used
0x48 4 int32 NrLibEntries Entry count
0x4C 4 int32 MaxNrLibEntries [2] Entry count including unused entries
0x50       Header size


[1]Identification is either “Symbol library version 1.0” or “Geometry library version 1.0”.


[2]MaxNrLibEntries. There is usually some empty space for new entries between the end of the Names section and the start of the Data section.


Names section

LibName record

Address Size Type Name Notes
0x00 32 char NameText Symbol or geometry name
0x20 4 char Position  
0x24 4 char Size  
0x28       Record size


Data section

This section contains symbol or geometry data.


Example

example.slb

This is a minimal example of a geometry library which contains two geometries, CE25-63 and 0603.


Text view

----[Header section]----
Header
0000:001B (char[32]) Identification = Geometry library version 1.0
0020:003F (char[32]) EditingPerson =
0040:0043 (int32) FileVersion = 0
0044:0047 (int32) Revision = 0
0048:004B (int32) NrLibEntries = 2
004C:004F (int32) MaxNrLibEntries = 200

----[Names section]----
LibName
0050:006F (char[32]) NameText = CE25-63
0070:0073 (int32) Position = 0x1F90
0074:0077 (int32) Size = 0x02CC

LibName
0078:0097 (char[32]) NameText = 0603
0098:009B (int32) Position = 0x225C
009C:009F (int32) Size = 0x01E0

00A0:1F8F (Empty space)

----[Data section]----
Geometry
1F90:1FAB (char[28]) Identification = Shape definition 1.5
1FAC:1FAF (int32) MemSize = 0x02CC
1FB0:1FCF (char[32]) ShapeName = CE25-63
1FD0:1FD3 (int32) Revision = 0
1FD4:1FD7 (int32) CompOutLineOffset = 0x00B4
1FD8:225B (The rest of the geometry is omitted for clarity of this text view)

Geometry
225C:2277 (char[28]) Identification = Shape definition 1.5
2278:227B (int32) MemSize = 0x02CC
227C:229B (char[32]) ShapeName = 0603
229C:229F (int32) Revision = 0
22A0:22A3 (int32) CompOutLineOffset = 0x00B4
22A4:243B (The rest of the geometry is omitted for clarity of this text view)