Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch skip-and-hop
Excluding Merge-Ins
This is equivalent to a diff from
475a79542b
to f1bf2fd0c0
2016-02-04
| | |
05:32 |
|
check-in: 5a936be902 user: aku tags: trunk
|
05:14 |
|
check-in: c272ee3410 user: aku tags: trunk, release, tcllib-1-18
|
2016-02-03
| | |
04:51 |
|
Closed-Leaf
check-in: f1bf2fd0c0 user: hypnotoad tags: skip-and-hop
|
04:50 |
|
check-in: d80093ba78 user: hypnotoad tags: odie
|
03:32 |
|
check-in: f1eeaf6396 user: hypnotoad tags: skip-and-hop
|
03:31 |
|
check-in: 9b42a58ed5 user: hypnotoad tags: odie
|
2016-01-24
| | |
13:18 |
|
Leaf
check-in: e958f2695b user: lars_h tags: numtheory
|
2016-01-23
| | |
22:53 |
|
check-in: 4268dab54f user: aku tags: tcllib-1-18-rc
|
2016-01-22
| | |
19:54 |
|
check-in: 475a79542b user: lars_h tags: trunk
|
2016-01-02
| | |
00:54 |
|
check-in: 6db639dcd1 user: schlenk tags: trunk
|
| | |
Added examples/practcl/README.
|
1
2
3
4
5
6
|
+
+
+
+
+
+
|
This directory contains the following example applications of practcl:
* project.tcl -> The script which builds the library implementing "hello"
* hellocmd.tcl -> Adding a simple command "hello_world"
* helloclass.tcl -> A class that implements a method called "hello_world"
* hellotype.tcl -> Create a new tcl_obj type to represent "hello_world"
|
| | | | |
Added examples/practcl/helloclass.tcl.
|
1
2
3
4
5
6
7
8
9
10
11
12
|
+
+
+
+
+
+
+
+
+
+
+
+
|
my define set class ::world
my define set cclass World
my code tcl {
oo::class create ::world {}
}
my cmethod hello {
Tcl_Obj *pResult=Tcl_NewStringObj("Hello World!",-1);
Tcl_SetObjResult(pResult);
return TCL_OK;
}
|
| | | | | | | | | | |
Added examples/practcl/hellocmd.tcl.
|
1
2
3
4
5
|
+
+
+
+
+
|
my c_tclproc_raw ::hello {
Tcl_Obj *pResult=Tcl_NewStringObj("Hello World!",-1);
Tcl_SetObjResult(pResult);
return TCL_OK;
}
|
| | | |
Added examples/practcl/hellotype.tcl.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
###
# This example implements a "hello world" type
# which is a completely useless Tcl_Obj that only
# stores the content "Hello World"
###
my code define {
#define HELLO_WORLD "Hello World!"
}
my c_function {Tcl_Obj *MyProg_NewHelloWorldObj(void)} {
Tcl_Obj *objPtr=Tcl_NewObj();
Tcl_InvalidateStringRep(objPtr);
objPtr->typePtr=&helloworld_tclobjtype;
objPtr->internalRep.otherValuePtr=Tcl_Alloc(strlen(HELLO_WORLD));
strcpy(objPtr->internalRep.otherValuePtr,HELLO_WORLD);
return objPtr;
}
my c_tclproc_raw ::helloObj {
Tcl_Obj *pResult=MyProg_NewHelloWorldObj();
Tcl_SetObjResult(pResult);
return TCL_OK;
}
my c_tclproc_raw ::is_helloObj {
int true=objv[1]->typePtr==&helloworld_tclobjtype;
Tcl_SetObjResult(Tcl_NewBooleanObj(true));
return TCL_OK;
}
my tcltype helloworld {
cname helloworld_tclobjtype
freeproc {
Tcl_Free(objPtr->internalRep.otherValuePtr);
objPtr->internalRep.otherValuePtr=NULL;
objPtr->typePtr=NULL;
}
dupproc {
char *src=srcPtr->internalRep.otherValuePtr;
int size=sizeof(*src);
char *copy=(char *)Tcl_Alloc(size);
memcpy(copy,src,size);
Tcl_InvalidateStringRep(dupPtr);
dupPtr->typePtr=&@CNAME@;
dupPtr->internalRep.otherValuePtr=copy;
}
updatestringproc {
/* Update String Rep */
objptr->length=strlen(HELLO_WORLD);
objptr->bytes=Tcl_Alloc(objptr->length+1);
strcpy(objptr->bytes,HELLO_WORLD);
}
setfromanyproc {
Tcl_AppentResult(interp,"Hello World is a constant");
return TCL_ERROR;
}
}
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added examples/practcl/project.tcl.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
package require practcl
::practcl::library create HELLO {
name hello
version 0.1
}
set mod [HELLO add class module]
$mod define set loader-funct HelloWorld_Init
$mod add hellocmd.tcl
$mod add helloclass.tcl
$mod add hellotype.tcl
HELLO go
$mod go
puts "***\nTCL LOADER:\n***"
puts [$mod generate-tcl]
puts "***\nPublic H file\n***"
puts [$mod generate-h]
puts "***\nC implementation\n***"
puts [$mod generate-c]
|
| | | | | | | | | | | | | | | | | | |
Changes to modules/oodialect/oodialect.tcl.
︙ | | |
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
+
+
|
# Meta category TclOO
# Meta subject oodialect
# Meta require {Tcl 8.6}
# Meta author Sean Woods
# Meta author Donald K. Fellows
# Meta license BSD
# @@ Meta End
package require TclOO
namespace eval ::oo::dialect {
namespace export create
}
# A stack of class names
proc ::oo::dialect::Push {class} {
|
︙ | | |
Added modules/practcl/pkgIndex.tcl.
|
1
2
3
4
5
6
7
8
9
10
11
|
+
+
+
+
+
+
+
+
+
+
+
|
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script. It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands. When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.
package ifneeded practcl 0.1 [list source [file join $dir practcl.tcl]]
|
| | | | | | | | | |
Added modules/practcl/practcl.man.
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
[comment {-*- practlc -*-}]
[manpage_begin practcl n 0.1]
[keywords practcl]
[copyright {2016 Sean Woods <[email protected]>}]
[moddesc {The The Proper Rational API for C to Tool Command Language Module}]
[titledesc {The Practcl Module}]
[category {TclOO}]
[require TclOO 1.0]
[description]
The Practcl module is a tool for integrating large modules for C API
Tcl code that requires custom Tcl types and TclOO objects.
[section COMMANDS]
[list_begin utility]
[call [cmd CPUTS] [arg varname] [arg body] [opt [arg body]...]]
Appends blocks of text to a buffer. This command tries to reduce the number
of line breaks between bodies.
[call [cmd practcl::_isdirectory] [arg path]]
Returns true if [arg path] is a directory, using the test
[end_list]
[list_begin classes]
[call [cmd practcl::object] [arg "parent"] [opt [arg "keyvaluelist"]]]
A generic Practcl object
[call [cmd practcl::library] [opt [arg "keyvaluelist"]]]
A Practcl object representing a library container
[call [cmd practcl::exe] [opt [arg "keyvaluelist"]]]
A Practcl object representing a wrapped executable
[call [cmd practcl::product] [arg "parent"] [opt [arg "keyvaluelist"]]]
A Practcl object representing a compiled product
[call [cmd practcl::cheader] [arg "parent"] [opt [arg "keyvaluelist"]]]
A Practcl object representing an externally generated c header
[call [cmd practcl::csource] [arg "parent"] [opt [arg "keyvaluelist"]]]
A Practcl object representing an externally generated c source file
[call [cmd practcl::module] [arg "parent"] [opt [arg "keyvaluelist"]]]
A Practcl object representing a dynamically generated C/H/Tcl suite
[call [cmd practcl::submodule] [arg "parent"] [opt [arg "keyvaluelist"]]]
A Practcl object representing a dynamically generated C/H/Tcl suite, subordinate to a module
[list_end]
[vset CATEGORY tcloo c]
[include scripts/feedback.inc]
[manpage_end]
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added modules/practcl/practcl.tcl.