gawk  5.1.0
About: GNU awk - pattern scanning and processing language.
  Fossies Dox: gawk-5.1.0.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rwarray.c File Reference
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "gawkapi.h"
#include "gettext.h"
Include dependency graph for rwarray.c:

Go to the source code of this file.

Macros

#define _(msgid)   gettext(msgid)
 
#define N_(msgid)   msgid
 
#define MAGIC   "awkrulz\n"
 
#define MAJOR   3
 
#define MINOR   1
 

Functions

static awk_bool_t write_array (FILE *fp, awk_array_t array)
 
static awk_bool_t write_elem (FILE *fp, awk_element_t *element)
 
static awk_bool_t write_value (FILE *fp, awk_value_t *val)
 
static awk_bool_t read_array (FILE *fp, awk_array_t array)
 
static awk_bool_t read_elem (FILE *fp, awk_element_t *element)
 
static awk_bool_t read_value (FILE *fp, awk_value_t *value)
 
static awk_value_tdo_writea (int nargs, awk_value_t *result, struct awk_ext_func *unused)
 
static awk_value_tdo_reada (int nargs, awk_value_t *result, struct awk_ext_func *unused)
 
int dl_load (const gawk_api_t *const api_p, awk_ext_id_t id)
 

Variables

static const gawk_api_tapi
 
static awk_ext_id_t ext_id
 
static const char * ext_version = "rwarray extension: version 1.2"
 
static awk_bool_t(* init_func )(void) = NULL
 
int plugin_is_GPL_compatible
 
static awk_ext_func_t func_table []
 

Macro Definition Documentation

◆ _

#define _ (   msgid)    gettext(msgid)

Definition at line 56 of file rwarray.c.

◆ MAGIC

#define MAGIC   "awkrulz\n"

Definition at line 59 of file rwarray.c.

◆ MAJOR

#define MAJOR   3

Definition at line 60 of file rwarray.c.

◆ MINOR

#define MINOR   1

Definition at line 61 of file rwarray.c.

◆ N_

#define N_ (   msgid)    msgid

Definition at line 57 of file rwarray.c.

Function Documentation

◆ dl_load()

int dl_load ( const gawk_api_t *const  api_p,
awk_ext_id_t  id 
)

Definition at line 514 of file rwarray.c.

◆ do_reada()

static awk_value_t* do_reada ( int  nargs,
awk_value_t result,
struct awk_ext_func unused 
)
static

◆ do_writea()

static awk_value_t* do_writea ( int  nargs,
awk_value_t result,
struct awk_ext_func unused 
)
static

◆ read_array()

static awk_bool_t read_array ( FILE *  fp,
awk_array_t  array 
)
static

Definition at line 364 of file rwarray.c.

References _, awk_false, awk_true, ext_id, fp, i, read_elem(), set_array_element_by_elem, uint32_t, and warning.

Referenced by do_reada(), and read_value().

◆ read_elem()

static awk_bool_t read_elem ( FILE *  fp,
awk_element_t element 
)
static

◆ read_value()

static awk_bool_t read_value ( FILE *  fp,
awk_value_t value 
)
static

◆ write_array()

static awk_bool_t write_array ( FILE *  fp,
awk_array_t  array 
)
static

◆ write_elem()

static awk_bool_t write_elem ( FILE *  fp,
awk_element_t element 
)
static

Definition at line 198 of file rwarray.c.

References awk_false, fp, fwrite(), awk_element::index, uint32_t, awk_element::value, and write_value().

Referenced by write_array().

◆ write_value()

static awk_bool_t write_value ( FILE *  fp,
awk_value_t val 
)
static

Variable Documentation

◆ api

const gawk_api_t* api
static

Definition at line 62 of file rwarray.c.

◆ ext_id

awk_ext_id_t ext_id
static

Definition at line 63 of file rwarray.c.

Referenced by do_reada(), do_writea(), read_array(), read_value(), write_array(), and write_value().

◆ ext_version

const char* ext_version = "rwarray extension: version 1.2"
static

Definition at line 64 of file rwarray.c.

◆ func_table

awk_ext_func_t func_table[]
static
Initial value:
= {
{ "writea", do_writea, 2, 2, awk_false, NULL },
{ "reada", do_reada, 2, 2, awk_false, NULL },
}

Definition at line 506 of file rwarray.c.

◆ init_func

awk_bool_t(* init_func) (void) = NULL
static

Definition at line 65 of file rwarray.c.

◆ plugin_is_GPL_compatible

int plugin_is_GPL_compatible

Definition at line 67 of file rwarray.c.

do_writea
static awk_value_t * do_writea(int nargs, awk_value_t *result, struct awk_ext_func *unused)
Definition: rwarray.c:104
awk_false
@ awk_false
Definition: gawkapi.h:116
NULL
#define NULL
Definition: strftime.c:150
do_reada
static awk_value_t * do_reada(int nargs, awk_value_t *result, struct awk_ext_func *unused)
Definition: rwarray.c:276