Advertisement
miki_brill

Untitled

Dec 19th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. /*hobby.h*/
  2.  
  3. //TODO: ADD COMMENTS TO EVERYTHING
  4.  
  5. #ifndef MAIN_
  6. #define MAIN_
  7.  
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include <stdbool.h>
  11. #include <stdlib.h>
  12. #include <assert.h>
  13. #include "set.h"
  14. #include "map.h"
  15. #include "list.h"
  16.  
  17. #endif /* MAIN_ */
  18.  
  19. #ifndef HOBBY_H_
  20. #define HOBBY_H_
  21.  
  22. #include "user.h"
  23.  
  24. typedef struct Hobby_t *HobbyData;
  25.  
  26. typedef enum {
  27. HOBBY_SUCCESS,
  28. HOBBY_OUT_OF_MEMORY,
  29. HOBBY_NULL_ARGUMENT,
  30. HOBBY_ALREADY_EXISTS,
  31. HOBBY_DOESNT_EXIST,
  32. HOBBY_NO_HOBBIES,
  33. HOBBY_NO_USERS,
  34. HOBBY_INVALID_PARAMETERS,
  35. HOBBY_USER_ALREADY_EXISTS,
  36. HOBBY_USER_DOESNT_EXISTS,
  37. HOBBY_USER_DOESNT_PARTICIPATE_HOBBY,
  38. HOBBY_USER_ALREADY_PARTICIPATES_HOBBY
  39. } HobbyResult;
  40.  
  41. HobbyResult hobbyAdd(Map hobbies, char* name);
  42.  
  43. HobbyResult hobbyRemove(Map hobbies, char* name);
  44.  
  45. HobbyResult hobbyJoin(Map hobbies ,Map users ,char* name ,int id);
  46.  
  47. HobbyResult hobbyLeave(Map hobbies ,Map users ,char* name ,int id);
  48.  
  49. HobbyResult hobbyReport(Map hobbies, int count);
  50.  
  51. HobbyResult hobbyReportByAge(Map hobbies, Map users);
  52.  
  53. int hobbyNumOfUsers(int id,Map hobbies);
  54.  
  55. MapDataElement copyHobbyData(MapDataElement element);
  56.  
  57. MapKeyElement copyHobbyKey(MapKeyElement key);
  58.  
  59. Set getPplLikeHobby(HobbyData hobby);
  60.  
  61. int getNumPplLikeHobby(HobbyData hobby);
  62.  
  63. void freeHobbyData(MapDataElement element);
  64.  
  65. void freeHobbyKey(MapKeyElement key);
  66.  
  67. int compareMapKeys(MapKeyElement key1, MapKeyElement key2);
  68. #endif /* HOBBY_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement