Skip to content

Commit 452d95a

Browse files
committed
Organize code structure
1 parent dfc22ac commit 452d95a

File tree

7 files changed

+19
-15
lines changed

7 files changed

+19
-15
lines changed

behavior/behavior.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
;; Parse ghost topic files.
2626
;; Ghost rules handle speech interactions.
2727

28-
(ghost-parse-file "test.top")
28+
(ghost-parse-file (string-append TOPDIR "behavior/" "test.top"))
2929

3030

3131
;; ----------------------------------------------

behavior/dr_roboto.scm renamed to dr-roboto.scm

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,25 @@
88

99
(setlocale LC_CTYPE "C")
1010

11-
(define PATH "../build/")
12-
;; (setenv "LTDL_LIBRARY_PATH" (string-append (getenv "LTDL_LIBRARY_PATH") ":"))
11+
(define-public TOPDIR (current-filename))
12+
(set! TOPDIR (string-drop-right TOPDIR
13+
(-
14+
(- (string-length TOPDIR) 1)
15+
(string-rindex TOPDIR #\/)
16+
))
17+
)
1318

14-
(load-extension "libdr_roboto" "init_dr_roboto")
1519

16-
(add-to-load-path "/usr/local/share/opencog/scm")
1720
(add-to-load-path ".")
18-
;(use-modules (ice-9 readline)) (activate-readline)
19-
(use-modules (opencog))
20-
(use-modules (opencog query))
21-
(use-modules (opencog exec))
22-
(load-from-path "opencog.scm")
21+
(add-to-load-path "./behavior/")
22+
(add-to-load-path "/usr/local/share/opencog/scm")
23+
24+
; Load C++ detector functions
25+
(load-extension "libdr_roboto" "init_dr_roboto")
2326

24-
(include "behavior.scm")
2527

28+
; Load behavior scripts
29+
(include "behavior/behavior.scm")
2630

2731
; TODO this should be changed to a practical i/o implementation.
2832
; this is just for testing

dr-roboto/dr-roboto.cpp.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ void say(char *data)
140140
tts.setSpeaker(FestivalTTS::speaker::DON);
141141
tts.speak(data);
142142
}
143-
SCM scm_say(SCM txt)
143+
144+
void scm_say(SCM txt)
144145
{
145146
say(scm_to_locale_string(txt));
146147
}

run.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/bash
2-
cd build
3-
export LTDL_LIBRARY_PATH=$(pwd)
4-
guile -l ../behavior/dr_roboto.scm
2+
export LTDL_LIBRARY_PATH=$(pwd)/build
3+
guile -l dr-roboto.scm
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)