Tcl Library Source Code

Documentation
Login


[ Main Table Of Contents | Table Of Contents | Keyword Index | Categories | Modules | Applications ]

NAME

practcl - The Practcl Module

Table Of Contents

SYNOPSIS

package require TclOO 1.0

proc practcl::cat fname
proc practcl::docstrip text
proc putb ?map? text
proc Proc name arglist body
proc noop ?args?
proc practcl::debug ?args?
proc practcl::doexec ?args?
proc practcl::doexec_in path ?args?
proc practcl::dotclexec ?args?
proc practcl::domake path ?args?
proc practcl::domake.tcl path ?args?
proc practcl::fossil path ?args?
proc practcl::fossil_status dir
proc practcl::os
proc practcl::mkzip exename barekit vfspath
proc practcl::sort_dict list
proc practcl::local_os
proc practcl::config.tcl path
proc practcl::read_configuration path
proc practcl::tcllib_require pkg ?args?
proc practcl::platform::tcl_core_options os
proc practcl::platform::tk_core_options os
proc practcl::read_rc_file filename ?localdat ____?
proc practcl::read_sh_subst line info
proc practcl::read_sh_file filename ?localdat ____?
proc practcl::read_Config.sh filename
proc practcl::read_Makefile filename
proc practcl::cputs varname ?args?
proc practcl::tcl_to_c body
proc practcl::_tagblock text ?style tcl? ?note ____?
proc practcl::de_shell data
proc practcl::grep pattern ?files ____?
proc practcl::file_lexnormalize sp
proc practcl::file_relative base dst
proc practcl::findByPattern basedir patterns
proc practcl::log fname comment
proc practcl::_pkgindex_simpleIndex path
proc practcl::_pkgindex_directory path
proc practcl::_pkgindex_path_subdir path
proc practcl::pkgindex_path ?args?
proc practcl::installDir d1 d2
proc practcl::copyDir d1 d2 ?toplevel 1?
proc practcl::buildModule modpath
proc practcl::installModule modpath DEST
proc practcl::trigger ?args?
proc practcl::depends ?args?
proc practcl::target name info ?action ____?
method constructor
method argspec argspec
method comment block
method keyword.Annotation resultvar commentblock type name body
method keyword.Class resultvar commentblock name body
method keyword.class resultvar commentblock name body
method keyword.Class_Method resultvar commentblock name ?args?
method keyword.method resultvar commentblock name ?args?
method keyword.proc commentblock name argspec
method reset
method Main
method section.method keyword method minfo
method section.annotation type name iinfo
method section.class class_name class_info
method section.command procinfo
method manpage ?header value? ?footer value? ?authors list?
method scan_text text
method scan_file filename
method _MorphPatterns
method define submethod ?args?
method graft ?args?
method initialize
method link command ?args?
method morph classname
method script script
method select
method source filename
classmethod select object
method config.sh
method BuildDir PWD
method MakeDir srcdir
method read_configuration
method build-cflags PROJECT DEFS namevar versionvar defsvar
method critcl ?args?
method Autoconf
method BuildDir PWD
method ConfigureOpts
method MakeDir srcdir
method make {} autodetect
method make {} clean
method make {} compile
method make {} install DEST
method build-compile-sources PROJECT COMPILE CPPCOMPILE INCLUDES
method build-Makefile path PROJECT
method build-library outfile PROJECT
method build-tclsh outfile PROJECT ?path auto?
method BuildDir PWD
method make {} autodetect
method make {} clean
method make {} compile
method make {} install DEST
method MakeDir srcdir
method NmakeOpts
method constructor module_object name info ?action_body ____?
method do
method check
method output
method reset
method triggers
method constructor parent ?args?
method child method
method go
method cstructure name definition ?argdat ____?
method include header
method include_dir ?args?
method include_directory ?args?
method c_header body
method c_code body
method c_function header body ?info ____?
method c_tcloomethod name body ?arginfo ____?
method cmethod name body ?arginfo ____?
method c_tclproc_nspace nspace
method c_tclcmd name body ?arginfo ____?
method c_tclproc_raw name body ?arginfo ____?
method tcltype name argdat
method project-compile-products
method implement path
method initialize
method linktype
method generate-cfile-constant
method generate-cfile-header
method generate-cfile-tclapi
method generate-loader-module
method Collate_Source CWD
method select
classmethod select object
method code section body
method Collate_Source CWD
method project-compile-products
method generate-debug ?spaces ____?
method generate-cfile-constant
method generate-cfile-public-structure
method generate-cfile-header
method generate-cfile-global
method generate-cfile-private-typedef
method generate-cfile-private-structure
method generate-cfile-functions
method generate-cfile-tclapi
method generate-hfile-public-define
method generate-hfile-public-macro
method generate-hfile-public-typedef
method generate-hfile-public-structure
method generate-hfile-public-headers
method generate-hfile-public-function
method generate-hfile-public-includes
method generate-hfile-public-verbatim
method generate-loader-external
method generate-loader-module
method generate-stub-function
method IncludeAdd headervar ?args?
method generate-tcl-loader
method generate-tcl-pre
method generate-tcl-post
method linktype
method Ofile filename
method project-static-packages
method toolset-include-directory
method target method ?args?
method project-compile-products
method generate-loader-module
method project-compile-products
method linker-products configdict
method initialize
variable make_object
method _MorphPatterns
method add ?args?
method install-headers ?args?
method make {} _preamble
method make {} pkginfo
method make {} objects
method make {} object name
method make {} reset
method make {} trigger ?args?
method make {} depends ?args?
method make {} filename name
method make {} target name Info body
method make {} todo
method make {} do
method child which
method generate-c
method generate-h
method generate-loader
method initialize
method implement path
method linktype
method _MorphPatterns
method constructor ?args?
method add_object object
method add_project pkg info ?oodefine ____?
method add_tool pkg info ?oodefine ____?
method build-tclcore
method child which
method linktype
method project pkg ?args?
method tclcore
method tkcore
method tool pkg ?args?
method clean PATH
method project-compile-products
method go
method generate-decls pkgname path
method implement path
method generate-make path
method linktype
method package-ifneeded ?args?
method shared_library ?filename ____?
method static_library ?filename ____?
method build-tclkit_main PROJECT PKG_OBJS
method Collate_Source CWD
method wrap PWD exename vfspath ?args?
classmethod Sandbox object
classmethod select object
classmethod claim_option
classmethod claim_object object
classmethod claim_path path
method scm_info
method DistroMixIn
method Sandbox
method SrcDir
method ScmTag
method ScmClone
method ScmUnpack
method ScmUpdate
method Unpack
classmethod claim_object object
classmethod claim_option
classmethod claim_path path
method ScmUnpack
classmethod claim_object obj
classmethod claim_option
classmethod claim_path path
method scm_info
method ScmClone
method ScmTag
method ScmUnpack
method ScmUpdate
classmethod claim_object obj
classmethod claim_option
classmethod claim_path path
method ScmTag
method ScmUnpack
method ScmUpdate
method _MorphPatterns
method BuildDir PWD
method child which
method compile
method go
method install ?args?
method linktype
method linker-products configdict
method linker-external configdict
method linker-extra configdict
method env-bootstrap
method env-exec
method env-install
method env-load
method env-present
method sources
method update
method unpack
method env-bootstrap
method env-present
method linktype
method env-bootstrap
method env-install
method env-present
method install DEST
method kettle path ?args?
method install DEST
method install DEST
method env-bootstrap
method env-install
method env-present
method install DEST
method install-module DEST ?args?
method env-bootstrap
method env-install
method install DEST
method install-module DEST ?args?
method clean
method env-install
method project-compile-products
method ComputeInstall
method go
method linker-products configdict
method project-static-packages
method BuildDir PWD
method compile
method Configure
method install DEST
method install DEST
method install DEST
method env-bootstrap
method env-present
method env-install
method go
method linktype

DESCRIPTION

The Practcl module is a tool for integrating large modules for C API Tcl code that requires custom Tcl types and TclOO objects.

The concept with Practcl is that is a single file package that can assist any tcl based project with distribution, compilation, linking, VFS preparation, executable assembly, and installation. Practcl also allows one project to invoke the build system from another project, allowing complex projects such as a statically linked basekit to be assembled with relative ease.

Practcl ships as a single file, and aside from a Tcl 8.6 interpreter, has no external dependencies.

Making a practcl project

Commands

Classes

Class practcl::doctool

{ set authors {
   {John Doe} {[email protected]}
   {Tom RichardHarry} {[email protected]}
 }
 # Create the object
 ::practcl::doctool create AutoDoc
 set fout [open [file join $moddir module.tcl] w]
 foreach file [glob [file join $srcdir *.tcl]] {
   set content [::practcl::cat [file join $srcdir $file]]
    # Scan the file
    AutoDoc scan_text $content
    # Strip the comments from the distribution
    puts $fout [::practcl::docstrip $content]
 }
 # Write out the manual page
 set manout [open [file join $moddir module.man] w]
 dict set args header [string map $modmap [::practcl::cat [file join $srcdir manual.txt]]]
 dict set args footer [string map $modmap [::practcl::cat [file join $srcdir footer.txt]]]
 dict set args authors $authors
 puts $manout [AutoDoc manpage {*}$args]
 close $manout


}

Tool for build scripts to dynamically generate manual files from comments in source code files

Methods

Class practcl::metaclass

The metaclass for all practcl objects

Methods

Class practcl::toolset

Ancestor-less class intended to be a mixin which defines a family of build related behaviors that are modified when targetting either gcc or msvc

Class Methods

Methods

Class practcl::toolset.gcc

ancestors: practcl::toolset

Methods

Class practcl::toolset.msvc

ancestors: practcl::toolset

Methods

Class practcl::make_obj

ancestors: practcl::metaclass

A build deliverable object. Normally an object file, header, or tcl script which must be compiled or generated in some way

Methods

Class practcl::object

ancestors: practcl::metaclass

A generic Practcl object

Methods

Class practcl::dynamic

Dynamic blocks do not generate their own .c files, instead the contribute to the amalgamation of the main library file

Methods

Class practcl::product

A deliverable for the build system

Class Methods

Methods

Class practcl::product.cheader

ancestors: practcl::product

A product which generated from a C header file. Which is to say, nothing.

Methods

Class practcl::product.csource

ancestors: practcl::product

A product which generated from a C source file. Normally an object (.o) file.

Methods

Class practcl::product.clibrary

ancestors: practcl::product

A product which is generated from a compiled C library. Usually a .a or a .dylib file, but in complex cases may actually just be a conduit for one project to integrate the source code of another

Methods

Class practcl::product.dynamic

ancestors: practcl::dynamic practcl::product

A product which is generated from C code that itself is generated by practcl or some other means. This C file may or may not produce its own .o file, depending on whether it is eligible to become part of an amalgamation

Methods

Class practcl::product.critcl

ancestors: practcl::dynamic practcl::product

A binary product produced by critcl. Note: The implementation is not written yet, this class does nothing.

Class practcl::module

ancestors: practcl::object practcl::product.dynamic

In the end, all C code must be loaded into a module This will either be a dynamically loaded library implementing a tcl extension, or a compiled in segment of a custom shell/app

Variable

Methods

Class practcl::project

ancestors: practcl::module

A toplevel project that is a collection of other projects

Methods

Class practcl::library

ancestors: practcl::project

A toplevel project that produces a library

Methods

Class practcl::tclkit

ancestors: practcl::library

A toplevel project that produces a self-contained executable

Methods

Class practcl::distribution

Standalone class to manage code distribution This class is intended to be mixed into another class (Thus the lack of ancestors)

Class Methods

Methods

Class practcl::distribution.snapshot

ancestors: practcl::distribution

A file distribution from zip, tarball, or other non-scm archive format

Class Methods

Methods

Class practcl::distribution.fossil

ancestors: practcl::distribution

A file distribution based on fossil

Class Methods

Methods

Class practcl::distribution.git

ancestors: practcl::distribution

A file distribution based on git

Class Methods

Methods

Class practcl::subproject

ancestors: practcl::module

A subordinate project

Methods

Class practcl::subproject.source

ancestors: practcl::subproject practcl::library

A project which the kit compiles and integrates the source for itself

Methods

Class practcl::subproject.teapot

ancestors: practcl::subproject

a copy from the teapot

Methods

Class practcl::subproject.kettle

ancestors: practcl::subproject

Methods

Class practcl::subproject.critcl

ancestors: practcl::subproject

Methods

Class practcl::subproject.sak

ancestors: practcl::subproject

Methods

Class practcl::subproject.practcl

ancestors: practcl::subproject

Methods

Class practcl::subproject.binary

ancestors: practcl::subproject

A subordinate binary package

Methods

Class practcl::subproject.tea

ancestors: practcl::subproject.binary

A subordinate TEA based binary package

Class practcl::subproject.library

ancestors: practcl::subproject.binary practcl::library

A subordinate C library built by this project

Methods

Class practcl::subproject.external

ancestors: practcl::subproject.binary

A subordinate external C library

Methods

Class practcl::subproject.core

ancestors: practcl::subproject.binary

Methods

Bugs, Ideas, Feedback

This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category practcl of the Tcllib Trackers. Please also report any ideas for enhancements you may have for either package and/or documentation.

When proposing code changes, please provide unified diffs, i.e the output of diff -u.

Note further that attachments are strongly preferred over inlined patches. Attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar.

KEYWORDS

practcl

CATEGORY

TclOO

COPYRIGHT

Copyright © 2016-2018 Sean Woods