diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-11 16:15:40 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-09-11 16:15:40 +0800 |
commit | e0e36814573a006183812fbcf71baabc7f861ed1 (patch) | |
tree | 0291ba6168e7c62adb510da73ab6857976a0197d | |
parent | 6971bcc78d28b6c2aded4b3f6a8fa8259523051f (diff) |
OsmoVTY: Add a initWith method to start the VTY...
The VTY code will be leaked..
-rw-r--r-- | OsmoVTY.st | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -1,6 +1,7 @@ "Copyright placeholder" CStruct subclass: vty_app_info [ + <category: 'libosmovty'> <comment: 'I represent the vty_app_info... some structs are wrong'> <declaration: #( (#name #string) @@ -30,20 +31,20 @@ Object subclass: OSMOVTY [ OSMOVTY class >> telnet_init: tall_context priv: priv port: aPort [ <cCall: 'telnet_init' returning: #int args: #(#cObject #cObject #int) > ] -] -Eval [ - | app_info | + OSMOVTY class >> initWith: aName version: aVersion license: aLicense port: aPort [ + | app_info | - OSMOVTY initialize. + app_info := vty_app_info new. + app_info name value: aName. + app_info version value: aVersion. + app_info copyright value: aLicense. - app_info := vty_app_info gcNew. - app_info name value: 'Smalltalk VTY', Character cr, Character lf. - app_info version value: '1.0.0', Character cr, Character lf. - app_info copyright value: 'GPL bla', Character cr, Character lf. - app_info inspect. + OSMOVTY vty_init: app_info. + OSMOVTY telnet_init: nil priv: nil port: 4444. + ] +] - OSMOVTY vty_init: app_info. - OSMOVTY vty_read_config_file: 'foo.cfg' priv: app_info. - OSMOVTY telnet_init: nil priv: nil port: 4444. +Eval [ + OSMOVTY initialize. ] |