main.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*
  2. Copyright (c) 2010, Florian Reuter
  3. All rights reserved.
  4. Redistribution and use in source and binary forms, with or without
  5. modification, are permitted provided that the following conditions
  6. are met:
  7. * Redistributions of source code must retain the above copyright
  8. notice, this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. notice, this list of conditions and the following disclaimer in
  11. the documentation and/or other materials provided with the
  12. distribution.
  13. * Neither the name of Florian Reuter nor the names of its contributors
  14. may be used to endorse or promote products derived from this
  15. software without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  19. FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  20. COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  21. INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  22. BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  24. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  25. STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  26. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  27. OF THE POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. #include <opc/opc.h>
  30. #include <stdio.h>
  31. /** @mainpage libopc
  32. This is the API documentation of the libopc project.
  33. API headers can be found in the "Files" section.
  34. Samples can be found in the "Examples" section.
  35. */
  36. /** \example opc_helloworld.c
  37. Demonstrates the the use of \ref opcInitLibrary and \ref opcFreeLibrary.
  38. */
  39. /** \example opc_dump.c
  40. Demonstrates the the use of \ref opcContainerOpen, \ref opcContainerClose and \redf opcContainerDump.
  41. */
  42. /** \example opc_extract.c
  43. Demonstrates binary input stream access to an OPC container.
  44. */
  45. /** \example opc_zipwrite.c
  46. Demonstrates low level ZIP write functionality as needed by the high level opcContainer API.
  47. */
  48. /** \example opc_zipread.c
  49. Demonstrates low level ZIP read functionality as needed by the high level opcContainer API.
  50. */
  51. /** \example opc_zipextract.c
  52. Demonstrates low level ZIP read functionality as needed by the high level opcContainer API.
  53. */
  54. /** \example opc_xml.c
  55. Demonstrates basic non-MCE XML read access.
  56. */
  57. /** \example opc_xml2.c
  58. Demonstrates basic non-MCE XML read access via helper macros.
  59. */
  60. /** \example mce_read.c
  61. Demonstrates basic MCE proprocessing.
  62. */
  63. /** \example mce_write.c
  64. Demonstrates basic MCE proprocessing.
  65. */
  66. /** \example opc_image.c
  67. Sample program which will extract all images from an OPC container.
  68. E.g. opc_dump hello.pptx will extract all pictures from "hello.pptx" in the current directory.
  69. The call opc_dump hello.pptx C:\Users\flr\Pictures will extract all pictures from "hello.pptx" in the directory "C:\Users\flr\Pictures".
  70. */
  71. /** \example opc_mem.c
  72. Demonstrates the the use of \ref opcContainerOpenMem, i.e. how to use "in-memory" containers.
  73. */
  74. /** \example opc_part.c
  75. Demonstrates how to dump a part from an OPC container. Ussage opc_dump [container] [part-name]. E.g. opc_dump sample.docx "word/document.xml".
  76. */
  77. /** \example opc_relation.c
  78. Demonstrates how to traverse all relations in an OPC container using the API.
  79. */
  80. /** \example opc_text.c
  81. Sample program which will extract all text form an Word document and dump it as HTML.
  82. */
  83. /** \example opc_trim.c
  84. Opens an OPC containers and saves it back in "trimming" mode, which will reduce the size as much as possible.
  85. */
  86. /** \example opc_type.c
  87. Demonstrate how to corretly get the type of an Office document.
  88. */
  89. /** \example opc_generate.c
  90. Sample program which will read an OPC container and generate a "C" file which uses the API to generate the passed container.
  91. */
  92. int main( int argc, const char* argv[] )
  93. {
  94. if (OPC_ERROR_NONE==opcInitLibrary()) {
  95. printf("libopc as well as zlib and libxml2 are ready to use.\n");
  96. opcFreeLibrary();
  97. return 0;
  98. } else {
  99. printf("error initializing libopc.\n ");
  100. return 1;
  101. }
  102. }