parity.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * This set_parity_print header
  3. * defines a routine designed to
  4. * compute and to set the parity
  5. * bit for a string of
  6. * characters from the standard
  7. * input, then output these
  8. * characters to the standard
  9. * output in hexadecimal form.
  10. * Copyright (C) 1989-2089 Sergey Sergeevich Tsybanov
  11. *
  12. * This set_parity_print program
  13. * is free software: you can
  14. * redistribute it and/or modify
  15. * it under the terms of the
  16. * GNU Affero General Public
  17. * License as published by the
  18. * Free Software Foundation,
  19. * either version 3 of the
  20. * License, or (at your option)
  21. * any later version.
  22. *
  23. * This set_parity_print program
  24. * is distributed in the hope
  25. * that it will be useful, but
  26. * WITHOUT ANY WARRANTY;
  27. * without even the implied
  28. * warranty of MERCHANTABILITY
  29. * or FITNESS FOR A PARTICULAR
  30. * PURPOSE. See the GNU Affero
  31. * General Public License
  32. * for more details.
  33. *
  34. * You should have received
  35. * a copy of the GNU Affero
  36. * General Public License
  37. * along with this
  38. * set_parity_print program.
  39. * If not, see
  40. * <https://www.gnu.org/licenses/>.
  41. */
  42. #ifndef PARITY_H
  43. #include <stdio.h>
  44. #include <stdlib.h>
  45. #define PARITY_H
  46. /*
  47. * The function setParityPrint first
  48. * computes and sets the parity bit
  49. * for the set of characters from
  50. * the standard input in the buffer
  51. * and prints the resulting
  52. * characters in hexadecimal form.
  53. * The function does not take any
  54. * arguments. The function returns
  55. * the character '\x00' on failure.
  56. * The function returns the
  57. * character '\x01' on success.
  58. */
  59. char setParityPrint( void);
  60. #endif