type
stringclasses
5 values
content
stringlengths
9
163k
includes
#include <sys/types.h>
includes
#include <sys/socket.h>
includes
#include <netinet/in.h>
includes
#include <arpa/inet.h>
includes
#include <unistd.h>
includes
#include <net/if_arp.h>
includes
#include <netinet/if_ether.h>
includes
#include <net/ethernet.h>
includes
#include <netinet/ip6.h>
includes
#include <grp.h>
includes
#include <time.h>
includes
#include <signal.h>
includes
#include <pwd.h>
functions
void print_usage(char *bin_name) { fprintf(stderr, "Usage: %s <options>\n\n", bin_name); fprintf(stderr, "Options:\n"); fprintf(stderr, " -h This message\n"); fprintf(stderr, " -i <interface> Sniff packets from specified interface\n"); fprintf(stderr, " -p <pcap file> Read packets fro...
functions
uint shard_fp (struct fingerprint_new *fp_lookup, uint16_t maxshard) { return (((fp_lookup->ciphersuite_length) + (fp_lookup->tls_version)) & (maxshard -1)); }
main
int main(int argc, char **argv) { char *dev = NULL; /* capture device name */ uid_t unpriv_user = -1; /* User for dropping privs */ char errbuf[PCAP_ERRBUF_SIZE]; /* error buffer */ extern pcap_t *handle; /* packet capture handle */ extern pcap_dumper_t *output_handle; /* output to p...
includes
#include <stdio.h>
includes
#include <stdlib.h>
functions
void stream_callback (void *userdata, Uint8 *buffer, int length) { Sound_Sample *stream = (Sound_Sample *) userdata; Uint32 bytes_decoded; /* Decode a chunk of PCM samples from the sound stream. */ Sound_SetBufferSize (stream, length); bytes_decoded = Sound_Decode (stream); if (bytes_decoded == 0) { ...
functions
void options (int argc, char **argv) { }
main
int main (int argc, char **argv) { Sound_AudioInfo info; Sound_Sample *stream; SDL_AudioSpec spec; /* Handle command line options. */ if (options (argc, argv) < 0) { puts ("Usage: amaranth OPTIONS FILE\n\n"); puts ("Options\n"); puts (" -r RATE sampling rate bits/second (default: 441...
structs
struct vpath { struct vpath *next; /* Pointer to next struct in the linked list. */ const char *pattern;/* The pattern to match. */ const char *percent;/* Pointer into 'pattern' where the '%' is. */ unsigned int patlen;/* Length of the pattern. */ const char **searchpath; /* Null-terminated li...
functions
void build_vpath_lists () { register struct vpath *new = 0; register struct vpath *old, *nexto; register char *p; /* Reverse the chain. */ for (old = vpaths; old != 0; old = nexto) { nexto = old->next; old->next = new; new = old; }
functions
void construct_vpath_list (char *pattern, char *dirpath) { unsigned int elem; char *p; const char **vpath; unsigned int maxvpath; unsigned int maxelem; const char *percent = NULL; if (pattern != 0) percent = find_percent (pattern); if (dirpath == 0) { /* Remove matching listings. */ ...
functions
int gpath_search (const char *file, unsigned int len) { if (gpaths && (len <= gpaths->maxlen)) { const char **gp; for (gp = gpaths->searchpath; *gp != NULL; ++gp) if (strneq (*gp, file, len) && (*gp)[len] == '\0') return 1; }
functions
void print_vpath_data_base (void) { unsigned int nvpaths; struct vpath *v; puts (_("\n# VPATH Search Paths\n")); nvpaths = 0; for (v = vpaths; v != 0; v = v->next) { register unsigned int i; ++nvpaths; printf ("vpath %s ", v->pattern); for (i = 0; v->searchpath[i] != 0; ++i) ...
includes
#include <string.h>
functions
void component_murder(void *ctx, uint8_t *src, int sstride, uint8_t *dst, int dstride, int w, int h) { if (!src || !dst) return; memcpy(dst, src, sstride * h); }
functions
int murder_kernel_init(AVSContext *ctx, const AVSKernel *kern, AVSFilterStage *stage) { int i, n; n = ctx->cur_fmt.components; if (ctx->cur_fmt.component_desc[0].packed) n = 1; for (i = 0; i < n; i++) stage->do_component[i] = component_murder; return 0; }
functions
int avs_apply_kernel(AVSContext *ctx, const char *name, AVSFilterStage *stage) { const AVSKernel* k = avs_find_kernel(name); if (!k) return AVERROR(EINVAL); return k->kernel_init(ctx, k, stage); }
includes
#include <linux/delay.h>
includes
#include <linux/gpio.h>
includes
#include <linux/i2c.h>
includes
#include <linux/module.h>
includes
#include <linux/of_device.h>
includes
#include <linux/of_gpio.h>
includes
#include <linux/mfd/rk808.h>
includes
#include <linux/regulator/driver.h>
includes
#include <linux/regulator/of_regulator.h>
includes
#include <linux/gpio/consumer.h>
defines
#define RK808_BUCK_VSEL_MASK 0x3f
defines
#define RK808_BUCK4_VSEL_MASK 0xf
defines
#define RK808_LDO_VSEL_MASK 0x1f
defines
#define RK818_BUCK_VSEL_MASK 0x3f
defines
#define RK818_BUCK4_VSEL_MASK 0x1f
defines
#define RK818_LDO_VSEL_MASK 0x1f
defines
#define RK818_LDO3_ON_VSEL_MASK 0xf
defines
#define RK818_BOOST_ON_VSEL_MASK 0xe0
defines
#define RK808_RAMP_RATE_OFFSET 3
defines
#define RK808_RAMP_RATE_MASK (3 << RK808_RAMP_RATE_OFFSET)
defines
#define RK808_RAMP_RATE_2MV_PER_US (0 << RK808_RAMP_RATE_OFFSET)
defines
#define RK808_RAMP_RATE_4MV_PER_US (1 << RK808_RAMP_RATE_OFFSET)
defines
#define RK808_RAMP_RATE_6MV_PER_US (2 << RK808_RAMP_RATE_OFFSET)
defines
#define RK808_RAMP_RATE_10MV_PER_US (3 << RK808_RAMP_RATE_OFFSET)
defines
#define RK808_DVS2_POL BIT(2)
defines
#define RK808_DVS1_POL BIT(1)
defines
#define RK808_SLP_REG_OFFSET 1
defines
#define RK808_DVS_REG_OFFSET 2
defines
#define RK808_SLP_SET_OFF_REG_OFFSET 2
defines
#define MAX_STEPS_ONE_TIME 8
defines
#define RK8XX_DESC(_id, _match, _supply, _min, _max, _step, _vreg, \
defines
#define RK8XX_DESC_SWITCH(_id, _match, _supply, _ereg, _emask) \
structs
struct rk808_regulator_data { struct gpio_desc *dvs_gpio[2]; };
functions
int rk808_buck1_2_get_voltage_sel_regmap(struct regulator_dev *rdev) { struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev); int id = rdev->desc->id - RK808_ID_DCDC1; struct gpio_desc *gpio = pdata->dvs_gpio[id]; unsigned int val; int ret; if (!gpio || gpiod_get_value(gpio) == 0) { return regulator_get...
functions
int rk808_buck1_2_i2c_set_voltage_sel(struct regulator_dev *rdev, unsigned sel) { int ret, delta_sel; unsigned int old_sel, tmp, val, mask = rdev->desc->vsel_mask; ret = regmap_read(rdev->regmap, rdev->desc->vsel_reg, &val); if (ret != 0) { return ret; }
functions
int rk808_buck1_2_set_voltage_sel(struct regulator_dev *rdev, unsigned sel) { struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev); int id = rdev->desc->id - RK808_ID_DCDC1; struct gpio_desc *gpio = pdata->dvs_gpio[id]; unsigned int reg = rdev->desc->vsel_reg; unsigned old_sel; int ret, gpio_level; if ...
functions
int rk808_buck1_2_set_voltage_time_sel(struct regulator_dev *rdev, unsigned int old_selector, unsigned int new_selector) { struct rk808_regulator_data *pdata = rdev_get_drvdata(rdev); int id = rdev->desc->id - RK808_ID_DCDC1; struct gpio_desc *gpio = pdata->dvs_gpio[id]; /* if there is no dvs1/2 pin, we don't ...
functions
int rk808_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) { unsigned int ramp_value = RK808_RAMP_RATE_10MV_PER_US; unsigned int reg = rk808_buck_config_regs[rdev->desc->id - RK808_ID_DCDC1]; switch (ramp_delay) { case 1 ... 2000: ramp_value = RK808_RAMP_RATE_2MV_PER_US; break; case 20...
functions
int rk808_set_suspend_voltage(struct regulator_dev *rdev, int uv) { unsigned int reg; int sel = regulator_map_voltage_linear(rdev, uv, uv); if (sel < 0) { return -EINVAL; }
functions
int rk808_set_suspend_voltage_range(struct regulator_dev *rdev, int uv) { unsigned int reg; int sel = regulator_map_voltage_linear_range(rdev, uv, uv); if (sel < 0) { return -EINVAL; }
functions
int rk808_set_suspend_enable(struct regulator_dev *rdev) { unsigned int reg; reg = rdev->desc->enable_reg + RK808_SLP_SET_OFF_REG_OFFSET; return regmap_update_bits(rdev->regmap, reg, rdev->desc->enable_mask, 0); }
functions
int rk808_set_suspend_disable(struct regulator_dev *rdev) { unsigned int reg; reg = rdev->desc->enable_reg + RK808_SLP_SET_OFF_REG_OFFSET; return regmap_update_bits(rdev->regmap, reg, rdev->desc->enable_mask, rdev->desc->enable_mask); }
functions
int rk808_regulator_dt_parse_pdata(struct device *dev, struct device *client_dev, struct regmap *map, struct rk808_regulator_data *pdata) { struct device_node *np; int tmp, ret = 0, i; np = of_get_child_by_name(client_dev->of_node, "regulators"); if (!np) { return -ENXIO; }
functions
int rk808_regulator_probe(struct platform_device *pdev) { struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent); struct i2c_client *client = rk808->i2c; struct regulator_config config = {}
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <time.h>
includes
#include <fcntl.h>
includes
#include <unistd.h>
includes
#include <ctype.h>
includes
#include <dirent.h>
includes
#include <errno.h>
includes
#include <sys/ioctl.h>
includes
#include <sys/stat.h>
includes
#include <sys/uio.h>
includes
#include <vmx.h>
includes
#include <os/errnoLib.h>
includes
#include <os/ioLib.h>
includes
#include <os/pathLib.h>
includes
#include <usr/usrFsLib.h>
functions
void ioHelp( void ) { static char *helpMessages[] = { "cd \"path\" Set current working path", "pwd Print working path", "ls [\"wpat\"[,long]] List contents of directory", "ll [\"wpat\"] List contents...
functions
STATUS cd( const char *path ) { STATUS status; if (ioDefPathCat((char *) path) != OK) { fprintf(stderr, "cd: error = %#x\n", errnoGet()); status = ERROR; }
functions
void pwd( void ) { char path[PATH_MAX]; ioDefPathGet(path); printf("%s\n", path); }
functions
STATUS dirList( FILE *fp, char *dirname, BOOL doLong, BOOL doTree ) { struct dirent *pDirEnt; struct stat fileStat; char filename[PATH_MAX]; char dirName[PATH_MAX]; DIR *pDir = NULL; char *pPat = NULL; STATUS status ...
functions
else if (doLong == TRUE) { fprintf(fp, "\nListing Directory %s:\n", dirName); }
functions
STATUS ls( char *dirname, BOOL doLong ) { return dirList(stdout, dirname, doLong, FALSE); }
functions
STATUS ll( char *dirname ) { return dirList(stdout, dirname, TRUE, FALSE); }
functions
STATUS lsr( char *dirname ) { return dirList(stdout, dirname, FALSE, TRUE); }
functions
STATUS llr( char *dirname ) { return dirList(stdout, dirname, TRUE, TRUE); }