code: добавил curl_easy_init()

master
ShchipkovMY 2 лет назад
Родитель 0ae731f84d
Сommit 4e7ed15490

@ -13,7 +13,12 @@
<Option compiler="gcc" /> <Option compiler="gcc" />
<Compiler> <Compiler>
<Add option="-g" /> <Add option="-g" />
<Add directory="curl/include" />
</Compiler> </Compiler>
<Linker>
<Add library="libcurl.dll.a" />
<Add directory="curl/lib" />
</Linker>
</Target> </Target>
<Target title="Release"> <Target title="Release">
<Option output="bin/Release/lab_4" prefix_auto="1" extension_auto="1" /> <Option output="bin/Release/lab_4" prefix_auto="1" extension_auto="1" />
@ -32,7 +37,13 @@
<Add option="-Wall" /> <Add option="-Wall" />
<Add option="-fexceptions" /> <Add option="-fexceptions" />
</Compiler> </Compiler>
<Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="main.cpp" /> <Unit filename="main.cpp" />
<Unit filename="sr.cpp" />
<Unit filename="sr.h" />
<Unit filename="svg.cpp" />
<Unit filename="svg.h" />
<Extensions> <Extensions>
<lib_finder disable_auto="1" /> <lib_finder disable_auto="1" />
</Extensions> </Extensions>

@ -36,8 +36,21 @@ input_data(istream& in, bool prompt)
return ik; 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); curl_global_init(CURL_GLOBAL_ALL);
auto in = input_data(cin, true); auto in = input_data(cin, true);
auto bins = make_histogram(in.numbers, in.bin_count); auto bins = make_histogram(in.numbers, in.bin_count);

Загрузка…
Отмена
Сохранить