Questions tagged [c-libraries]

63 questions
2
votes
1 answer

C library public header interface

I am building a range of C libraries to improve separation of code in a large codebase. I would like to enforce strict separation using minimal public library interfaces. The libraries consists of several modules (c + h files), some with internal…
CSS
  • 21
  • 2
2
votes
0 answers

Correct fftw installation enabling Rcartogram

I would like to instal FFTW to enable the Rcartogram package. Attempts homebrew After installing fftw libraries via homebrew: brew install fftw --with-fortran --with-mpi --with-openmp --enable-float The attempt to install the Rcartogram fails with…
Konrad
  • 17,740
  • 16
  • 106
  • 167
2
votes
1 answer

Does some kind of 'strcmpf' implementation exists?

I am looking for a function that checks if a string follows (matches exactly) the pattern of data specified by the additional arguments corresponding to the format string Like this: /* int strcmpf (char *str1, char *format, ...); */ char *test =…
Imobilis
  • 1,475
  • 8
  • 29
2
votes
1 answer

Why would someone add zero to __STDC_VERSION__?

Looking through stdarg.h, I spotted the following: #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L #define va_copy(d,s) __builtin_va_copy(d,s) #endif Is there a purpose to adding 0 in the expression?
Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
2
votes
2 answers

How do i flush memory in a Python program with C-library?

The Python-programs function is to find the brightest light with a webcam and send X,Y-coordinates to a arduino program. This is to follow the sun with a camera. The the problem is that the memory increases until the program freezes. I've tried to…
1
vote
2 answers

Can vsnprintf return negative value of magnitude greater than 1?

Can vsnprintf() return a negative value of magnitude greater than 1? If so, under what circumstances does it do so? I tried to use %ls as format specifier for a char array and also tried to copy larger than what array was allocated. In both cases I…
Knight71
  • 2,927
  • 5
  • 37
  • 63
1
vote
3 answers

Is there a standard C library for dynamic arrays?

One of the greatest things about Python is the flexibility of dynamic arrays (lists). It's so useful I find it hard to believe there isn't a library for this already included in C. This question indicates that there is no standard library for this.…
Connor
  • 867
  • 7
  • 18
1
vote
2 answers

Making driver library for a slow module, watchdog friendly

Context I'm making some libraries to manage internet protocol trough GPRS, some part of this communications (made trough UART) are rather slow (some can take more than 30 seconds) because the module has to connect through GPRS. First I made a driver…
1
vote
2 answers

JNA behaving different then my C# counterpart, why?

I'm developing something for a piece of hardware and I got a C library to communicate with the hardware. I have methods that send a signal to the hardware (like light bulb turn on) and those work fine on both C# and Java using JNA. The machine also…
denbrau
  • 11
  • 4
1
vote
0 answers

Compile local C extensions in Heroku with pip

I'm creating a Python app in Heroku and I want to install a package that makes use of C extensions. If I just include that package in requirements.txt and run the app, it will give me the following error: The compiled C library is not…
tzoukritzou
  • 337
  • 1
  • 4
  • 16
1
vote
3 answers

Use of macro overrides for functions

I was reading implementation of header in C library, where I came across macro overrides for functions, along with function declarations. I want to know how is this useful, .i.e. either macro should be used or functions, what is the need for…
beta_me me_beta
  • 846
  • 1
  • 5
  • 14
1
vote
0 answers

Setting Up a Debian Docker image with older boost library

I have an already compiled Linux app which has become dated. To use it, I want to create a Docker image and an appropriate environment to work with. My problem is that is app requires an older version of the boost libraries. 1.57.0 to be specific.…
StudentOfScience
  • 809
  • 3
  • 11
  • 35
1
vote
0 answers

How to make gcc warn functions given on command line

I have several libraries that use non thread-safe functions, like gmtime(), strtok(), asctime()... and i want to fix them with their thread-safe equivalent (gmtime_r(), strtok_r(), asctime_r()...). The source code i have is made of many libraries.…
Burns
  • 146
  • 4
1
vote
0 answers

Android NDK| native library for USB storage management.

I am trying to build an app which involves formatting usb drives, changing the partition scheme and creating partitions. After a lot of research I found that Android SDK does not provide tools or ways to access the information needed to do such…
Sapnesh Naik
  • 11,011
  • 7
  • 63
  • 98
1
vote
2 answers

Removing math.h from a project VS 2015 / 2017

So, I'm working on a project where I'm intended to implement my own versions of the trigonometric functions, square root, rounding & exponents without assistance from the math.h or cmath libraries that must be done using Visual Studio 2015 or 2017.…
Joseph
  • 53
  • 1
  • 9