drawing circle, line, arc etc. using c [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 last year.
Improve this question
So our teacher taught us to draw circles lines using c in turboc++, and my issue is, this compiler sucks, so I wanted to use some normal compiler or code editor, and I googled it, but those programs on websites which I found, use graphics.h for drawing circle, but my compiler is showing an error named no such file or directory. The same issue is seen when I use an online compiler.
So plz someone guide me where can I find some good material related to basic computer graphics whose c code does not need turboc++. It can be a book or website or videos on youtube.
Thanks in advance.

There is no standard graphics library in C. It's all third party. So you will never be able to write graphics code that's completely portable.
If you're using Linux, it's possible to use libgraph to enable the use of graphics.h. I found a question on askubuntu that covers this: How do I use graphics.h in Ubuntu?
If you're using Windows, it seems to be possible to use WinBGIm to use graphics.h. Geeks for geeks has instructions for how to use it with CodeBlocks https://www.geeksforgeeks.org/include-graphics-h-codeblocks/
I do not know how good these two options are, but they might be worth trying out. That will at least remove the Turbo dependency.

Related

How to write a text mode gui in Linux? [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
When I write scripts/programs, often I would like to pop up a simple text 'gui' to prompt for input:
How would I do this? For example from Shell, Ruby, Golang or C. I don't even know what this is called and Google isn't reponding to "text thingy from scripts".
(The example is from the Debian installer).
Actually, that is not dialog, but the newt library (there are a few differences in appearance). It is used by anaconda on Red Hat systems. The whiptail program uses the library, however it has no real relationship to anaconda.
Anaconda is mostly in Python; it uses the newt shared library (written in C) from a Python binding.
For learning it... documentation is largely non-existent. You have the source code.
Further reading:
screenshots for dialog
newt.git
anaconda.git
Any examples/documentation for python-newt (discussion of newt vs documentation)
Spicing up the Console for Fun and Profit, Part 2
In the past this was known as "Dialog," though as Thomas points out (as the maintainer of Dialog!!) this is no longer the case. This is most likely the Newt library. While you could certainly write something lower level using ncurses, Newt is available in Linux pretty much universally. Dialog can also be installed under Linux. You can read some basic documentation for it here.
Choosing to use this over a curses based approach allows you to focus on what it is you're actually looking to do rather than doing all of the work to build a UI. If, however, you are really looking to build UI elements, ncurses would be the way to go.

Looking for auto C code generation tools [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 8 years ago.
Improve this question
I am working on embedded project that requires almost same kind of code template for each new implementation.
Instead of doing manual code, I am thinking to automate the code generation process.
So that I only need to provide input data to the tool in some format (could be any input format) and it generated C code according to it.
Open source would be the first choice but proprietary tools are also acceptable.
I already searched for Eclipse Modeling plugins Acceleo and Actifsource but didn't find them suitable for Embedded C code generation.
And I don't want to use heavy solution like MATLAB and LabVIEW just for code generation.
C code generation from UML models is possible with tools such as:
IBM Rational Rhapsody
Open source Eclipse plugin Topcased
There are many variants of C code generation:
function pointers (parent function do the same code exept a little variant)
inline functions + macro (parameters of macro could define a new functions)
systems like make, cmake, autotools (you write an input-file wich is modified at precompiling)
Tell more if you want to get more detailed answer.

C syntax parser [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
Are there any libs out there that can parse C syntax?
For example I would like to write my own code/scripts that will analyze c files given the c syntax. Number of "if" statements per function/file, lines of comments per lines of code in a function and so on.....
I have no problem writing all this custom code just wanted to make the job easier if there was already some lib that I can use to jump start instead of starting with the parser.
Thanks!
Besides the clang suggestion already made, consider pycparser and Boost.Wave.
Although they are more targeted at semantical analyses rather than syntactical ones, you might be interested in CIL and Frama-C, which is based on it (both in OCaml). Another tool (OCaml and Python bindings) of interest is Coccinelle.
Personally, I would look first for an existing tool to do what you want. This sounds like an awful lot of work and there are a lot of good free tools out there for code metrics (did you look on SourceForge?).
If you insist on going ahead with your project, you might google for Lex/Yacc grammars for C.
However, I switched from Lex/Yacc a few years ago to Antlr. I particularly like the way it allows you visually step through your parsing.
A great tool, and free. There is a complete grammar for C available too, so you can modify that to suit your needs.
Hope this helps. Good Luck
you might also consider trying a code coverage tool. although code coverage is meant to show you how much percent of the source code is executed but some of them also show how many conditional statements or loops it encountered whilst doing code coverage. One example that I can share based on my experience is windriver workbench code coverage tool

Please recommend a good D-Bus tutorial (Linux C GTK+) [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
Yes, I have done a search yet found only partly working stuff. It seems to be a real maze. E.g.:
Why do they even use g_main_loop_run()? Is it really necessary when the GTK+ program has already entered the main loop by gtk_main()?
How should the path, the interface name and the signal name look like when invoking such functions like dbus_bus_request_name(), dbus_message_new_signal(), dbus_bus_add_match(), dbus_message_is_signal() ...?
How afterwards should the names be correctly set in the /etc/dbus-1/system.conf file to even allow the program to use the the D-Bus interface? Surprisingly all tutorials I found simply forget to mention at all you need to edit it.
How the messages could be caught asynchronously? Should it be done somehow like in a separate thread?
Please recommend any good GTK+ D-Bus example which could help to learn how to use it.
gtk_main is calling g_main_loop_run(), you should look into file gtk/gtkmain.c to find out.
Googling for dbug_bus_request_name gives several examples, notably dbus-example.c
And you should read a good gtk tutorial to have an idea of what signals and slots mean in the context of Gtk.
Googling for d-bus tutorial gives this dbus tutorial
At last, a good idea is to find and study the source code of the relevant free software. GtkApplication examples are calling dbus code.

Usable Software Reverse Engineering tools needed! [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
Hey guys, Myself and 2 fellow software engineer students are tasked to reverse engineer the gawk program. We need to create diagrams representing the structure, and answer questions about the program.
http://directory.fsf.org/project/gawk/
We are looking for simple to use reverse engineering tools for C programs. Our instructor has given us the following three tools as examples of what we should use, but we simply are having a huge problem getting them to work. Do you have any alternative solutions, or perhaps some good documentation on one of the following tools to help us out? Thanks!
PBS: http://www.swag.uwaterloo.ca/pbs/
RIGI: http://www.rigi.csc.uvic.ca/Pages/download.html
Shrimp: http://www.thechiselgroup.org/shrimp
This graphic is supposed to help understand a simple C list? http://www.rigi.cs.uvic.ca/downloads/demos/list-d/ls7.html
I strongly suggest ignoring those programs and start reading the code.
Reading the code can be vastly simplified if you have good tools to help; vim with etags and cscope is my preferred tool, with the GNU id utils tools coming in as occasionally handy.
Emacs users will probably stick closely with just etags.
The Eclipse IDE can probably help you navigate through code too. I've never tried it, but enough people love it so I hope it has some nice functionality.
People often find it easy to give exact URLs to locations in Linux source code using the lxr tool, e.g.: http://lxr.linux.no/#linux+v2.6.37.1/security/apparmor/lsm.c#L294 -- this system requires very little on individual client machines, which means you only need to configure it once as a server and all your classmates can benefit from it.
As first, you can use IDA Pro under linux. For more information of reversing tools, see https://www.apriorit.com/dev-blog/366-software-reverse-engineering-tools.
Binutils includes next reversing tools:
file;
nm;
size;
strings;
ldd;
readelf.
Objdump – disassembler. It shows header of a program, sections of file (flag -х). Disassemble file (flag -D). It shows body of sections in hex view (flag -s).
EDB. It is like OllyDbg, but under Linux.
HTE. Сonsole editor with more functions. It can disassemble files, supports cross-reference links, set functions’ name.

Resources