33 |
SCM |
SCM |
34 |
chat_success (void) |
chat_success (void) |
35 |
{ |
{ |
36 |
|
log(LOG_NOTICE, "Script: Chat success\n"); |
37 |
return SCM_BOOL_T; |
return SCM_BOOL_T; |
38 |
} |
} |
39 |
|
|
40 |
SCM |
SCM |
41 |
chat_failure (void) |
chat_failure (void) |
42 |
{ |
{ |
43 |
|
log(LOG_NOTICE, "Script: Chat failure\n"); |
44 |
return SCM_BOOL_F; |
return SCM_BOOL_F; |
45 |
} |
} |
46 |
|
|
52 |
int len; |
int len; |
53 |
|
|
54 |
text = gh_scm2newstr (string, &len); |
text = gh_scm2newstr (string, &len); |
55 |
|
log(LOG_NOTICE, "Script: Send %s\n", text); |
56 |
modem_sync_write (text, len); |
modem_sync_write (text, len); |
57 |
return SCM_UNDEFINED; |
return SCM_UNDEFINED; |
58 |
} |
} |
84 |
|
|
85 |
if (strstr (bufmin, textmin)) |
if (strstr (bufmin, textmin)) |
86 |
{ |
{ |
87 |
|
log(LOG_NOTICE, "Script: String '%s' matched\n", text); |
88 |
/* evaluate next elem */ |
/* evaluate next elem */ |
89 |
*result = gh_call1 (eval, gh_car (gh_cdr (elem))); |
*result = gh_call1 (eval, gh_car (gh_cdr (elem))); |
90 |
match = 1; |
match = 1; |
134 |
SCM *result; |
SCM *result; |
135 |
{ |
{ |
136 |
SCM elem; |
SCM elem; |
137 |
|
log(LOG_NOTICE, "Script: No string matched\n"); |
138 |
if (gh_length(others) > 0) |
if (gh_length(others) > 0) |
139 |
{ |
{ |
140 |
elem = gh_car(gh_reverse(others)); |
elem = gh_car(gh_reverse(others)); |