
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
A script to generate a simple C program with a few basic includes and a main()
. Then it opens the file in your editor of choice placing the cursor at the proper line and column to start adding code.
Supported editors include:
subl
)mate
)code
)$ pip3 install make-c
Help output:
$ make_c --help
usage: make_c [-h] [-l] [--version] [--editor EDITOR] [--skip-editor] [-T]
[-M]
[filename]
make_c: A utility to create a simple C source file with a main and open it in
an editor. version 0.2.0
positional arguments:
filename Name of the source file to create.
options:
-h, --help show this help message and exit
-l, --list-editors List known editors.
--version Print version string and exit.
--editor EDITOR Editor to use to open the resulting source file.
--skip-editor Create the source file but don't open it in an editor.
-T, --tabs Use tabs instead of spaces.
-M, --generate-makefile
Create a makefile to build the program.
List available editors:
$ make_c --list-editors
Known editors:
vim: Vi IMproved, a programmer's text editor
subl: Sublime Text 3
mate: TextMate 2
code: Visual Studio Code
emacs: GNU project Emacs editor
nano: Nano's ANOther editor, an enhanced free Pico clone
If an editor isn't provided on the command line, it can be specified using an environment. The variables that are used are, in the following order:
MAKE_C_EDITOR
EDITOR
VISUAL
Creating and editing a file:
# Create foo.c and edit in the default editor, VIM:
$ make_c foo.c
# Edit using $MAKE_C_EDITOR environment variable to specify editor:
$ export MAKE_C_EDITOR=/usr/local/bin/emacs
$ make_c foo.c
# If MAKE_C_EDITOR isn't set, EDITOR and VISUAL respected, in that order:
$ unset MAKE_C_EDITOR
$ export EDITOR=/usr/bin/vim
#Edit in SublimeText instead:
$ make_c foo.c --editor=subl
#Generate a makefile in addition to the C file.
$ make_c foo.c --generate-makefile
To add additional editors, extend the CProgram
class and override:
EDITOR
class variableDESCRIPTION
class variablegenerate_editor_command()
instance methodThe string representation for --list-editors
is automatically generated by the superclass from EDITOR
and DESCRIPTION
.
The generate_editor_command()
method should return an argv
that represents that editor's commandline incantation in list form suitable for consumption by subprocess.Popen()
. For example, if your editor takes a --line
and --column
argument, you would return:
def generate_editor_command(self):
return [self.generate_editor_arg0(),
"--line",
"%d" % self.edit_line,
"--column",
"%d" % self.edit_column,
self.filename]
FAQs
A utility to create a simple C source file with a main and open it in an editor.
We found that make-c demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.