Browse Source

initial commit

body. hi
wes 5 years ago
commit
028212f2f1
10 changed files with 617 additions and 0 deletions
  1. 12 0
      .gitignore
  2. 3 0
      .vscode/settings.json
  3. 32 0
      .vscode/tasks.json
  4. 33 0
      Makefile
  5. 26 0
      basename.cpp
  6. 25 0
      cleanPDFtest.cpp
  7. 6 0
      lame.cpp
  8. 392 0
      libharuEXMP.cpp
  9. 2 0
      snippets/foreach-example.ps
  10. 86 0
      url2file.c

+ 12 - 0
.gitignore

@@ -0,0 +1,12 @@
+
+.vscode/c_cpp_properties.json
+cleanPDFtest/cleanPDFtest.exe
+cleanPDFtest/libhpdf.dll
+cleanPDFtest/libpng16.dll
+libharuEXMP/libhpdf.dll
+libharuEXMP/libpng16.dll
+libharuEXMP/libharuEXMP.exe
+libharuEXMP/libharuEXMP.exe.pdf
+url2file/libcurl.dll
+url2file/libpng16.dll
+url2file/url2file.exe

+ 3 - 0
.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "files.eol": "\n"
+}

+ 32 - 0
.vscode/tasks.json

@@ -0,0 +1,32 @@
+{
+    // See https://go.microsoft.com/fwlink/?LinkId=733558
+    // for the documentation about the tasks.json format
+    "version": "2.0.0",
+    "tasks": [
+        {
+        "label": "control shift B",
+        "type": "shell",
+        "command": "echo ${fileBasenameNoExtension}",
+        "dependsOn": ["default run executable"],
+        "group": {"kind": "build","isDefault": true}
+        },
+        {
+        "label": "default compile",
+        "type": "shell",
+        //"command": "g++ ${fileBasename} -L ${env:ow}/lib/ -I ${env:ow}/include/ -o ${fileBasenameNoExtension}/${fileBasenameNoExtension}.exe",
+        "command": "$(make clean f=${fileBasenameNoExtension}.exe) -and $(make ${fileBasenameNoExtension}.exe)",
+        "dependsOn": ["default directory"]
+        },
+        {
+        "label": "default run executable",
+        "type": "shell",
+        "command": "${fileBasenameNoExtension}/./${fileBasenameNoExtension}.exe",
+        "dependsOn": ["default compile"]
+        },
+        {
+        "label": "default directory",
+        "command": "$(test-path ${fileBasenameNoExtension}) -or $(mkdir ${fileBasenameNoExtension})",
+        "type": "shell"
+        }
+    ]
+}

+ 33 - 0
Makefile

@@ -0,0 +1,33 @@
+#  Windows did not have basename, so i took my extension grabber program from edabit and modified it
+#  to get the basename of a file without an extension. Basename is now installed in the windows
+#  System32 folder to be used ANYWHERE on the computer. 
+#
+#  make has a default recipe that uses the target & prequisite to build files
+#  % is used as a substitution for any variable. $< is used to substitute the prerequisite
+#  %.exe matches the default target rule which is what make is being asked to build.
+#  the variable can be accessed using $@
+#  : seperates the target from target prerequisite(s) %.cpp represents what is needed to build the exe
+#  "g++ $< -o $(basename $@)/$@" is the recipe used by Make to compile the exe
+#  the default build rule %.exe will follow this example: make lame.exe will generate the recipe
+#  g++ lame.exe -o lame/lame.exe 
+OUTPUT_FOLDER = $(basename $@)
+.PHONY : clean
+#  all: ; $(foreach v, $(.VARIABLE), $(info $(v) = $($(v))))
+#  info : 
+#  $(foreach v, $(.VARIABLE), $(info $(v) = $($(v))))
+%.exe : %.cpp
+	g++ $< -o $(basename $@)\$@
+
+clean :
+	del $(basename $(f))\$(f)
+#  cp was not working in powershell, it has to be copy. line endings matter for some programs
+#  to remove ambiguity from the copy command, quotes are necessary to put around the destination path to specify it was a directory and not a file
+url2file.exe : url2file.c url2file/libpng16.dll url2file/libcurl.dll
+	g++ $< -L $(ow)/lib/  -I $(ow)/include/ -lcurl -o $(basename $@)/$@
+libharuEXMP.exe : libharuEXMP.cpp libharuEXMP/libpng16.dll libharuEXMP/libhpdf.dll
+	g++ $< -L $(ow)/lib/  -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
+#  to read more about make variables - chapter 10.5.3, automatic variables in GNU Make manual
+%.dll : 
+	copy $(ow)\bin\$(@F) "$(@D)\"
+cleanPDFtest.exe : cleanPDFtest.cpp cleanPDFtest/libpng16.dll cleanPDFtest/libhpdf.dll
+	g++ $< -L $(ow)/lib/  -I $(ow)/include/ -lhpdf -o $(basename $@)/$@

+ 26 - 0
basename.cpp

@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <vector>
+#include <iostream>
+void echo(std::string a);
+std::string getBaseName(std::string s);
+int main(int argc, char *argv[]){
+    //  if user uses program incorrectly, print error message & exit.
+    if(argc < 2) {
+        printf("Usage: %s {filename.ext}\n", argv[0]);
+        return 1;
+    }
+    std::string userinput = argv[1];
+    echo(getBaseName(userinput));
+}
+void echo(std::string a){
+    printf("%s\n",a.c_str());
+}
+std::string getBaseName(std::string s) {
+    // getBaseName creates a substring up until the period character
+    for(int j=s.size();j>0;j--){
+        if(s[j]== '.'){
+            return s.substr(0,j);
+        }
+    }
+    return s.substr(0,0);
+}

+ 25 - 0
cleanPDFtest.cpp

@@ -0,0 +1,25 @@
+#include "hpdf.h"
+#include <cstdio>
+#include <setjmp.h>
+
+jmp_buf env;
+void __stdcall error_handler (HPDF_STATUS error_no, HPDF_STATUS detail_no, void *user_data)
+{
+    printf ("ERROR: error_no=%04X, detail_no=%u\n", (HPDF_UINT)error_no,
+                (HPDF_UINT)detail_no);
+    longjmp(env, 1);
+}
+int main (){
+    
+    HPDF_Doc pdf = HPDF_New (error_handler, NULL);
+
+    if (!pdf) {
+        printf ("ERROR: cannot create pdf object.\n");
+        return 1;
+    }
+
+    if (setjmp(env)) {
+        HPDF_Free (pdf);
+        return 1;
+    }
+}

+ 6 - 0
lame.cpp

@@ -0,0 +1,6 @@
+#include <iostream>
+int main (){
+    std::cout << "ha" << std::endl;
+    
+}
+  

+ 392 - 0
libharuEXMP.cpp

@@ -0,0 +1,392 @@
+/*
+ * << Haru Free PDF Library 2.0.0 >> -- text_demo.c
+ *
+ * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <setjmp.h>
+#include "hpdf.h"
+#include "grid_sheet.h"
+
+jmp_buf env;
+#define HPDF_DLL
+#ifdef HPDF_DLL
+void  __stdcall
+#else
+void 
+#endif
+error_handler (HPDF_STATUS   error_no,
+               HPDF_STATUS   detail_no,
+               void         *user_data)
+{
+    printf ("ERROR: error_no=%04X, detail_no=%u\n", (HPDF_UINT)error_no,
+                (HPDF_UINT)detail_no);
+    longjmp(env, 1);
+}
+
+void
+show_stripe_pattern  (HPDF_Page   page,
+                      HPDF_REAL   x,
+                      HPDF_REAL   y)
+{
+    HPDF_UINT iy = 0;
+
+    while (iy < 50) {
+        HPDF_Page_SetRGBStroke (page, 0.0, 0.0, 0.5);
+        HPDF_Page_SetLineWidth (page, 1);
+        HPDF_Page_MoveTo (page, x, y + iy);
+        HPDF_Page_LineTo (page, x + HPDF_Page_TextWidth (page, "ABCabc123"),
+                    y + iy);
+        HPDF_Page_Stroke (page);
+        iy += 3;
+    }
+
+    HPDF_Page_SetLineWidth (page, 2.5);
+}
+
+
+void
+show_description  (HPDF_Page          page,
+                   HPDF_REAL          x,
+                   HPDF_REAL          y,
+                   const char   *text)
+{
+    float fsize = HPDF_Page_GetCurrentFontSize (page);
+    HPDF_Font font = HPDF_Page_GetCurrentFont (page);
+    HPDF_RGBColor c = HPDF_Page_GetRGBFill (page);
+
+    HPDF_Page_BeginText (page);
+    HPDF_Page_SetRGBFill (page, 0, 0, 0);
+    HPDF_Page_SetTextRenderingMode (page, HPDF_FILL);
+    HPDF_Page_SetFontAndSize (page, font, 10);
+    HPDF_Page_TextOut (page, x, y - 12, text);
+    HPDF_Page_EndText (page);
+
+    HPDF_Page_SetFontAndSize (page, font, fsize);
+    HPDF_Page_SetRGBFill (page, c.r, c.g, c.b);
+}
+
+
+int main (int argc, char **argv)
+{
+    const char *page_title = "Text Demo";
+
+    HPDF_Doc  pdf;
+    HPDF_Font font;
+    HPDF_Page page;
+    char fname[256];
+
+    const char* samp_text = "abcdefgABCDEFG123!#$%&+-@?";
+    const char* samp_text2 = "The quick brown LOG jumps over the lazy WESLEHY.";
+    float tw;
+    float fsize;
+    int i;
+    int len;
+
+    float angle1;
+    float angle2;
+    float rad1;
+    float rad2;
+
+    float ypos;
+
+    strcpy (fname, argv[0]);
+    strcat (fname, ".pdf");
+
+    pdf = HPDF_New (error_handler, NULL);
+    if (!pdf) {
+        printf ("error: cannot create PdfDoc object\n");
+        return 1;
+    }
+
+    if (setjmp(env)) {
+        HPDF_Free (pdf);
+        return 1;
+    }
+
+    /* set compression mode */
+    HPDF_SetCompressionMode (pdf, HPDF_COMP_ALL);
+
+    /* create default-font */
+    font = HPDF_GetFont (pdf, "Helvetica", NULL);
+
+    /* add a new page object. */
+    page = HPDF_AddPage (pdf);
+
+    /* draw grid to the page */
+    //print_grid  (pdf, page);
+
+    /* print the lines of the page.
+    HPDF_Page_SetLineWidth (page, 1);
+    HPDF_Page_Rectangle (page, 50, 50, HPDF_Page_GetWidth(page) - 100,
+                HPDF_Page_GetHeight (page) - 110);
+    HPDF_Page_Stroke (page);
+    */
+
+    /* print the title of the page (with positioning center). */
+    HPDF_Page_SetFontAndSize (page, font, 24);
+    tw = HPDF_Page_TextWidth (page, page_title);
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, (HPDF_Page_GetWidth(page) - tw) / 2,
+                HPDF_Page_GetHeight (page) - 50, page_title);
+    HPDF_Page_EndText (page);
+
+    HPDF_Page_BeginText (page);
+    HPDF_Page_MoveTextPos (page, 60, HPDF_Page_GetHeight(page) - 60);
+
+    /*
+     * font size
+     */
+    fsize = 8;
+    while (fsize < 60) {
+        char buf[50];
+        int len;
+
+        /* set style and size of font. */
+        HPDF_Page_SetFontAndSize(page, font, fsize);
+
+        /* set the position of the text. */
+        HPDF_Page_MoveTextPos (page, 0, -5 - fsize);
+
+        /* measure the number of characters which included in the page. */
+        strcpy(buf, samp_text);
+        len = HPDF_Page_MeasureText (page, samp_text,
+                        HPDF_Page_GetWidth(page) - 120, HPDF_FALSE, NULL);
+
+        /* truncate the text. */
+        buf[len] = 0x00;
+
+        HPDF_Page_ShowText (page, buf);
+
+        /* print the description. */
+        HPDF_Page_MoveTextPos (page, 0, -10);
+        HPDF_Page_SetFontAndSize(page, font, 8);
+        #ifdef __WIN32__
+        _snprintf(buf, 50, "Fontsize=%.0f", fsize);
+        #else
+        snprintf(buf, 50, "Fontsize=%.0f", fsize);
+        #endif
+        HPDF_Page_ShowText (page, buf);
+
+        fsize *= 1.5;
+    }
+
+    /*
+     * font color
+     */
+    HPDF_Page_SetFontAndSize(page, font, 8);
+    HPDF_Page_MoveTextPos (page, 0, -30);
+    HPDF_Page_ShowText (page, "Font color");
+
+    HPDF_Page_SetFontAndSize (page, font, 18);
+    HPDF_Page_MoveTextPos (page, 0, -20);
+    len = strlen (samp_text);
+    for (i = 0; i < len; i++) {
+        char buf[2];
+        float r = (float)i / (float)len;
+        float g = 1 - ((float)i / (float)len);
+        buf[0] = samp_text[i];
+        buf[1] = 0x00;
+
+        HPDF_Page_SetRGBFill (page, r, g, 0.0);
+        HPDF_Page_ShowText (page, buf);
+    }
+    HPDF_Page_MoveTextPos (page, 0, -25);
+
+    for (i = 0; i < len; i++) {
+        char buf[2];
+        float r = (float)i / (float)len;
+        float b = 1 - ((float)i / (float)len);
+        buf[0] = samp_text[i];
+        buf[1] = 0x00;
+
+        HPDF_Page_SetRGBFill (page, r, 0.0, b);
+        HPDF_Page_ShowText (page, buf);
+    }
+    HPDF_Page_MoveTextPos (page, 0, -25);
+
+    for (i = 0; i < len; i++) {
+        char buf[2];
+        float b = (float)i / (float)len;
+        float g = 1 - ((float)i / (float)len);
+        buf[0] = samp_text[i];
+        buf[1] = 0x00;
+
+        HPDF_Page_SetRGBFill (page, 0.0, g, b);
+        HPDF_Page_ShowText (page, buf);
+    }
+
+    HPDF_Page_EndText (page);
+
+    ypos = 450;
+
+    /*
+     * Font rendering mode
+     */
+    HPDF_Page_SetFontAndSize(page, font, 32);
+    HPDF_Page_SetRGBFill (page, 0.5, 0.5, 0.0);
+    HPDF_Page_SetLineWidth (page, 1.5);
+
+     /* PDF_FILL */
+    show_description (page,  60, ypos,
+                "RenderingMode=PDF_FILL");
+    HPDF_Page_SetTextRenderingMode (page, HPDF_FILL);
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, ypos, "ABCabc123");
+    HPDF_Page_EndText (page);
+
+    /* PDF_STROKE */
+    show_description (page, 60, ypos - 50,
+                "RenderingMode=PDF_STROKE");
+    HPDF_Page_SetTextRenderingMode (page, HPDF_STROKE);
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, ypos - 50, "ABCabc123");
+    HPDF_Page_EndText (page);
+
+    /* PDF_FILL_THEN_STROKE */
+    show_description (page, 60, ypos - 100,
+                "RenderingMode=PDF_FILL_THEN_STROKE");
+    HPDF_Page_SetTextRenderingMode (page, HPDF_FILL_THEN_STROKE);
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, ypos - 100, "ABCabc123");
+    HPDF_Page_EndText (page);
+
+    /* PDF_FILL_CLIPPING */
+    show_description (page, 60, ypos - 150,
+                "RenderingMode=PDF_FILL_CLIPPING");
+    HPDF_Page_GSave (page);
+    HPDF_Page_SetTextRenderingMode (page, HPDF_FILL_CLIPPING);
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, ypos - 150, "ABCabc123");
+    HPDF_Page_EndText (page);
+    show_stripe_pattern (page, 60, ypos - 150);
+    HPDF_Page_GRestore (page);
+
+    /* PDF_STROKE_CLIPPING */
+    show_description (page, 60, ypos - 200,
+                "RenderingMode=PDF_STROKE_CLIPPING");
+    HPDF_Page_GSave (page);
+    HPDF_Page_SetTextRenderingMode (page, HPDF_STROKE_CLIPPING);
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, ypos - 200, "ABCabc123");
+    HPDF_Page_EndText (page);
+    show_stripe_pattern (page, 60, ypos - 200);
+    HPDF_Page_GRestore (page);
+
+    /* PDF_FILL_STROKE_CLIPPING */
+    show_description (page, 60, ypos - 250,
+                "RenderingMode=PDF_FILL_STROKE_CLIPPING");
+    HPDF_Page_GSave (page);
+    HPDF_Page_SetTextRenderingMode (page, HPDF_FILL_STROKE_CLIPPING);
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, ypos - 250, "ABCabc123");
+    HPDF_Page_EndText (page);
+    show_stripe_pattern (page, 60, ypos - 250);
+    HPDF_Page_GRestore (page);
+
+    /* Reset text attributes */
+    HPDF_Page_SetTextRenderingMode (page, HPDF_FILL);
+    HPDF_Page_SetRGBFill (page, 0, 0, 0);
+    HPDF_Page_SetFontAndSize(page, font, 30);
+
+
+    /*
+     * Rotating text
+     */
+    angle1 = 30;                   /* A rotation of 30 degrees. */
+    rad1 = angle1 / 180 * 3.141592; /* Calcurate the radian value. */
+
+    show_description (page, 320, ypos - 60, "Rotating text");
+    HPDF_Page_BeginText (page);
+    HPDF_Page_SetTextMatrix (page, cos(rad1), sin(rad1), -sin(rad1), cos(rad1),
+                330, ypos - 60);
+    HPDF_Page_ShowText (page, "ABCabc123");
+    HPDF_Page_EndText (page);
+
+
+    /*
+     * Skewing text.
+     */
+    show_description (page, 320, ypos - 120, "Skewing text");
+    HPDF_Page_BeginText (page);
+
+    angle1 = 10;
+    angle2 = 20;
+    rad1 = angle1 / 180 * 3.141592;
+    rad2 = angle2 / 180 * 3.141592;
+
+    HPDF_Page_SetTextMatrix (page, 1, tan(rad1), tan(rad2), 1, 320, ypos - 120);
+    HPDF_Page_ShowText (page, "ABCabc123");
+    HPDF_Page_EndText (page);
+
+
+    /*
+     * scaling text (X direction)
+     */
+    show_description (page, 320, ypos - 175, "Scaling text (X direction)");
+    HPDF_Page_BeginText (page);
+    HPDF_Page_SetTextMatrix (page, 1.5, 0, 0, 1, 320, ypos - 175);
+    HPDF_Page_ShowText (page, "ABCabc12");
+    HPDF_Page_EndText (page);
+
+
+    /*
+     * scaling text (Y direction)
+     */
+    show_description (page, 320, ypos - 250, "Scaling text (Y direction)");
+    HPDF_Page_BeginText (page);
+    HPDF_Page_SetTextMatrix (page, 1, 0, 0, 2, 320, ypos - 250);
+    HPDF_Page_ShowText (page, "ABCabc123");
+    HPDF_Page_EndText (page);
+
+
+    /*
+     * char spacing, word spacing
+     */
+
+    show_description (page, 60, 140, "char-spacing 0");
+    show_description (page, 60, 100, "char-spacing 1.5");
+    show_description (page, 60, 60, "char-spacing 1.5, word-spacing 2.5");
+
+    HPDF_Page_SetFontAndSize (page, font, 20);
+    HPDF_Page_SetRGBFill (page, 0.1, 0.3, 0.1);
+
+    /* char-spacing 0 */
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, 140, samp_text2);
+    HPDF_Page_EndText (page);
+
+    /* char-spacing 1.5 */
+    HPDF_Page_SetCharSpace (page, 1.5);
+
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, 100, samp_text2);
+    HPDF_Page_EndText (page);
+
+    /* char-spacing 1.5, word-spacing 3.5 */
+    HPDF_Page_SetWordSpace (page, 2.5);
+
+    HPDF_Page_BeginText (page);
+    HPDF_Page_TextOut (page, 60, 60, samp_text2);
+    HPDF_Page_EndText (page);
+
+    /* save the document to a file */
+    HPDF_SaveToFile (pdf, fname);
+
+    /* clean up */
+    HPDF_Free (pdf);
+
+    return 0;
+}

+ 2 - 0
snippets/foreach-example.ps

@@ -0,0 +1,2 @@
+Was using tasks.json and needed a way to iterate over a few file names
+$a = 'libhpdf.dll', 'libpng16.dll'; foreach($i in $a) { cp ${env:ow}/bin/$i C:/Users/bad-p/Desktop/Work` Folder/VS` CODE/test/ }

+ 86 - 0
url2file.c

@@ -0,0 +1,86 @@
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+/* <DESC>
+ * Download a given URL into a local file named page.out.
+ * </DESC>
+ */
+#include <stdio.h>
+#include <stdlib.h>
+//#include <unistd.h>
+#include "curl/curl.h"
+
+static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream)
+{
+  size_t written = fwrite(ptr, size, nmemb, (FILE *)stream);
+  return written;
+}
+
+int main(int argc, char *argv[])
+{
+  CURL *curl_handle;
+  //  sets file name to page.out
+  static const char *pagefilename = "page.out";
+  FILE *pagefile;
+//  if the number of arguments passed to the curl function is less than 2. it fails.
+  if(argc < 2) {
+    printf("Usage: %s <URL>\n", argv[0]);
+    return 1;
+  }
+
+  curl_global_init(CURL_GLOBAL_ALL);
+
+  /* init the curl session */
+  curl_handle = curl_easy_init();
+
+  /* set URL to get here */
+  curl_easy_setopt(curl_handle, CURLOPT_URL, argv[1]);
+
+  /* Switch on full protocol/debug output while testing */
+  curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 1L);
+
+  /* disable progress meter, set to 0L to enable it */
+  curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1L);
+
+  /* send all data to this function  */
+  curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, write_data);
+
+  /* open the file */
+  pagefile = fopen(pagefilename, "wb");
+  if(pagefile) {
+
+    /* write the page body to this file handle */
+    curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, pagefile);
+
+    /* get it! */
+    curl_easy_perform(curl_handle);
+
+    /* close the header file */
+    fclose(pagefile);
+  }
+
+  /* cleanup curl stuff */
+  curl_easy_cleanup(curl_handle);
+
+  curl_global_cleanup();
+
+  return 0;
+}