templates.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2000,2001 Florian Sander
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program 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. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. // template content struct. Stores the content (html and command pointers)
  19. // of an template
  20. struct template_content {
  21. struct template_content *next;
  22. char *html;
  23. void (*command) (int, struct template_content *);
  24. int what;
  25. char *charpar1;
  26. float floatpar1;
  27. float floatpar2;
  28. int intpar1;
  29. struct template_content *subcontent;
  30. };
  31. struct template_commands {
  32. char *command;
  33. void (*targetfunc) (int, struct template_content *);
  34. void (*addfunc) (struct template_content *header, struct llist_2string *params, char *included_text);
  35. };
  36. struct template_command_list {
  37. struct template_command_list *next;
  38. struct template_commands *commands;
  39. };
  40. // template header struct. Stores the name and a pointer to the content
  41. // of an template.
  42. struct templates_template {
  43. struct templates_template *next;
  44. char *name;
  45. struct template_content *contents;
  46. };
  47. // template skin struct
  48. // contains the name of the skin and a pointer to the language-list
  49. struct template_skin {
  50. struct template_skin *next;
  51. char *name;
  52. char *desc;
  53. struct slang_header *slang;
  54. struct templates_template *templates;
  55. };
  56. static struct templates_template *templates_template_add_parsedcontent(struct templates_template *, char *, struct template_content *);
  57. //static int templates_template_expmem(struct templates_template *);
  58. static void templates_template_free(struct templates_template *);
  59. //static int templates_content_expmem(struct template_content *);
  60. static void templates_content_free(struct template_content *);
  61. static struct template_content *templates_content_load(char *);
  62. static struct template_content *templates_content_create();
  63. static struct template_content *templates_content_append(struct template_content *, struct template_content *);
  64. static struct template_content *templates_content_parse(char *);
  65. static struct template_content *templates_content_addhtml(struct template_content *, char *);
  66. static void templates_content_send(struct template_content *, int);
  67. static struct llist_2string *templates_content_parseparams(char *);
  68. static void template_send(struct template_skin *, char *, int);