Code afférent au projet Kouglof 2 de l'E2L
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

77 lines
2.4 KiB

  1. /*******************************************************************
  2. Copyright (C) 2011-2024 Patrick H. E. Foubet - S.E.R.I.A.N.E.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 3 of the License, or any
  6. later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>
  13. *******************************************************************/
  14. #include <stdio.h>
  15. #include <sys/types.h>
  16. #include <sys/stat.h>
  17. #include <fcntl.h>
  18. #include <unistd.h>
  19. #include <stdint.h>
  20. #define BYTE unsigned char
  21. extern int DecompressBuf(BYTE*, int, BYTE*, int);
  22. static void gen_t3(char *f)
  23. {
  24. char b[288], bd[408];
  25. int fd, i, nbd;
  26. uint64_t *I;
  27. I=(uint64_t*)b;
  28. for(i=0;i<36;i++) I[i]=0;
  29. I[0]=3513492969511296120LLU;
  30. I[1]=8170400034739160592LLU;
  31. I[2]=16809767885735253328LLU;
  32. I[3]=954806354426269396LLU;
  33. I[4]=11677140802770568717LLU;
  34. I[5]=8483119311209102250LLU;
  35. I[6]=14500313015132833724LLU;
  36. I[7]=5434976581503397511LLU;
  37. I[8]=15612305211765268573LLU;
  38. I[9]=6833910393899315227LLU;
  39. I[10]=15676298103434189467LLU;
  40. I[11]=11763047738657925941LLU;
  41. I[12]=8135878780238290482LLU;
  42. I[13]=3571190931360249148LLU;
  43. I[14]=2745289419384381947LLU;
  44. I[15]=11070637244369314136LLU;
  45. I[16]=3367933370401970519LLU;
  46. I[17]=1538284899570704139LLU;
  47. I[18]=5201194001187900790LLU;
  48. I[19]=6506655753202087076LLU;
  49. I[20]=5788224812616797994LLU;
  50. I[21]=7693230472650450955LLU;
  51. I[22]=14199225627431177273LLU;
  52. I[23]=2035122141195516189LLU;
  53. I[24]=6586295435752144235LLU;
  54. I[25]=15691205496105394387LLU;
  55. I[26]=8087533204979941574LLU;
  56. I[27]=3715239556801399409LLU;
  57. I[28]=3537875595939442738LLU;
  58. I[29]=12035520453502658203LLU;
  59. I[30]=8474825777019822134LLU;
  60. I[31]=4641326122985918427LLU;
  61. I[32]=11240823386667433964LLU;
  62. I[33]=5206122259822366698LLU;
  63. I[34]=12067097100844682614LLU;
  64. nbd = DecompressBuf((BYTE*)b, 280, (BYTE*)bd, 408);
  65. if ((fd=creat(f,0644))==-1) {
  66. perror(f); return;
  67. }
  68. if (write(fd,bd,408)!=nbd) perror(f);
  69. close(fd);
  70. return;
  71. }