Why there is not a comprehensive c archive network? [closed] - c

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 3 years ago.
Improve this question
There are websites as collections of python/perl/R libraries. Why there is not an equivalent one for c?
I searched the internet and only found a small website calling itself CCAN. There are only a few libraries in that website.
If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?
Thanks.

If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?
No known to me outside of CCAN.
The problem here is that C doesn't have any even loose specification for libraries. Compare that to e.g. packages in Java or Python or Perl.
And even then, C is quite bare bone itself leaving many things for libraries to implement themselves. I/O abstraction, memory management, multi-threading, OS integration - minor differences in how libraries work with any of the resources might make them incompatible, preventing them being used in the same project.
I have seen in past some 3rd party commercial libraries for C, covering quite a lot of functionality, but frankly I can't recommend them and honestly do not even remember their names - for they often were causing more problems than really helping. (OK, I'm lying: they were rarely causing unsolvable problems: it's the numerous workarounds which were causing often the problems later.)
Otherwise, for C you might want to check the Glib and (do not get me wrong) to also check the C standard as in my experience few actually know many of the utilities already in the standard library itself. And well, Google is your friend: lots of public domain code is there for you to simply throw as-is into your project.

I don't know of anybody who's studied this in detail, though I would be curious to see the studies. I'm sure it has to do with the nature of the C programming community itself.
I think a large (maybe the primary?) part of the answer is: before the WWW, there was no such thing as a single resource for obtaining libraries for a particular language. People obtained their libraries, and knowledge of libraries, via many different means: through BBSes, mailing lists, newsgroups, and periodicals. The C community dates from this time, of course, and I've noticed a similar difference in culture regarding other languages from this period and before.
I think another part of the answer has to do with the general decentralization of C culture itself. There's no one C compiler, no one C development community, that serves as a hub and a potential point for projects to attach themselves to. And the C development community is huge, which further drives this decentralization and splintering.
In the case of C libraries, OS distributions actually do a pretty good job of collecting useful C/C++ libraries out there. (With the unfortunate exception of Windows, I believe.) They do a better job in these languages than most others, probably since C and C++ are such important systems languages on these platforms.
As far as CCAN goes, I think what would make a more worthwhile project, given the number of different distributors of C code out there, is to have a single site that links to the various libraries on their own native sites, rather than trying to get them to upload straight to CCAN. I think there's a use for this in and apart from Google, which will give you a lot of noise if you try just browsing for libraries. The question is, would you and the bulk of the C communities out there embrace such a site if it existed?
You might be amused to see how CPAN got its start: http://www.brainbell.com/tutors/Perl/CPAN_History.htm
CPAN evolved just as its community did. So the same thing could happen in the C/C++ world if the leadership and interest is there. But it hasn't happened yet.

use http://www.google.com/codesearch?q=lang:%22C%22 variant of http://www.google.com/codesearch
=> i.e. add lang:"C" in the search query

Use these web-sites:
Debian "Testing": Subsection libs
The Free Country: Free C/C++ Libraries
Free Software Directory: Category/Library
SourceForge Software Map: Software Development/Libraries/C
Upstream Tracker: List of C/C++ Shared Libraries

There is a Maven-like repository and dependency management system called Biicode.
There isn't a huge collection of libraries on there yet, but you can add forks of open source projects yourself or inform original authors about it.
EDIT: the company behind biicode is dead
EDIT2: the spiritual successor seems to be conan.io

There is a C package manager which looks promising called CLib:
github:
https://github.com/clibs/clib
tutorial:
https://dev.to/noah11012/clibs-a-package-manager-for-c-4jmi

Why do you need a website for a collection of C libraries? Just use Google.

Related

Going from console to win32 applications [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 7 years ago.
Improve this question
After some time coding in c in a simple console, I decided I wanted to try and code an actual Win32 application. However, upon selecting the option, the sheer amount of unknown code that surfaced on my IDE (Visual Studio 2013) just to open a blank window was overwhelming, as I don't understand half of it's meaning or even what to do, since, even simple printf commands yield no result... Can someone point me to a way to understand the differences between console and application? Or at least someway I can insert my current coding knowledge in an application environment?
Working with the Windows API can be quite the experience for a newcomer. The act of opening a window does, certainly, involve a lot of boilerplate code. The good news is a lot of that boilerplate rarely changes, and when it does it'll be for very special circumstances that you can go research. That's why Visual Studio spits the whole mess out for you by default.
There are plenty of resources to learn with, including Microsoft itself: https://msdn.microsoft.com/en-us/library/bb384843.aspx
To help situate you, understand that a lot of what you're looking at that's probably confusing are typedefs used on primitive types. This helps maintain backwards compatibility with programs created for older versions of Windows, and adds semantic meanings to types. A lot of the preprocessor stuff you see in header files is actually conditional compilation - it's checking what environment you're compiling in, what version of Windows, etc. and then providing the correct typedefs so that what actually compiles works on the desired Windows platform. Stuff that's greyed out in VS2013 is stuff that Intellisense sees isn't going to be compiled based on the current #defines and a lot of it may be relatively ancient. A big part of the Windows API for a long time was a strong desire to not break backwards compatibility. This was a huge advantage for Windows, because it means my program you wrote for Windows 3.1 isn't going to be hosed by Windows 95 rolling out. Or XP, 2000, Vista, 7, 8, 10, etc. It does mean a lot of stuff makes it into the API and stays there.
They try to hide a lot of that in the headers, but you'll also see deprecated input variables to functions and the like (this parameter should always be NULL...etc), and you just have to read the documentation. Thank the internet.
For example, an LPCSTR is just a const char*, but the LPCSTR signifies that it's a null-terminated constant string. In fact, you may see that's it's not a const char*, but a CONST CHAR* where CONST and CHAR are #defines themselves to make sure the correct keywords and types are used. In your case it'll probably end up being just normal const char*.
My suggestion, rather than diving into about as complicated a C-API as possible, is to look at something like SDL. SDL is a much simpler C API designed to provide an interface to the operating system's windowing, graphics, and input, while hiding the dirty details of the API, be it Windows, Mac, or Linux. https://www.libsdl.org/
It uses openGL for its graphics. If you're making any kind of game you'll be using some kind of graphics API to talk to the video card. The native Windows graphics API is DirectX, but openGL is the very commonly used cross-platform API. Both APIs allow you to make use of a computer's video hardware to render graphics.
Edit: I'll add, since I went off and voiced an opinion on libraries, which is why these types of questions are probably frowned upon, that I think it's fair to say that SDL is the de facto standard for C third-party multimedia libraries. Also commonly mentioned is SFML, which provides much the same functionality but is more object-oriented and written in C++.
In Visual Studio, when you create a win32 app project, click on next, and click on empty project. This will eliminate all the stuff that Visual Studio creates for a win32 app, but then you start with no files. You'll probably want to start with some simple example C program for windows from a book or web site.

Recommended books for building a shell/BBS Server [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 7 years ago.
Improve this question
I am working on a independent project for school, and I need a bit of guidance on possible resources. Basically, I am trying to build a Unix-style shell (possibly porting later to Windows) in C or C++. I will add shell commands in a modular fashion, adding functionality as I go. The final step will be to ad a "connect" command which will allow a user to connect to a telnet BBS that I have designed. The BBS will also only have basic, skeletal functionality. E.G., I am probably going to have news blurbs, maybe a basic application and a basic door game.
I don't really need help with the programming (at least, not yet), but I have been having trouble finding good resources to help me out. What I am looking for is a good book on shell programming (not writing scripts, but actually programming a shell from scratch, and its various interactions with the underlying system), and a good book on adding telnet functionality- what I mean by this is that I want to use my computer as a server, and allow a few other users to connect in order to test that my system works. I am currently reading the Sans "Teach Yourself TCP/IP in 24 hours" which has proved reasonably useful for someone with a good understanding of CS, algorithms, data structures, etc. I just need something a little more specific.
Just a little background- I am a second year Computer Science student at Purdue, and I am doing this independent study in order to tie together many of the concepts I have learned thus far. If anyone could point me toward some truly excellent resources, it would be very much appreciated.
Please let me know if you need more detail or clarification in order to point me toward the appropriate resource. Note that I am willing to buy any book available if it proves to be a valuable resource. Also, I did try a search for these resources on SO, but most questions seemed to be too specific (generally about issues that someone is having with their implementation of a shell, etc.); I would also prefer personal recommendations from experienced programmers in the field.
Thanks in advance.
-S
PS- To clarify "BBS" for younger programmers- this is what existed before the Internet. Old school, dial-up, text based bulletin board systems on a 2400 baud modem. I obviously can't recreate that exactly, but my hope was to synthesize the experience using telnet or SSH. See http://www.telnetbbsguide.com/ for more information on a telnet BBS. I need to be able to write my own software, though, that merely has a fraction of the functionality of a real BBS. But, I am not sure what I need to be searching for to learn more about this- should I be looking at server books, networking books, or something else entirely?
PPS- More clarification. Most of the books I have been seeing on BBS's are books about how to setup, run, and maintain a BBS as a sysop, using pre-existing software. What I need to do is write the software myself. I will likely use telnet, as it appears to be easier to use that SSH (at least, to program- please correct me if I am wrong about this). I friend of mine recommended that I get a book on patterns, and also a copy of "The Pragmatic Programmer". Please let me know if he is pointing me in the right direction for what I want to build. Also, just as a side note, I do have a pretty decent (if basic) knowledge of programming, algorithms, and data structures- but absolutely no knowledge of networking or servers and I am not really sure how much I actually need to know in order to start development on this project. Well, I know a little bit about networking, just not from a programmer's perspective. Thank you all again.
There is a book about programming unix shells! written by none other than Axel Tobias-Schreiner, illustrious author of ooc.pdf, The "Object-Oriented C" PDF (Google it, but don't forget his name!).
It's called "Using C with Curses, Lex and Yacc: Building a Window Shell for Unix System V", Prentice Hall, 1990; and it really should be considered Part 3 of the saga begun in K&R "The C Programming Language", and continued in the second half of K&P "The UNIX Programming Environment".
The shell the book describes is a rogue-style "window system" that works inside the terminal (using curses), it includes a text-file viewer, and a command-language interpreter that runs commands inside of these "windows". The command language uses lex and yacc to implement the lexer/parser. So the book serves as an introduction to doing such things, a large literate program in C, and goldmine of snippets for using curses, complicated options processing, and implementing a programming language using the much-touted standard unix tools.
I've never seen a book about programming of shells, although I'd be happy to find out that such a thing exists.
But really, isn't programming a shell basically a list of features that you'll implement AND the order of evaluation of how interpret the users input? You can see a good write-up on order of evaluation in 'Classic Shell Programming', Robbins and Beebe AND in 'C Shell Field Guide' (the Andersons) and possibly others.
Of course, you would learn a lot by digging in on the available source codes for shells, bash, z shell, ksh.
Sorry, I don't have any ideas about the BBS server part of your question. As you found the SAMS book helpful, I'd recommend looking at the W. Richard Stevens' Network Programming Series of books, which is 99% Unix network programming and maybe not what you want.
(Finally, consider changing out your recommendation tag for bash or zsh, as many regular contributors at S.O. check for new questions by searching on 'their' tags. The people that can answer your question better may not be reading it)
I hope this helps.

Cross Platform C library for GUI Apps? [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.
The community reviewed whether to reopen this question 8 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Free of charge, simple to learn/use, Cross Platform C library for GUI Apps? Am I looking for Qt?
Bonus question: Can I develop with the said library/toolkit on Mac then recompile on PC/Linux?
Super Bonus Question: Link to tutorial and/or download of said library.
The truth is that I'm in the process of catching up on the C family (coming from web development - XHTML/PHP/MySQL) to learn iPhone development.
I do understand that C is not C++ or ObjectiveC but I want to keep the learning curve as simple as possible. Not to get too off topic, but I am also on the lookout for good starter books and websites. I've found this so far.
I'm trying to kill many birds with one stone here. I don understand that there are platform specific extensions, but I will try to avoid those for porting purposes
The idea is that I want to write the code on one machine and just compile thrice. (Mac/Win/Linux) If Objective C will compile on Windows and Linux as well as OS X then that's good. If I must use C++, that's also fine.
If you are looking for a C++ library, then Qt basically does what you are looking for. If you want to stick to pure C, then Qt is not an option.
As a C framework you could use GTK+, it works on Linux, Windows and OS X.
Take a look at the IUP Toolkit. It is written largely in C, and is also easily bound to Lua.
To complete this post Allegro has to be here =)
http://www.talula.demon.co.uk/allegro/
Allegro Game Library, have many graphics functions and a basic GUI library
And an explicit gui (and very simple) Allegro based library
http://cgui.sourceforge.net/index.html
Both multi-platform
Another option is Tk, which is a GUI library written in C. It comes with Tcl, a scripting language also written in C. These were designed from the ground up to be embedded in C programs.
One that I have considered using was the EFL, as it's quite fast, simple, small, but powerful. I would recommend diving into Elementary, their simplest GUI toolkit, and then later on, once you get comfortable with it, move to EDJE, which is not as simple, but much more powerful.
Qt is a C++ library. Other cross platform libraries that you might consider are wxWidgets (C++), and GTK (C).
All three of the presented libraries are fully cross platform. You can also look at Tcl/Tk, but that's a toolkit :).
You tagged this question about qt, which is a tag I follow. However, you are also asking with regards to c programming.
If for some strange (or domain-enforced) reason you feel you must use C and not C++, then Qt is not for you. It was designed from the ground-up as a C++ library.
Yet I'd strongly suggest questioning why your project would need to be in C. There are many benefits to C++, and the idea that C performs intrinsically better is mostly a myth. For some hard data on that, check out Bjarne Stroustrup's Learning C++ as a New Language.
If you must stick to C then there's always GTK. The underlying API of GTK+ is C, but bindings also exist for C++ called GTKmm. I'm not a big fan of it from a design perspective, but historically powered the Gnome desktop (Ubuntu's default)...and Google chose it for their version of Chrome for Linux. So it has some cred and support there.
But do note that Ubuntu is choosing Qt5 to implement their next version of "Unity" in the desktop:
https://askubuntu.com/questions/281092/why-is-canonical-choosing-qt-over-gtk-for-unitys-next-generation
EDIT: You added:
If I must use C++, that's also fine.
"Must" is a strong word, but there is practically no comparison between C++/Qt vs. C/GTK. And the latter is becoming a thing of history.
Take a look at the Ecere SDK. It offers a cross-platform GUI toolkit, and gives you eC, an object-oriented language derived from C (with all of its functionality) that is just great for building GUIs.

Material to learn GObject and Glib [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
I am comfortable with C. but need to learn GObject and Glib for gstreamer. All i found on net is Gobject reference manual. Its good but looking for tutorial for Gobject/Glib as the main focus is on gstreamer.
So pls share any other resources to learn the glib and gobject.
Start with Glib, its quite easy and well described here: Glib Reference Manual
GObject is mostly a lot of boilerplate code to achieve object orientation. Try out the "maman bar" examples found in the GObject Reference Manual
For me, GStreamer took the most time to understand. The documentation is good but there is alot to read (GStreamer docs). After reading about the basics, try starting a pipeline from the cmdline using gst-launch. Then read the full manual about application development and do some examples. Before trying to build your own plugin, check out some simple plugin and try understand the different parts, a simple place to start is the identity plugin
Good luck!
/Joel Larsson
You may be interested in these sample programs I uploaded to github after I read the chapter in the Gnome Developers Guide and went through the gobject manual.
There is also "the offical Gnome 2 Developer's guide". See 59 ff. on the mentioned book...
And it's really a good idea to check the sources of gtk. I've spend the last few weeks on getting into it, and found this book to be very helpful. What's quite tedious is to get the constuctors right and the order of initialization is "quite" mind-bending.
What you should check is chapter 4 in the GObject documentation also. It does not cover everything but together with the book it' quite ok. I suggest starting with a very simple derived glass form GObject....., to better understand on base principle
One always has two
structures. A Class Structure in which you store all the function pointers and an instance structure which represents one Object. This is the most important thing to get.
Another point which is a bit harder to understand it the reference counting for memory management. It helps if you had contact before with Objective-C and/or libapr and/or
COM.
Regards
Friedrich
This is best GTK+ book I found, it has a chapter on GLib, but reference manual is the best place to learn and the most up to date "book" you will find.
Manage C data using the GLib collections is a introduction of glib collection(links, hash tables, arrays, trees, queues, relations). Lots of examples are included. Good for beginners.
Maybe too much easy but there are the GNOME platform demos which you can get used to the idiomatics of GNOME and its libraries.

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