diff options
author | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:56:41 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-11-04 11:59:33 -0800 |
commit | d577d991b97ae2b5ee1af23641bcffc3f83af5b2 (patch) | |
tree | 590639d50205d1bcfaff2a7d2dc6ebf3f373c7ed /iup/src/iup_maskparse.h |
Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux.
Diffstat (limited to 'iup/src/iup_maskparse.h')
-rwxr-xr-x | iup/src/iup_maskparse.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/iup/src/iup_maskparse.h b/iup/src/iup_maskparse.h new file mode 100755 index 0000000..a12a7fa --- /dev/null +++ b/iup/src/iup_maskparse.h @@ -0,0 +1,46 @@ +/** \file + * \brief Mask internal functions + * + * See Copyright Notice in "iup.h" + */ + +#ifndef __IUP_MASKPARSE_H +#define __IUP_MASKPARSE_H + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef struct _ImaskParsed +{ + char ch; + int command; + int next1; + int next2; +} ImaskParsed; + +typedef int (*iMaskMatchFunc) (char which_one, long next_pos, long capture_pos, const char *text, void* user_data); + +/* Parse the mask and if it is ok create and returns the internal structure. */ +int iupMaskParse(const char* mask, ImaskParsed** imk); + +/* Do the pattern matching on the given text. */ +int iupMaskMatch(const char* text, ImaskParsed* imk, long start, iMaskMatchFunc mask_func, void* user_data, char *addchar, int icase); + +/* Change a control character. */ +int iupMaskSetChar(int char_number, char new_char); + +/* iupMaskMatch return codes */ +#define IMASK_PARSE_OK 0 /* No error */ +#define IMASK_NOMATCH -1 /* no match */ +#define IMASK_MEM_ERROR -2 /* memory error */ +#define IMASK_PARSE_ERROR -3 /* parser error */ +#define IMASK_PARTIALMATCH -4 /* partial match */ + + +#ifdef __cplusplus +} +#endif + +#endif |