home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / SOURCE / C_LIFE.H < prev    next >
C/C++ Source or Header  |  1996-06-04  |  1KB  |  62 lines

  1. #ifndef C_LIFE_H
  2. #define C_LIFE_H
  3. /*     $Id: c_life.h,v 1.2 1994/12/08 23:21:00 duchier Exp $     */
  4.  
  5. #include <stdio.h>
  6.  
  7.  
  8. /* Type for psi-terms, hidden from users */
  9. typedef void *PsiTerm;
  10.  
  11.  
  12. /* Replies to queries */
  13.  
  14. /* Input failed */
  15. #define WFno 0
  16.  
  17. /* Input succeeded */
  18. #define WFyes  1
  19.  
  20. /* Input succeeded with possibly more answers */
  21. #define WFmore 2
  22.  
  23.  
  24.  
  25.  
  26. /* A useful macro for goals which should succeed */
  27.  
  28. #define WFProve(A) { char *c=(A);if(!WFInput(c)) \
  29.   fprintf(stderr,"%s failed (%s, line %d)\n",c,__FILE__,__LINE__); }
  30.  
  31.  
  32.  
  33. /* Function declarations */
  34.  
  35. /* Submit a query */
  36. int WFInput(/* char *query */);
  37.  
  38. /* Get a variable's value */
  39. PsiTerm WFGetVar(/* char *name */);
  40.  
  41. /* Get the type of a psi-term */
  42. char *WFType(/* PsiTerm psi */);
  43.  
  44. /* Get the value of a psi-term if it's a double */
  45. double WFGetDouble(/* PsiTerm psi, int *ok */);
  46.  
  47. /* Get the value of a psi-term if it's a string */
  48. char *WFGetString(/* PsiTerm psi, int *ok */);
  49.  
  50. /* Count the features of a psi-term */
  51. int WFFeatureCount(/* PsiTerm psi */);
  52.  
  53. /* Get the value of a feature */
  54. PsiTerm WFGetFeature(/* PsiTerm psi, char *featureName */);
  55.  
  56. /* Get all the feature names as a NULL-terminated array of strings */
  57. char **WFFeatures(/* PsiTerm psi */);
  58.  
  59.  
  60.  
  61. #endif /* C_LIFE_H */
  62.