c

What is a popular, multi-platform, free and open source socket library

Is there any free open source library (in C/C++) for sockets that is widely used and supports wide range of operating systems (Windows, Unix/Linux, FreeBSD etc). Just like pthreads. Otherwise the only solution left would be to write socket wrapper for each operating system. Or would writing a wrapper against winsock and GNU C sys/socket...

Help me with the simplest program for "Trusted" application

Hi, I hope anyone from the large community here can help me write the simplest "Trusted" program that I can expand from. I'm using Ubuntu Linux 9.04, with TPM emulator 0.60 from Mario Strasser (http://tpm-emulator.berlios.de/). I have installed the emulator and Trousers, and can successfully run programs from tpm-tools after running tp...

changing rgb values

hi i am trying to change a part of an image with another image i couldn't find the merging function so i just occur that can i change the rgb values of the part i want to change with the other images rgb values is it possible thanks for suggestions ...

Multi client chat server in C - Execution Problem

I am implementing a Multi client chat server, and i am getting the following error. Only hint i get from the error description is that it is a linker error. Can anyone help me resolving this. viper[1052]% gcc -Wall -o server server.c server.c: In function âMainServerLoopâ: server.c:45: warning: pointer targets in passing argument 3 of â...

Make a cosine table with the gcc preprocessor

Hi. I wish to make a cosine table at compile time. Is there a way to do this without hard coding anything? ...

Why is this C code buggy?

On another question, Jerry Coffin pointed out the following: It's (probably) not really related to your question, but while (!feof(fileptr)){ is pretty much a guaranteed bug. I figured I would start a separate question since that comment is somewhat off-topic. Could someone explain this to me? This was the first program I've writ...

OpenCV on Embedded Platform

Can some suggest a test/development embedded platform to use with OpenCV. I would like to develop an embedded video analytics solution, but I don't know where to start. Some suggestion/ideas/hw starter kits? Maybe some Pc-104 solutions with Intel Atom? Has someone made some test about performances on this platform or any other embedded ...

Good collection of libraries for C?

I'm looking for a good collection of libraries for ANSI-C, stuff for handling vectors, hash maps, binary tress, string processing, etc. ...

Wrapping C++ class API for C consumption

Hi there, I have a set of related C++ classes which must be wrapped and exported from a DLL in such a way that it can be easily consumed by C / FFI libraries. I'm looking for some "best practices" for doing this. For example, how to create and free objects, how to handle base classes, alternative solutions, etc... Some basic guidelines...

What's the difference between the -symbolic and -shared GCC flags?

From the documentation's description, they seem to do the same thing except that "not all systems" support shared and "only some systems" support symbolic (it's unclear if these are the same set of systems): -shared Produce a shared object which can then be linked with other objects to form an executable. Not all systems su...

How to determine where code spends a lot of time in a kernel space (system calls)

I noticed that 10% my code run is system space. However I do NOT know which system calls. I suspect, though, it is either has to do files or timestamps. Is there a tool to figure out which system calls are the culprits? Also, I want to know the frequency of (and location) of calls (and callee) . I am on AS3 thx ...

How to use libtidy with tidyParseBuffer()?

I'm trying to clean some HTML with libtidy (C language), the problem is: I want to construct a TidyDoc (a tree-like structure) with tidyParseBuffer(). I have no problem with tidyParseFile(); about tidyParseBuffer(): I'm sure I read the file properly and that the TidyBuffer structure I give to tidyParseBuffer() is correctly filled. Any...

Lexical Tie-Ins with Flex and Bison

Hello all :) I've been looking to recognise a language which does not fit the general Flex/Bison paradigm. It has completely different token rules depending on semantic context. For example: main() { batchblock { echo Hello World! set batchvar=Something echo %batchvar% } } Bison apparently supports recognition of these ty...

getline over a socket

Is there a libc function that would do the same thing as getline, but would work with a connected socket instead of a FILE * stream ? A workaround would be to call fdopen on a socket. What are things that should be taken care of, when doing so. What are reasons to do it/ not do it. One obvious reason to do it is to call getline and co,...

C : Problem with Jagged Arrays

I have the following code : int *edges[500]; char arr[] = {'c','d'}; edges[0] = arr; printf("%c - %c", edges[0][0],edges[0][1]); What I want displayed is c - d but what is actually being displayed is c - So as you can see above, the first element is being displayed but not the second one. Why isn't the second element of the array ...

Linking a shared library against a static library: must the static library be compiled differently than if an application were linking it?

At least on Linux and Solaris, static libraries are really just a bunch of compiled .o's tossed into one big compressed file. When compiling a static library, usually the -fpic flag is ommited, so the generated code is position dependent. Now say my static library is B. I've built it and have the resulting .a file which is really just ...

Error trying to define a 1,024-bit (128 Byte) Bit Field

I would like to define a large bitfield for the purpose of quickly monitoring the status a very large structure of elements. Here is what I have so far: #define TOTAL_ELEMENTS 1021 typedef struct UINT1024_tag { UINT8 byte[128]; } UINT1024; typedef struct flags_tag { UINT1024:TOTAL_ELEMENTS; } flags_t; When I try compiling this...

Multicore programming: what's necessary to do it?

I have a quadcore processor and I would really like to take advantage of all those cores when I'm running quick simulations. The problem is I'm only familiar with the small Linux cluster we have in the lab and I'm using Vista at home. What sort of things do I want to look into for multicore programming with C or Java? What is the ling...

Objective-C and C interoperability

We're going to have to write a C library and this library has to be accessible from Objective-C. Now I don't know anything about Objective-C so I wonder how simple Objective-C <-> C interoperability is. Is that as simple as including the C header in the Objective-C code and linking to the library? Is there anything special I'm supposed t...

Understanding typedefs for function pointers in C: Examples, hints and tips, please.

I have always been a bit stumped when I read other peoples' code which had typedefs for pointers to functions with arguments. I recall that it took me a while to get around to such a definition while trying to understand a numerical algorithm written in C a while ago. So, could you share your tips and thoughts on how to write good typede...