~ampelbein/ubuntu/oneiric/heartbeat/lp-770743

« back to all changes in this revision

Viewing changes to include/stonith/expect.h

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2010-02-17 21:59:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20100217215918-06paxph5do4saw8v
Tags: 3.0.2-0ubuntu1
* New upstream release
* Drop hard dep on pacemaker for heartbet; moved to Recommends
* debian/heartbeat.install:
  - follow upstream changes
* debian/control:
  - added docbook-xsl and xsltproc to build depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Expect simple tokens.  Simple expect infrastructure for STONITH API
3
 
 *
4
 
 * Copyright (c) 2000 Alan Robertson <alanr@unix.sh>
5
 
 *
6
 
 * This library is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU Lesser General Public
8
 
 * License as published by the Free Software Foundation; either
9
 
 * version 2.1 of the License, or (at your option) any later version.
10
 
 * 
11
 
 * This library is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
 * Lesser General Public License for more details.
15
 
 * 
16
 
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with this library; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 
 *
20
 
 */
21
 
 
22
 
#ifndef __EXPECT_H
23
 
#       define __EXPECT_H
24
 
/*
25
 
 *      If we find any of the given tokens in the input stream,
26
 
 *      we return it's "toktype", so we can tell which one was
27
 
 *      found.
28
 
 *
29
 
 */
30
 
 
31
 
struct Etoken {
32
 
        const char *    string;         /* The token to look for */
33
 
        int             toktype;        /* The type to return on match */
34
 
        int             matchto;        /* Modified during matches */
35
 
};
36
 
 
37
 
int ExpectToken(int fd
38
 
,       struct Etoken * toklist /* List of tokens to match against */
39
 
                                /* Final token has NULL string */
40
 
,       int to_secs             /* Timeout value in seconds */
41
 
,       char * buf              /* If non-NULL, then all the text
42
 
                                 * matched/skipped over by this match */
43
 
,       int maxline,
44
 
,       int debug);             /* debug level */
45
 
 
46
 
 
47
 
/*
48
 
 *      A handy little routine.  It runs the given process
49
 
 *      with it's standard output redirected into our *readfd, and
50
 
 *      its standard input redirected from our *writefd
51
 
 *
52
 
 *      Doing this with all the pipes, etc. required for doing this
53
 
 *      is harder than it sounds :-)
54
 
 */
55
 
 
56
 
int StartProcess(const char * cmd, int* readfd, int* writefd);
57
 
 
58
 
#ifndef EOS
59
 
#       define  EOS '\0'
60
 
#endif
61
 
#endif /*__EXPECT_H*/