Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
ex_git.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "nilorea/n_common.h"
#include "nilorea/n_log.h"
#include "nilorea/n_str.h"
#include "nilorea/n_list.h"
#include "nilorea/n_git.h"
Include dependency graph for ex_git.c:

Go to the source code of this file.

Functions

static void cleanup_dir (const char *dir)
 Remove a directory tree recursively (simple rm -rf via system).
int main (int argc, char **argv)
void process_args (int argc, char **argv)
void usage (void)
static int write_file (const char *dir, const char *filename, const char *content)
 Write a file inside the repo with given content.

Function Documentation

◆ cleanup_dir()

void cleanup_dir ( const char * dir)
static

Remove a directory tree recursively (simple rm -rf via system).

Parameters
dirPath to remove.
Examples
ex_git.c.

Definition at line 111 of file ex_git.c.

Referenced by main().

Here is the caller graph for this function:

◆ main()

◆ process_args()

void process_args ( int argc,
char ** argv )

Definition at line 48 of file ex_git.c.

References getoptret, LOG_DEBUG, LOG_ERR, LOG_INFO, log_level, LOG_NOTICE, LOG_NULL, set_log_level(), and usage().

Here is the call graph for this function:

◆ usage()

void usage ( void )

Definition at line 41 of file ex_git.c.

◆ write_file()

int write_file ( const char * dir,
const char * filename,
const char * content )
static

Write a file inside the repo with given content.

Parameters
dirRepository directory path.
filenameName of the file to write.
contentContent to write.
Returns
0 on success, -1 on failure.
Examples
ex_git.c.

Definition at line 97 of file ex_git.c.

Referenced by main().

Here is the caller graph for this function: