From 4e7ed15490324fdbd91dbcc4308f8affc0a0755c Mon Sep 17 00:00:00 2001
From: ShchipkovMY <ShchipkovMY@mpei.ru>
Date: Wed, 13 Sep 2023 16:54:37 +0300
Subject: [PATCH] =?UTF-8?q?code:=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?=
 =?UTF-8?q?=D0=BB=20curl=5Feasy=5Finit()?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lab_4.cbp | 11 +++++++++++
 main.cpp  | 15 ++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/lab_4.cbp b/lab_4.cbp
index 473f2ba..5a88056 100644
--- a/lab_4.cbp
+++ b/lab_4.cbp
@@ -13,7 +13,12 @@
 				<Option compiler="gcc" />
 				<Compiler>
 					<Add option="-g" />
+					<Add directory="curl/include" />
 				</Compiler>
+				<Linker>
+					<Add library="libcurl.dll.a" />
+					<Add directory="curl/lib" />
+				</Linker>
 			</Target>
 			<Target title="Release">
 				<Option output="bin/Release/lab_4" prefix_auto="1" extension_auto="1" />
@@ -32,7 +37,13 @@
 			<Add option="-Wall" />
 			<Add option="-fexceptions" />
 		</Compiler>
+		<Unit filename="histogram.cpp" />
+		<Unit filename="histogram.h" />
 		<Unit filename="main.cpp" />
+		<Unit filename="sr.cpp" />
+		<Unit filename="sr.h" />
+		<Unit filename="svg.cpp" />
+		<Unit filename="svg.h" />
 		<Extensions>
 			<lib_finder disable_auto="1" />
 		</Extensions>
diff --git a/main.cpp b/main.cpp
index 79f593a..db46ddf 100644
--- a/main.cpp
+++ b/main.cpp
@@ -36,8 +36,21 @@ input_data(istream& in, bool prompt)
     return ik;
 }
 
-int main()
+int main(int argc, char* argv[])
 {
+    if (argc > 1){
+
+        CURL*curl = curl_easy_init();
+
+        if (curl)
+        {
+            CURLcode res;
+            curl_easy_setopt(curl, CURLOPT_URL, argv[1]);
+            res = curl_easy_perform(curl);
+            curl_easy_cleanup(curl);
+        }
+        return 0;
+    }
     curl_global_init(CURL_GLOBAL_ALL);
     auto in = input_data(cin, true);
     auto bins = make_histogram(in.numbers, in.bin_count);