A VS Code extension providing useful C language snippets for multiprogramming.
init_main:
Quickly insert a boilerplate main()
function that checks argc
and returns 0
.
init_program_switch:
Fork a child process, set its process group, redirect output, and execute another program with execv
.
init_sigaction:
Quickly insert a boilerplate sigaction
initialization with sa_handler
.
init_sigaction_plus_siginfo:
Insert advanced sigaction
setup using sa_sigaction
, SA_SIGINFO
, and access to siginfo_t
.
init_sigmask:
Set up a signal mask to block/unblock signals using sigprocmask
, and check pending signals.
init_sigqueue:
Insert code to send signals with a sigval
using sigqueue
.
init_thread_basic:
Create a thread, pass an argument, and retrieve a result with pthread_create
and pthread_join
.
init_thread_struct_param:
Create a thread, pass a struct as an argument, and retrieve a result with pthread_create
and pthread_join
.
init_thread_plus_signal:
Manage signals in multithreaded environments with pthread_sigmask
and pthread_kill
.
init_mutex:
Insert boilerplate for initializing, locking, unlocking, and destroying a pthread_mutex_t
.
init_file_stream:
Work with files using FILE*
stream: open, read, write, seek, and close operations.
init_file_descriptor:
Insert system-level file I/O using file descriptors: open
, read
, write
, dup
, and close
.
init_unnamed_pipe:
Create an unnamed pipe for interprocess communication between parent and child.
init_fifo:
Insert code to create and use a named FIFO with mkfifo
, open
, read
, and write
.
init_message_queue:
Set up a System V message queue using msgget
, msgsnd
, and msgrcv
.