IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 1, 2012, 2:15:36 PM (14 years ago)
Author:
eugene
Message:

move myAssert, myAbort, OHANA_ASSERT into libohana; add features to parse time and ints in space and csv lines (used by opihi/read functions); add abspath function; move rconnect into libohana

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/include/ohana.h

    r32632 r33646  
    215215*/
    216216# define OHANA_WHITESPACE(c)(((c) == 0x09) || ((c) == 0x0a) || ((c) == 0x0b) || ((c) == 0x0b) || ((c) == 0x0c) || ((c) == 0x0d) || ((c) == 0x20))
     217# define OHANA_ASSERT(LOGIC,...) { if (!(LOGIC)) { fprintf (stderr, __VA_ARGS__); abort(); } }
     218# define myAssert(LOGIC,...) { if (!(LOGIC)) { fprintf (stderr, __VA_ARGS__); abort(); } }
     219# define myAbort(MSG) { fprintf (stderr, "%s\n", MSG); abort(); }
    217220
    218221// sorting is now defined as a macro call
     
    236239char   *strncreate             PROTO((char *string, int n));
    237240int     scan_line              PROTO((FILE *f, char *line));
     241int     scan_line_maxlen       PROTO((FILE *f, char *line, int maxlen));
    238242int     dparse                 PROTO((double *X, int NX, char *line));
    239243int     dparse_csv             PROTO((double *X, int NX, char *line));
     244int     iparse                 PROTO((int *X, int NX, char *line));
     245int     iparse_csv             PROTO((int *X, int NX, char *line));
     246int     tparse                 PROTO((time_t *X, int NX, char *line));
     247int     tparse_csv             PROTO((time_t *X, int NX, char *line));
    240248int     fparse                 PROTO((float *X, int NX, char *line));
    241249int     get_argument           PROTO((int argc, char **argv, char *arg));
     
    256264int     check_dir_access       PROTO((char *path, int verbose));
    257265int     check_file_exec        PROTO((char *filename));
     266char   *abspath                PROTO((char *oldpath, int maxlength));
    258267
    259268/* in glockfile.c */
     
    323332off_t   Fwrite                 PROTO((void *ptr, off_t size, off_t nitems, FILE *f, char *type));
    324333
     334char   *memstr                 PROTO((char *m1, char *m2, int n));
     335int     write_fmt              PROTO((int fd, char *format, ...));
     336
    325337char   **isolate_elements      PROTO((int argc, char **argv, int *nstack));
    326338
     
    332344// gprint gets a stub implementation in libohana. opihi implements the real one.
    333345int    gprint (gpDest dest, char *format, ...);
     346
     347// rconnect is used to run remote programs with a pipe for communication
     348typedef enum {
     349  RCONNECT_ERR_NONE    = 0,
     350  RCONNECT_ERR_EXEC    = 1,
     351  RCONNECT_ERR_PIPE    = 2,
     352  RCONNECT_ERR_CONNECT = 3,
     353} RconnectErrors;
     354
     355void rconnect_set_timeout (int timeout);
     356int rconnect (char *command, char *hostname, char *shell, int *stdio, int *errorInfo, int doHandshake);
    334357
    335358/*
Note: See TracChangeset for help on using the changeset viewer.