Are there any complete examples of using winhttp in C on windows? - c

I can find tons of examples in C++, but nothing that's written in just C. I am trying to connect to an http server, download the returned data, and then save it to a file. Is there a better way to do it on Windows? Should I not be using WinHttp or WinInet? Windows documentation for C seems to be extremely lacking on the internet. Thank you for your help.

http://www.codeguru.com/cpp/i-n/internet/http/article.php/c6237
also this looks good and in C
http://msdn.microsoft.com/en-us/library/aa384270(v=VS.85).aspx#Downloading_resource
This question has also been asked and answered here
How to download a file with WinHTTP in C/C++?

Related

quarkus supports batch implementation (JSR352)

Is Quarkus supports batch implementation like (JSR352). I tried to search few examples and i couldnt find much.
Thanks in advance.
The same question is already posted. Its in the road map of Quarkus. Currently its not yet implemented.
Is Java EE Batch (JSR 352) going to be part of quarkus?

node.js powered by C libxml & libxslt

Unfortunately I'm neither able to write C-code nor to implement available (and proven) libraries like the common libxml and libxslt used by PHP. I wonder if it is so hart to implement them in node.js? As far as I know C libraries could (easily) be implemented for a usage in node.js.
I'm looking forward to see something like this http://www.w3schools.com/xsl/xsl_client.asp on the server's JS.
I'd love to contribute and migrate / implement these two libs into node. Does anyone know how to do this or is there a quick link explaining this? Remember I've never worked with C, but I'm a PHP-, Java- and JS-developer for about 8 years now.
Maybe someone wants to join me and realize this.
If you take a look at the node_xslt source code. You can see it's already interacting with libxslt.
So either use that module, or draw inspiration from it and improve it.
For future reference I used the npm search registry and searched for "xslt"

Is there a repository of C libraries? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Why there is not a comprehensive c archive network?
Like Python has a Cheeseshop and Perl has CPAN?
Google results have a lot of C++ results and I am looking for purely C libraries.
PS: Looking for *nix libraries
Yep. SourceForge, Codeplex, Github, and Google. Also, your distro's packages, if you are on Linux.
Not really, no. Google is really your best friend. Since C doesn't have a standardized body running the language in the same way as, say, Python, there is no central place for packages and marketing material.
Your best bet really is your local Linux distribution - Linux applications generally make heavy use of many layers of libraries, which you can use as a reference.
Well, there's CCAN (although I'm not sure how good it is - never really used it).

How to create dynamic HTML pages using C? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
How to create DHTML pages using C language? Please give me some web site where I can find the step by step procedure to create DHTML pages using C.
Regards,
NM
Assuming your application will be executed as a CGI of apache or another HTTP server, you only need to print the HTTP headers and the content of the page to stdout.
The minimal headers expected are:
Content-type: text/html\r\n\r\n
(do not forget the double \r\n)
then write your page.
C? Not so suitable language for that.
But, someone did CMS with that, called Tokyopromenade, Opensource
http://1978th.net/tokyopromenade/
Just for your information
For using C to generate (D|X)HTML, you will have to write CGI programs. CGI programs should output the Content-type: text/html or equivalent before HTML is output.
After that, you can upload the program to the cgi-bin/ or equivalent directory. Remember to set the execution bit on the file.
Have your C program write Content-type: text/html\n\n to stdout before anything else, and you can then generate whatever HTML you wish. The empty line is critical!
"DHTML" is mostly used to describe client-side functionality, and you use Javascript for that.
But if you mean dynamic web pages (server-side functionality), and you must use C, you can use CGI (Common Gateway Interface, RFC3875):
http://hoohoo.ncsa.illinois.edu/cgi/primer.html
However, using C for web pages is not a good choice. It would be better to use a scripting language like Python or Ruby, and either study the CGI support in that language or go for a framework like Ruby on Rails.
To create dynamic webpages using C, there are a couple of ways you can go about this (this is not an exhaustive list):
You use CGI, an old standard for creating dynamic webpages. The way this works is that for each request to your site, your webserver creates a new process, invokes your program (passing information about the request to your program using environmental variables and stdin), and feeds the output from your program to the web browser. As other replies have noted, CGI requires your program to specify the HTTP response headers to the browser.
If you're interesting in using C for performance reasons when developing webpages (this is sort of diving into insanity), CGI clearly isn't an option. If you're this much of a masochist, you should probably look into linking with FastCGI or creating an Apache module. In fact, since you like pain this much, you might as well just start with thttpd and insert your code where needed.
Good luck. You might also consider seeing a shrink.
Search "C library for web applications" here on stackoverflow, it has some good answers.
I haven't tried it, maybe someone would find it usefull: klone.
It is a framework for building standalone web serververs and html templating with
embedded C.

Any Online compiler you know for C or other languages? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Any online C compiler that you know which can do the following:
Compile and execute the C programs online
File handling
System functions like exec(), system(), fork()
Or any compiler which does not need installation procedure (I mean that you can just copy paste a folder to run the compiler easily)
Note:Please do not propose Turbo C.I know some online compilers at codepad.org (gcc).
I was using codeide.com but its out of service now I think.
And as asked above online compiler will be a best advice that you can give for me.
My environment is Windows ... Thanks in advance.
Any advices on other Language compilers are also invited
Just install something like tcc. It's seriously not worth messing around with an online compiling site if you're going to be compiling files on any sort of regular basis.
Comeau has an online C/C++ compiler, but it's mainly to evaluate their compiler.
or cygwin
I'd rather recommend to install cygwin, you'll get an unix-like environment, with gcc. Then setting up a Makefile - or even just a shell script - to be able to compile is not a big deal.
You asked for other languages: Here's one for Lisp (not a compiler, but an interpreter)
Online Lisp interpreter in Flash
rextester
Maybe my answer is a bit late, but we have created an online compiler and IDE where you can run and create your files using just a browser.
At the moment we support a few languages (C, C++, ObjC, Java, Pascal, Fortran) and a simple file system, but we will enable many more features for better coding and debugging during the near future.
All the features offered at the moment are completely free and there is no registration needed (you can register though in order to keep your files online).
You can try our service here: www.sourcelair.com
DJGPP Public Access Cross-Compiler (C/C++, DOS32, based on GCC)
yet another online compiler:
http://cmpe150-1.cmpe.boun.edu.tr
It supports sytax highlight, indentation etc. I wrote it as a part of my MS thesis
PS: did not test fork command
We have another compiler for C and C++ here: http://www.codepad.org/
I have nothing for C. For other languages, this is a ruby interpreter. But honestly the best online development environment is the browser itself. Javascript is an advanced language. Combined with technologies like CSS and DHTML and frameworks like jQuery or Prototype you can build graphics applications. It is not hard to find debuggers (like Firebug) also.
Of course you can't interact with the file system. To overcome this you could write a plug-in for a browser (notably Firefox). There are many resources available for this and although it is not as straight forward as pure javascript, it is easier than most people believe.
For Python and Sage, try out http://live.codenode.org. It is also open source under the BSD license, so you can be download and run it from your own computer, more info is here: http://codenode.org
just a sudgestion.
I do not know why you do not want simply to install a compiler. However did you considered the possibility of using a portable one?
http://en.wikipedia.org/wiki/Portable_C_Compiler
best,
Ste
One of the better lists for C++ is isocpp Getting Started page. Unfortunately Cameau's seems to be disabled for now. LiveWorkspace has been in maintenance mode for a while and it is not clear when it is coming back, which is unfortunate since it has a simple interface and when it was working allowed you to switch between gcc, clang and intel very easily.
Of the ones that are left Coliru is the most powerful, you have a full command line available and you can save files and therefore uses multiple files in your project.
The isocpp list somehow is missing codepad which although rather primitive along with Coliru allows you to use boost.
Coliru, ideone and codepad all support many other languages as well. The list of languages supported by ideone and codepad is pretty large and is obvious on the main pages with Coliru you don't have a list but besides C and C++ it also supports python, perl and ruby.

Resources