File:  [ELWIX - Embedded LightWeight unIX -] / libaitio / inc / aitio.h
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Feb 23 22:54:52 2010 UTC (14 years, 5 months ago) by misho
Branches: MAIN
CVS tags: HEAD
Initial revision

    1: /*************************************************************************
    2: * (C) 2010 AITNET ltd - Sofia/Bulgaria - <misho@aitbg.com>
    3: *  by Michael Pounov <misho@openbsd-bg.org>
    4: *
    5: * $Author: misho $
    6: * $Id: aitio.h,v 1.1 2010/02/23 22:54:52 misho Exp $
    7: *
    8: *************************************************************************/
    9: #ifndef __AITIO_H
   10: #define __AITIO_H
   11: 
   12: 
   13: // io_GetErrno() Get error code of last operation
   14: inline int io_GetErrno();
   15: // io_GetError() Get error text of last operation
   16: inline const char *io_GetError();
   17: 
   18: 
   19: /*
   20:  * ioPromptRead() Read data from input h[0] with prompt to output h[1]
   21:  * @h = file handles h[0] = input, h[1] = output, if NULL use stdin, stdout
   22:  * @csPrompt = Prompt before input, may be NULL
   23:  * @psData = Readed data
   24:  * @dataLen = Length of data
   25:  * return: 0 EOF; -1 error:: can`t read; >0 count of readed chars
   26: */
   27: int ioPromptRead(int *h, const char *csPrompt, char * __restrict psData, int dataLen);
   28: /*
   29:  * ioPromptPassword() Read password from input h[0] with prompt to output h[1]
   30:  * @h = file handles h[0] = input, h[1] = output, if NULL use stdin, stdout
   31:  * @csPrompt = Prompt before input, may be NULL
   32:  * @psPass = Readed password
   33:  * @passLen = Length of password
   34:  * @confirm = Confirm password, 0 - get password, !=0 Ask for confirmation
   35:  * return: 0 EOF; -1 error:: can`t read; >0 count of readed chars
   36: */
   37: int ioPromptPassword(int *h, const char *csPrompt, char * __restrict psPass, int passLen, int confirm);
   38: 
   39: /*
   40:  * ioRegexVerify() Function for verify data match in regex expression
   41:  * @csRegex = Regulare expression pattern
   42:  * @csData = Data for check and verify
   43:  * @startPos = Return start positions
   44:  * @endPos = Return end positions
   45:  * return: NULL not match or error; !=NULL begin of matched data
   46: */
   47: const char *ioRegexVerify(const char *csRegex, const char *csData, int *startPos, int *endPos);
   48: /*
   49:  * ioRegexGet() Function for get data match in regex expression
   50:  * @csRegex = Regulare expression pattern
   51:  * @csData = Data from get
   52:  * @psString = Returned string if match
   53:  * @strLen = Length of string
   54:  * return: 0 not match; >0 count of returned chars
   55: */
   56: int ioRegexGet(const char *csRegex, const char *csData, char * __restrict psString, int strLen);
   57: /*
   58:  * ioRegexReplace() Function for replace data match in regex expression with newdata
   59:  * @csRegex = Regulare expression pattern
   60:  * @csData = Source data
   61:  * @csNew = Data for replace
   62:  * return: NULL not match or error; !=NULL allocated new string, must be free after use!
   63: */
   64: char *ioRegexReplace(const char *csRegex, const char *csData, const char *csNew);
   65: 
   66: 
   67: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>