packet_queue.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. /*
  3. MSP430 Emulator
  4. Copyright (C) 2020 Rudolf Geosits (rgeosits@live.esu.edu)
  5. "MSP430 Emulator" is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. "MSP430 Emulator" is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <https://www.gnu.org/licenses/>.
  15. */
  16. #include "../../main.h"
  17. struct Packet {
  18. void *message;
  19. size_t length;
  20. uint8_t opcode;
  21. Packet *next;
  22. };
  23. void init_packet_queue (Emulator *emu);
  24. bool packet_queue_empty (Emulator *emu);
  25. void packet_enqueue (Emulator *emu, void *info, size_t len, uint8_t opcode);
  26. Packet packet_dequeue (Emulator *emu);
  27. void print_packet_queue (Emulator *emu);