Really impressive this last one! :wink: :!: :idea:
Really impressive this last one! :wink: :!: :idea:
Aplicando el SKILL.md de deepwiki al repo de Harbour:
📄 Relevant source files
README.md β Project description, build instructions, platform matrix
include/hbver.h#L56-59 β Version numbers and status
include/hbverbld.h β Build-time revision and compiler info
LICENSE.txt β GNU GPL license with Harbour linking exception
Harbour is a free, open-source, multi-platform, multi-threading, object-oriented programming language and compiler, backward compatible with CA-Clipper/xBase. It compiles
Harbour was created as a modern, portable successor to CA-Clipper 5.x. It preserves the original xBase/Clipper language semantics β commands like
#define HB_VER_MAJOR 3
#define HB_VER_MINOR 2
#define HB_VER_RELEASE 0
#define HB_VER_STATUS "dev"The current build revision, recorded in
</s> graph TD APP["Application Code (.prg)"] --> PP["Preprocessor (PP)"] PP --> COMP["Compiler"] COMP --> GENC["C Code Generator (genc.c)"] COMP --> GENCC["C++ Code Generator (gencc.c)"] COMP --> GENHRB["HRB Portable Generator (genhrb.c)"] COMP --> GENLLVM["LLVM IR Generator (genllvm.c)"] GENC --> CC["C/C++ Compiler"] GENCC --> CC GENLLVM --> LLVM["LLVM Backend"] CC --> OBJ[".obj Files"] OBJ --> LINK["Linker"] LINK --> EXE["Native Executable"] <i> </i>EXE --> VM["Virtual Machine (HVM)"] <i> </i>VM --> RTL["Runtime Library"] <i> </i>VM --> RDD["RDD β Database Drivers"] <i> </i>VM --> GT["GT β Terminal Drivers"] <i> </i>VM --> CONTRIB["Contrib Packages"] <i> </i>RTL --> CRYPTO["Crypto (MD5, SHA, AES)"] <i> </i>RTL --> NET["Sockets / Inet"] <i> </i>RTL --> FS["File System API"] <i> </i>RTL --> JSON["JSON / Serialization"] <i> </i>RTL --> ZLIB["zLib Compression"] <i> </i>RDD --> DBF["DBF Engine"] <i> </i>RDD --> CDX["CDX / NTX / NSX Indexes"] <i> </i>RDD --> SQL["SQL Drivers"] <i> </i>CONTRIB --> MYSQL["hbmysql"] <i> </i>CONTRIB --> PGSQL["hbpgsql"] <i> </i>CONTRIB --> SQLITE["hbsqlit3"] <i> </i>CONTRIB --> CURL["hbcurl"] <i> </i>CONTRIB --> SSL["hbssl"] <i> </i>CONTRIB --> HTTPD["hbhttpd"] <e>
</s> pie title Source File Distribution (src/ directory) "C Source (.c)" : 214 "Harbour Source (.prg)" : 112 "Headers (.h/.ch)" : 131 "Yacc Grammar (.y/.yyc)" : 3 "Makefiles" : 20 <e>
| Metric | Value |
|---|---|
| Harbour version | 3.2.0-dev |
| Total source files ( | 330+ |
| Header files ( | 148 |
| Contrib packages ( | 69+ |
| Test files ( | 295 |
| Largest source file | |
| Core compiler files | 28 |
| VM source files | 49 |
| RTL source files | 287 |
| RDD source files | 42+ |
| Supported host platforms | 18 (Windows, Linux, macOS, BSD, DOS, OS/2, AIX, β¦) |
| C compiler targets | 30+ (GCC, Clang, MSVC, BCC, MinGW, Watcom, β¦) |
| Config files ( | 117 |
| License | GNU GPL v2+ with linking exception |
📄 Relevant source files
README.md#L146-340 β Build instructions per platform
Makefile β Top-level GNU Make entry point
utils/hbmk2/ β Harbour's own build tool (29 files)
tests/ β 295 test programs
go.bat ,go64.bat β Quick-build batch files for Windows
For platform-specific build prerequisites and optional component configuration see Build & Platform Support. For architecture explanation see Core Architecture.
Building Harbour requires a supported ANSI C compiler and GNU Make 3.81+. On Windows, a copy of
> win-make [install]$ make [install]FUNCTION Main()
? "Hello, world!"
RETURN NILCompile and run:
$ hbmk2 hello.prg
$ ./hello</s> flowchart LR A[".prg Source"] --> B["Harbour Preprocessor (PP)"] B --> C["Harbour Compiler"] C --> D[".c Generated Code"] D --> E["C/C++ Compiler (gcc/msvc/bcc/clang)"] F[".c Native Sources"] --> E G[".ch/.h Headers"] --> C G --> E E --> H[".obj Object Files"] H --> I["Linker / Librarian"] I --> J[".exe / .lib / .dll"] <e>
| Host | Target | Compiler | CPU |
|---|---|---|---|
| Windows | win | mingw, mingw64, msvc, msvc64, bcc, clang, watcom | x86, x86-64 |
| Windows | wce | mingwarm, msvcarm, poccarm | ARM, x86 |
| Windows | dos | djgpp, watcom | x86 |
| Linux | linux | gcc, clang, icc, sunpro, open64 | x86, x86-64, ARM |
| Linux | win | mingw, mingw64 (cross) | x86, x86-64 |
| macOS | darwin | clang, gcc, icc | x86, x86-64 |
| BSD | bsd | gcc, clang | x86, x86-64 |
| Android | android | gcc, gccarm | x86, ARM |
📄 Relevant source files
src/compiler/ β 28 files: compiler front-end, code generators
src/vm/ β 49 files: virtual machine, class system, GC, threading
src/pp/ β 6 files: preprocessor
src/rtl/ β 287 files: runtime library
include/hbcomp.h ,include/hbcompdf.h β Compiler data structures
include/hbvm.h ,include/hbvmpub.h β VM public API
include/hbclass.ch β OOP class definition macros
Harbour's architecture is layered: application
</s> graph TD A["Application Layer (.prg code)"] --> B["Harbour Language / DSL Layer"] B --> C["OOP Class System (classes.c, tclass.prg)"] C --> D["Virtual Machine β HVM (hvm.c, 375KB)"] D --> E["Runtime Library β RTL (287 files)"] E --> F["C API / OS Abstraction"] F --> G["Operating System / Hardware"] <i> </i>D --> H["Garbage Collector (garbage.c)"] <i> </i>D --> I["Threading (thread.c)"] <i> </i>D --> J["Memory Manager (fm.c, dlmalloc.c)"] <i> </i>D --> K["Dynamic Symbol Table (dynsym.c)"] <e>
The Harbour compiler (
| Component | File | Size | Description |
|---|---|---|---|
| Grammar | 123 KB | Yacc/Bison grammar β full xBase language definition | |
| Parser output | 364 KB | Pre-generated parser C code | |
| Main compiler | 154 KB | Core compilation logic | |
| C code generator | 80 KB | Emits portable C source with pcode tables | |
| C++ code generator | 64 KB | Emits real C/C++ function calls (direct translation) | |
| HRB generator | 6 KB | Emits portable | |
| LLVM generator | 3 KB | Experimental LLVM IR output path | |
| Optimizer | 63 KB | Pcode-level optimization passes | |
| Dead code eliminator | 26 KB | Removes unreachable code |
</s> flowchart TD SRC[".prg Source"] --> PP["Preprocessor (ppcore.c)"] PP --> PARSE["Parser (harbour.y β harbour.yyc)"] PARSE --> PCODE["Pcode IR"] PCODE --> OPT["Optimizer (hbopt.c)"] OPT --> DEAD["Dead Code Elimination (hbdead.c)"] DEAD --> GENC["genc.c β .c output"] DEAD --> GENCC["gencc.c β .c output (direct)"] DEAD --> GENHRB["genhrb.c β .hrb bytecode"] DEAD --> GENLLVM["genllvm.c β LLVM IR"] <e>
The Harbour Virtual Machine (
Harbour supports a full OOP system defined via the
</s> classDiagram class HBObject { +ClassName() +ClassH() } class TScalar { +Type info } class TBrowse { +nTop, nLeft, nBottom, nRight +GoTop(), GoBottom() +AddColumn() +Stabilize() } class TGet { +buffer, cargo +Assign(), Display() +SetFocus(), KillFocus() } class TPersistent { +SaveToText() +LoadFromText() } HBObject <|-- TScalar HBObject <|-- TBrowse HBObject <|-- TGet HBObject <|-- TPersistent <e>
Harbour uses a code-block-based callback model. Events are dispatched through
</s> sequenceDiagram participant User participant MainLoop as "Main Event Loop" participant VM as "HVM" participant Block as "Code Block" participant GET as "TGet / TBrowse" <i> </i>User->>MainLoop: Key press / Mouse event <i> </i>MainLoop->>VM: Inkey() β dispatch <i> </i>VM->>GET: Evaluate bAction / bWhen <i> </i>GET->>Block: hb_itemDo(bAction) <i> </i>Block-->>GET: Return value <i> </i>GET-->>VM: Refresh/Update <i> </i>VM-->>MainLoop: Continue loop <i> </i>MainLoop-->>User: Screen update <e>
📄 Relevant source files
src/rdd/ β 42+ files: RDD core, DBF engine, index drivers
src/rdd/dbf1.c β 221 KB: Main DBF implementation
src/rdd/workarea.c β 79 KB: Work area management
src/rdd/dbcmd.c β 73 KB: Database commands (USE, SKIP, SEEKβ¦)
src/rdd/dbfcdx/ ,dbfntx/ ,dbfnsx/ ,dbffpt/ β Index/memo sub-drivers
src/rdd/usrrdd/ β User-defined RDD framework
include/hbapirdd.h β 57 KB: RDD API definitions
Harbour's data access uses the Replaceable Database Driver (RDD) architecture inherited from Clipper. This abstraction layer allows different storage backends to be used transparently. For SQL connectivity see Contrib Ecosystem. For the terminal-based TBrowse data display see Terminal & UI Subsystem.
</s> graph TD APP["Application (USE, SKIP, SEEKβ¦)"] --> RDDAPI["RDD API Layer (dbcmd.c, wafunc.c)"] RDDAPI --> WA["Work Area Manager (workarea.c)"] WA --> DBF["DBFNTX / DBFCDX / DBFNSX"] WA --> SDF["SDF Driver (sdf1.c)"] WA --> DELIM["Delimited Driver (delim1.c)"] WA --> USRRDD["User RDD (usrrdd.c)"] WA --> SQLRDD["SQL RDD (rddsql/)"] <i> </i>DBF --> DBF1["DBF Core Engine (dbf1.c, 221KB)"] <i> </i>DBF --> NTX["NTX Index (dbfntx/)"] <i> </i>DBF --> CDX["CDX Compound Index (dbfcdx/)"] <i> </i>DBF --> NSX["NSX Index (dbfnsx/)"] <i> </i>DBF --> FPT["FPT Memo (dbffpt/)"] <e>
| Driver | Type | Source Location | Description |
|---|---|---|---|
| DBFNTX | Native | DBF + NTX single-key indexes | |
| DBFCDX | Native | DBF + CDX compound indexes (FoxPro compatible) | |
| DBFNSX | Native | DBF + NSX indexes | |
| DBFFPT | Native | FPT memo fields | |
| SDF | Native | System Data Format (fixed-width text) | |
| DELIM | Native | CSV/Delimited text files | |
| USRRDD | Framework | Framework for user-defined RDDs in | |
| ADS | Contrib | Advantage Database Server client | |
| MySQL | Contrib | MySQL via SDD | |
| PostgreSQL | Contrib | PostgreSQL via SDD | |
| SQLite3 | Contrib | SQLite3 via SDD | |
| ODBC | Contrib | Generic ODBC via SDD | |
| Firebird | Contrib | Firebird via SDD | |
| Oracle | Contrib | Oracle OCI via SDD |
The
📄 Relevant source files
src/rtl/hbgtcore.c β 126 KB: GT core abstraction
src/rtl/gtapi.c β 32 KB: GT API functions
src/rtl/gtwin/ ,gtstd/ ,gtcrs/ ,gtsln/ ,gtxwc/ ,gttrm/ β Platform drivers
src/rtl/tbrowse.prg β 83 KB: TBrowse data grid
src/rtl/tget.prg β 53 KB: TGet input system
contrib/gtwvg/ β 72 files: Win32 GUI terminal
contrib/gtwvw/ β 35 files: Win32 GUI terminal (variant)
The GT (General Terminal) subsystem is Harbour's terminal abstraction layer. It provides a unified API for screen output, keyboard input, and mouse handling across all platforms. For database browsing see Data Access Layer.
</s> graph TD APP["Application (@ SAY, ?, QOut)"] --> GTAPI["GT API (gtapi.c)"] GTAPI --> GTCORE["GT Core (hbgtcore.c, 126KB)"] GTCORE --> GTSTD["gtstd β Standard I/O"] GTCORE --> GTWIN["gtwin β Windows Console"] GTCORE --> GTCRS["gtcrs β ncurses (*nix)"] GTCORE --> GTSLN["gtsln β S-Lang (*nix)"] GTCORE --> GTXWC["gtxwc β X11 (*nix GUI)"] GTCORE --> GTTRM["gttrm β Terminal (*nix)"] GTCORE --> GTWVT["gtwvt β Windows VT"] GTCORE --> GTCGI["gtcgi β CGI output"] GTCORE --> GTWVG["gtwvg β Win32 GUI (contrib)"] GTCORE --> GTWVW["gtwvw β Win32 GUI (contrib)"] GTCORE --> GTQTC["gtqtc β Qt (contrib)"] GTCORE --> GTALLEG["gtalleg β Allegro (contrib)"] <e>
| Driver | Platform | Source | Type |
|---|---|---|---|
| gtstd | All | Standard I/O (default) | |
| gtwin | Windows | Win32 Console API | |
| gtwvt | Windows | Virtual Terminal | |
| gtcrs | *nix | ncurses | |
| gtsln | *nix | S-Lang | |
| gtxwc | *nix | X11 window | |
| gttrm | *nix | Terminal | |
| gtcgi | All | CGI output | |
| gtdos | DOS | DOS console | |
| gtos2 | OS/2 | OS/2 console | |
| gtpca | All | PC ANSI | |
| gtwvg | Windows | Win32 GUI (72 files) | |
| gtwvw | Windows | Win32 GUI variant | |
| gtqtc | Multi | Qt-based | |
| gtalleg | Multi | Allegro-based |
📄 Relevant source files
src/rtl/hbsocket.c β 118 KB: Low-level socket API
src/rtl/hbsockhb.c β 43 KB: Harbour-level socket wrappers
src/rtl/hbinet.c β 39 KB: Internet socket abstraction
src/rtl/hbcom.c β 116 KB: Serial/COM port API
contrib/hbcurl/ β cURL bindings
contrib/hbhttpd/ β HTTP server (24 files)
contrib/hbnetio/ β Network I/O (21 files)
contrib/hbtip/ β Internet protocols (45 files: SMTP, POP3, FTP, HTTP)
Harbour provides several layers of networking support, from raw socket programming to high-level protocol libraries.
</s> graph TD APP["Application"] --> TIP["hbtip β SMTP, POP3, FTP, HTTP"] APP --> HTTPD["hbhttpd β HTTP Server"] APP --> NETIO["hbnetio β Remote File I/O"] APP --> CURL["hbcurl β libcurl bindings"] <i> </i>TIP --> INET["hbinet (hbinet.c)"] <i> </i>HTTPD --> SOCK["hbsocket (hbsocket.c)"] <i> </i>NETIO --> SOCK <i> </i>INET --> SOCK <i> </i>CURL --> LIBCURL["libcurl (external)"] <i> </i>SOCK --> OS["OS Socket API (Winsock / BSD)"] <i> </i>APP --> COM["hbcom β Serial Ports (hbcom.c)"] <i> </i>COM --> OSCOM["OS Serial API"] <e>
📄 Relevant source files
src/rtl/hbmd5.c β MD5 hash
src/rtl/hbsha1.c ,hbsha1hm.c β SHA-1 + HMAC
src/rtl/hbsha2.c ,hbsha2hm.c β SHA-256/384/512 + HMAC
src/rtl/hbbfish.c β Blowfish cipher
src/rtl/arc4.c β ARC4/RC4 stream cipher
src/rtl/base64c.c ,base64d.c β Base64 encode/decode
src/rtl/hbcrc.c β CRC32 checksum
src/rtl/hbadler.c β Adler-32
src/rtl/hbzlib.c β zLib compression
contrib/hbssl/ β OpenSSL bindings (37 files)
The RTL includes built-in implementations of common hash functions and ciphers, all in pure C. For SSL/TLS support, the
📄 Relevant source files
src/llvm/llvm_backend.c β 230 lines: Context management, optimization passes, bitcode emission
src/llvm/llvm_codegen.c β Code generation from pcode to LLVM IR
src/llvm/llvm_jit.c β JIT compilation support
src/llvm/llvm_optimize.c β Module-level optimization pipeline
src/llvm/llvm_translate.c β 13 KB: Pcode-to-LLVM-IR opcode translation
src/llvm/hbllvm.h β LLVM context data structures
src/llvm/hbllvm_opcodes.h β Pcode opcode mapping for LLVM
src/compiler/genllvm.c β Compiler-side LLVM output entry point
An experimental LLVM backend adds the ability to compile Harbour pcode to LLVM IR for native code generation with advanced optimizations. The
</s> flowchart LR PCODE["Harbour Pcode"] --> TRANS["llvm_translate.c β Opcode Translation"] TRANS --> IR["LLVM IR (Module)"] IR --> OPT["llvm_optimize.c β Optimization Passes"] OPT --> JIT["llvm_jit.c β JIT Compilation"] OPT --> BC["llvm_backend.c β Bitcode Emission (.bc)"] JIT --> NATIVE["Native Machine Code (in-memory)"] BC --> LLC["LLVM toolchain (opt/llc)"] LLC --> NATIVE2["Native Object File"] <e>
The LLVM backend supports four optimization levels (
| Level | Passes |
|---|---|
| O0 | None |
| O1 | InstructionCombining, Reassociate, GVN, CFGSimplification |
| O2 | O1 + FunctionInlining, GlobalOptimizer, PromoteMemoryToRegister |
| O3 | AggressiveDCE, DeadStoreElim, Inlining, GVN, LICM, SCCP, ScalarRepl, TailCallElim |
📄 Relevant source files
contrib/ β 69+ packages with 1962+ total files
contrib/make.hb β 25 KB: Contrib build orchestrator
Harbour ships a rich ecosystem of contributed packages:
| Package | Files | Description |
|---|---|---|
| hbmysql | 46 | MySQL client library |
| hbpgsql | 16 | PostgreSQL client library |
| hbsqlit3 | 16 | SQLite3 embedded database |
| hbodbc | 12 | ODBC abstraction layer |
| hbfbird | 11 | Firebird/Interbase client |
| rddads | 16 | Advantage Database Server RDD |
| rddsql | 8 | SQL RDD bridge framework |
| sddmy / sddpg / sddsqlt3 / sddodbc / sddfb / sddoci | 36 | SQL Data Drivers |
| Package | Files | Description |
|---|---|---|
| hbcurl | 9 | libcurl bindings |
| hbssl | 37 | OpenSSL bindings |
| hbhttpd | 24 | HTTP server |
| hbnetio | 21 | Network I/O subsystem |
| hbtip | 45 | Internet protocols (SMTP, POP3, FTP, HTTP) |
| hbsms | 7 | SMS support |
| hbblat | 15 | Email via Blat (Windows) |
| Package | Files | Description |
|---|---|---|
| hbhpdf | 123 | libHaru PDF generation |
| hbfimage | 8 | FreeImage bindings |
| hbgd | 24 | GD graphics library |
| hbcairo | 23 | Cairo 2D graphics |
| hbzebra | 22 | Barcode generation |
| Package | Files | Description |
|---|---|---|
| hbbz2 | 21 | bzip2 compression |
| hblzf | 19 | LZF compression |
| hbmlzo | 15 | miniLZO compression |
| hbmzip | 21 | Minizip (ZIP archives) |
| hbziparc | 8 | ZIP archive management |
| Package | Files | Description |
|---|---|---|
| xhb | 139 | xHarbour compatibility layer |
| hbct | 239 | CA-Tools (CT3) library compatibility |
| hbxpp | 38 | Xbase++ compatibility |
| hbnf | 341 | Nanforum library (largest contrib) |
| hbfoxpro | 10 | Visual FoxPro compatibility functions |
| Package | Description |
|---|---|
| hbwin | Windows API bindings (104 files) |
| hbformat | Source code formatter |
| hbrun | Harbour script runner |
| hbtest | Test framework |
| hbcomm | Serial communication |
| hbdoc | Documentation generator |
| hbexpat | XML processing via Expat |
| hbmxml | MiniXML processing |
| hbxdiff | Diff/patch functionality |
| hbtinymt | Mersenne Twister PRNG |
| hbmagic | File type detection (libmagic) |
| hbgs | Ghostscript integration |
| hbcups | CUPS printing (*nix) |
📄 Relevant source files
config/ β 117 configuration files for compilers/platforms
utils/hbmk2/ β 29 files: Harbour's own build tool
Makefile β Top-level build entry
go.bat ,go64.bat ,go32h.bat ,go64h.bat β Quick-build scripts
build_llvm.bat ,build_llvm.sh β LLVM backend builds
debian/ β Debian packaging (8 files)
package/ β Distribution packaging scripts (27 files)
For the platform matrix and compiler targets see Getting Started.
</s> graph LR WIN["Windows Host"] --> W_WIN["β Windows (native)"] WIN --> W_WCE["β Windows CE (cross)"] WIN --> W_DOS["β MS-DOS (cross)"] WIN --> W_OS2["β OS/2 (cross)"] WIN --> W_LINUX["β Linux (cross)"] WIN --> W_ANDROID["β Android (cross)"] WIN --> W_VXWORKS["β VxWorks (cross)"] <i> </i>LINUX["Linux Host"] --> L_LINUX["β Linux (native)"] <i> </i>LINUX --> L_WIN["β Windows (cross)"] <i> </i>LINUX --> L_WCE["β Windows CE (cross)"] <i> </i>LINUX --> L_DOS["β MS-DOS (cross)"] <i> </i>LINUX --> L_ANDROID["β Android (cross)"] <i> </i>DARWIN["macOS Host"] --> D_DARWIN["β macOS (native)"] <i> </i>DARWIN --> D_WIN["β Windows (cross)"] <i> </i>DARWIN --> D_ANDROID["β Android (cross)"] <e>
📄 Relevant source files
tests/ β 295 test programs
utils/hbtest/ β 22 files: Regression test framework
contrib/hbtest/ β 7 files: Contrib test support
src/debug/ β 16 files: Built-in interactive debugger
.travis.yml β CI configuration
Harbour includes 295 test files covering core language features, RTL functions, database operations, and contrib packages. The test runner is invokable via:
> cd tests
> hbmk2 hello.prgHarbour ships a full interactive debugger (
Launch with:
</s> classDiagram class StrategyPattern { +RDD Interface +Swappable DBF/CDX/NTX/SQL backends } class AbstractFactory { +GT Driver Factory +Pluggable terminal backends } class Observer { +Code Block callbacks +bAction/bWhen event model } class Composite { +TBrowse columns +Menu system hierarchy } class TemplateMethod { +USRRDD framework +Override specific RDD methods } StrategyPattern --> AbstractFactory : "both use\npluggable backends" <e>
</s> stateDiagram-v2 [*] --> Created : New() / CreateContext() Created --> Initialized : Init() Initialized --> Active : Activate() / Display() Active --> Refreshing : Refresh() Refreshing --> Active Active --> Suspended : KillFocus() Suspended --> Active : SetFocus() Active --> Destroyed : End() / Destroy() Destroyed --> [*] <e>
Generated by Deep Code Analysis Skill β DeepWiki Style β 2026-03-01
Dear Antonio,
I just had Claude generate a
What especially caught my attention was the feedback:
"This would be a useful open-source package: a 'Harbour DBF Microservice'βan HTTP/JSON interface for any DBF database, featuring record locking, audit logging, and optimistic resource locking. Nothing like this exists yet."
A standout feature is the DBF-Lock: fully generic (using
Best regards,
Otto