1    /*******************************************************/
2    /*      "C" Language Integrated Production System      */
3    /*                                                     */
4    /*             CLIPS Version 6.30  08/22/14            */
5    /*                                                     */
6    /*            CONSTRAINT CHECKING HEADER FILE          */
7    /*******************************************************/
8 
9 /*************************************************************/
10 /* Purpose: Provides functions for constraint checking of    */
11 /*   data types.                                             */
12 /*                                                           */
13 /* Principal Programmer(s):                                  */
14 /*      Gary D. Riley                                        */
15 /*                                                           */
16 /* Contributing Programmer(s):                               */
17 /*                                                           */
18 /* Revision History:                                         */
19 /*                                                           */
20 /*      6.24: Added allowed-classes slot facet.              */
21 /*                                                           */
22 /*            Renamed BOOLEAN macro type to intBool.         */
23 /*                                                           */
24 /*      6.30: Removed conditional code for unsupported       */
25 /*            compilers/operating systems (IBM_MCW and       */
26 /*            MAC_MCW).                                      */
27 /*                                                           */
28 /*            Support for long long integers.                */
29 /*                                                           */
30 /*            Added const qualifiers to remove C++           */
31 /*            deprecation warnings.                          */
32 /*                                                           */
33 /*            Dynamic constraint checking for the            */
34 /*            allowed-classes constraint now searches        */
35 /*            imported modules.                              */
36 /*                                                           */
37 /*************************************************************/
38 
39 #ifndef _H_cstrnchk
40 #define _H_cstrnchk
41 
42 #ifndef _H_constrnt
43 #include "constrnt.h"
44 #endif
45 #ifndef _H_evaluatn
46 #include "evaluatn.h"
47 #endif
48 
49 #ifdef LOCALE
50 #undef LOCALE
51 #endif
52 
53 #ifdef _CSTRNCHK_SOURCE_
54 #define LOCALE
55 #else
56 #define LOCALE extern
57 #endif
58 
59 #define NO_VIOLATION                    0
60 #define TYPE_VIOLATION                  1
61 #define RANGE_VIOLATION                 2
62 #define ALLOWED_VALUES_VIOLATION        3
63 #define FUNCTION_RETURN_TYPE_VIOLATION  4
64 #define CARDINALITY_VIOLATION           5
65 #define ALLOWED_CLASSES_VIOLATION       6
66 
67    LOCALE intBool                        CheckCardinalityConstraint(void *,long,CONSTRAINT_RECORD *);
68    LOCALE intBool                        CheckAllowedValuesConstraint(int,void *,CONSTRAINT_RECORD *);
69    LOCALE intBool                        CheckAllowedClassesConstraint(void *,int,void *,CONSTRAINT_RECORD *);
70    LOCALE int                            ConstraintCheckExpressionChain(void *,struct expr *,
71                                                                      CONSTRAINT_RECORD *);
72    LOCALE void                           ConstraintViolationErrorMessage(void *,const char *,const char *,int,int,
73                                                                       struct symbolHashNode *,
74                                                                       int,int,CONSTRAINT_RECORD *,
75                                                                       int);
76    LOCALE int                            ConstraintCheckValue(void *,int,void *,CONSTRAINT_RECORD *);
77    LOCALE int                            ConstraintCheckDataObject(void *,DATA_OBJECT *,CONSTRAINT_RECORD *);
78 #if (! BLOAD_ONLY) && (! RUN_TIME)
79    LOCALE int                            ConstraintCheckExpression(void *,struct expr *,
80                                                                 CONSTRAINT_RECORD *);
81 #endif
82 #if (! RUN_TIME)
83    LOCALE intBool                        UnmatchableConstraint(struct constraintRecord *);
84 #endif
85 
86 #endif /* _H_cstrnchk */
87 
88 
89 
90