/[pengfork]/pengfork/src/modem/script.c
ViewVC logotype

Diff of /pengfork/src/modem/script.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by chupa, Fri Nov 29 15:17:45 2002 UTC revision 1.3 by chupa, Sat Nov 30 10:28:52 2002 UTC
# Line 33  Line 33 
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    
# Line 50  chat_send (string) Line 52  chat_send (string)
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  }  }
# Line 81  compare_elem (buffer, elem, result) Line 84  compare_elem (buffer, elem, result)
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;
# Line 130  do_else (others, result) Line 134  do_else (others, result)
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));  

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26