Guest User

Untitled

a guest
Dec 11th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. RentalsResult rentalsCustomerAdd(Rentals rentals, int id, char* name){
  2.  
  3. Client newClient=clientCreate(name,id);
  4. if (!newClient){
  5. return RENTALS_OUT_OF_MEMORY;
  6. }
  7. SetResult result=setAdd(rentals->Clients, newClient);
  8. if (result==SET_ITEM_ALREADY_EXISTS){
  9. free(newClient);
  10. return RENTALS_CUSTOMER_ALREADY_EXISTS;
  11. }
  12. if (result==SET_OUT_OF_MEMORY){
  13. free(newClient);
  14. return RENTALS_OUT_OF_MEMORY;
  15. }
  16. return RENTALS_SUCCESS;
  17. }
Add Comment
Please, Sign In to add comment