Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. /*
  2. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  3. * --------------------------------------------------|| C Libraries ||--------------------------------------------------
  4. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  5. */
  6.  
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <sys/stat.h>
  12. #include <sys/timeb.h>
  13. #include <time.h>
  14. #include <unistd.h>
  15.  
  16.  
  17. /*
  18. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  19. * --------------------------------------------------|| Headers ||--------------------------------------------------
  20. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  21. */
  22.  
  23.  
  24. #include "config.h"
  25.  
  26.  
  27. /*
  28. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  29. * --------------------------------------------------|| Structures ||--------------------------------------------------
  30. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  31. */
  32.  
  33.  
  34. typedef struct card{
  35. char info[100];
  36. int id;
  37.  
  38. int priority;
  39. int local; /* 0 - To Do, 1 - Doing; 2 - Done */
  40.  
  41. struct timeb created;
  42. struct timeb deadline;
  43. struct timeb concluded;
  44.  
  45. int responsible;
  46. } Card;
  47.  
  48. typedef struct to_do *ToDoList;
  49. typedef struct to_do{
  50. Card *todo_card;
  51. struct to_do *next;
  52. }To_do;
  53.  
  54. typedef struct to_do *DoingList;
  55. typedef struct doing{
  56. Card *doing_card;
  57. struct doing *next;
  58. }Doing;
  59.  
  60. typedef struct to_do *DoneList;
  61. typedef struct done{
  62. Card *done_card;
  63. struct done *next;
  64. }Done;
  65.  
  66.  
  67. typedef struct people{
  68. char name[50];
  69. char email[50];
  70. int id;
  71.  
  72. int max_tasks;
  73. int current_tasks;
  74.  
  75. /* Lista ligada de n�s para os cart�es da pessoa */
  76. To_do *people_to_do_cards;
  77. Doing *people_doing_cards;
  78. Done *people_done_cards;
  79. } People;
  80.  
  81.  
  82. typedef struct people_node *PeopleList;
  83. typedef struct people_node {
  84. People person;
  85. PeopleList next;
  86. } People_node;
  87.  
  88.  
  89.  
  90. /*
  91. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  92. * --------------------------------------------------|| Variables ||--------------------------------------------------
  93. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  94. */
  95.  
  96.  
  97. /* FILES */
  98. FILE *flog;
  99. FILE *fpeople;
  100. FILE *fcards;
  101. FILE *fconfig;
  102.  
  103. /* MISC */
  104. char timenow[50];
  105.  
  106. /* TIME */
  107. time_t t;
  108. struct tm Time;
  109.  
  110. /* POINTERS */
  111.  
  112.  
  113.  
  114. /*
  115. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  116. * --------------------------------------------------|| Functions ||--------------------------------------------------
  117. * ------------------------------------------------------------------------------------------------------------------------------------------------------
  118. */
  119.  
  120.  
  121. /* FILES */
  122. int initFile(char *fname);
  123. int checkFile(char *fname);
  124.  
  125. /* MISC */
  126. void print(int n);
  127. char *timelog();
  128.  
  129. PeopleList make_list();
  130. void insert_people (PeopleList lista, People pessoa);
  131. void change_current_task (PeopleList lista, int num);
  132. void procura_lista (PeopleList lista, int chave, PeopleList *ant, PeopleList *actual);
  133. void printPeoplesList(PeopleList lista);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement