这是一个本人学习 csapp 的 learning 库

32 行
1006 B

  1. /*
  2. * CS:APP Data Lab
  3. */
  4. /* Declare different function types */
  5. typedef int (*funct_t) (void);
  6. typedef int (*funct1_t)(int);
  7. typedef int (*funct2_t)(int, int);
  8. typedef int (*funct3_t)(int, int, int);
  9. /* Combine all the information about a function and its tests as structure */
  10. typedef struct {
  11. char *name; /* String name */
  12. funct_t solution_funct; /* Function */
  13. funct_t test_funct; /* Test function */
  14. int args; /* Number of function arguments */
  15. char *ops; /* List of legal operators. Special case: "$" for floating point */
  16. int op_limit; /* Max number of ops allowed in solution */
  17. int rating; /* Problem rating (1 -- 4) */
  18. int arg_ranges[3][2]; /* Argument ranges. Always defined for 3 args, even if */
  19. /* the function takes fewer. Special case: First arg */
  20. /* must be set to {1,1} for f.p. puzzles */
  21. } test_rec, *test_ptr;
  22. extern test_rec test_set[];