type
stringclasses
5 values
content
stringlengths
9
163k
functions
int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, enum nl80211_iftype type) { int ret; ASSERT_RTNL(); if (type == ieee80211_vif_type_p2p(&sdata->vif)) return 0; if (ieee80211_sdata_running(sdata)) { ret = ieee80211_runtime_change_iftype(sdata, type); if (ret) return ret; }
functions
void ieee80211_assign_perm_addr(struct ieee80211_local *local, u8 *perm_addr, enum nl80211_iftype type) { struct ieee80211_sub_if_data *sdata; u64 mask, start, addr, val, inc; u8 *m; u8 tmp_addr[ETH_ALEN]; int i; /* default ... something at least */ memcpy(perm_addr, local->hw.wiphy->perm_addr, ETH_A...
functions
int ieee80211_if_add(struct ieee80211_local *local, const char *name, struct wireless_dev **new_wdev, enum nl80211_iftype type, struct vif_params *params) { struct net_device *ndev = NULL; struct ieee80211_sub_if_data *sdata = NULL; int ret, i; int txqs = 1; ASSERT_RTNL(); if (type == NL80211_IFTY...
functions
void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata) { ASSERT_RTNL(); mutex_lock(&sdata->local->iflist_mtx); list_del_rcu(&sdata->list); mutex_unlock(&sdata->local->iflist_mtx); synchronize_rcu(); if (sdata->dev) { unregister_netdevice(sdata->dev); }
functions
void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata) { if (WARN_ON_ONCE(!test_bit(SDATA_STATE_RUNNING, &sdata->state))) return; ieee80211_do_stop(sdata, true); ieee80211_teardown_sdata(sdata); }
functions
void ieee80211_remove_interfaces(struct ieee80211_local *local) { struct ieee80211_sub_if_data *sdata, *tmp; LIST_HEAD(unreg_list); LIST_HEAD(wdev_list); ASSERT_RTNL(); /* * Close all AP_VLAN interfaces first, as otherwise they * might be closed while the AP interface they belong to * is closed, causing un...
functions
int netdev_notify(struct notifier_block *nb, unsigned long state, void *ptr) { struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct ieee80211_sub_if_data *sdata; if (state != NETDEV_CHANGENAME) return NOTIFY_DONE; if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) return NOTIFY_DONE; if...
functions
int ieee80211_iface_init(void) { return register_netdevice_notifier(&mac80211_netdev_notifier); }
functions
void ieee80211_iface_exit(void) { unregister_netdevice_notifier(&mac80211_netdev_notifier); }
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <curl/curl.h>
defines
#define VERSION_STR "V1.0"
defines
#define my_curl_easy_setopt(A, B, C) \
defines
#define my_curl_easy_perform(A) \
functions
int _getch(void) { struct termios oldt, newt; int ch; tcgetattr( STDIN_FILENO, &oldt ); newt = oldt; newt.c_lflag &= ~( ICANON | ECHO ); tcsetattr( STDIN_FILENO, TCSANOW, &newt ); ch = getchar(); tcsetattr( STDIN_FILENO, TCSANOW, &oldt ); return ch; }
functions
void rtsp_options(CURL *curl, const char *uri) { CURLcode res = CURLE_OK; printf("\nRTSP: OPTIONS %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_OPTIONS); my_curl_easy_perform(curl); }
functions
void rtsp_describe(CURL *curl, const char *uri, const char *sdp_filename) { CURLcode res = CURLE_OK; FILE *sdp_fp = fopen(sdp_filename, "wt"); printf("\nRTSP: DESCRIBE %s\n", uri); if (sdp_fp == NULL) { fprintf(stderr, "Could not open '%s' for writing\n", sdp_filename); sdp_fp ...
functions
void rtsp_setup(CURL *curl, const char *uri, const char *transport) { CURLcode res = CURLE_OK; printf("\nRTSP: SETUP %s\n", uri); printf(" TRANSPORT %s\n", transport); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT, transport); my_curl_easy_set...
functions
void rtsp_play(CURL *curl, const char *uri, const char *range) { CURLcode res = CURLE_OK; printf("\nRTSP: PLAY %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, uri); my_curl_easy_setopt(curl, CURLOPT_RANGE, range); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY); my_c...
functions
void rtsp_teardown(CURL *curl, const char *uri) { CURLcode res = CURLE_OK; printf("\nRTSP: TEARDOWN %s\n", uri); my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_TEARDOWN); my_curl_easy_perform(curl); }
functions
void get_sdp_filename(const char *url, char *sdp_filename) { const char *s = strrchr(url, '/'); strcpy(sdp_filename, "video.sdp"); if (s != NULL) { s++; if (s[0] != '\0') { sprintf(sdp_filename, "%s.sdp", s); }
functions
void get_media_control_attribute(const char *sdp_filename, char *control) { int max_len = 256; char *s = malloc(max_len); FILE *sdp_fp = fopen(sdp_filename, "rt"); control[0] = '\0'; if (sdp_fp != NULL) { while (fgets(s, max_len - 2, sdp_fp) != NULL) { sscanf(...
main
int main(int argc, char * const argv[]) { #if 1 const char *transport = "RTP/AVP;unicast;client_port=1234-1235"; /* UDP */ #else const char *transport = "RTP/AVP/TCP;unicast;client_port=1234-1235"; /* TCP */ #endif const char *range = "0.000-"; int rc = EXIT_SUCCESS; char *base_name = NULL; printf("\nRTS...
includes
#include <stdio.h>
defines
#define ADD_BEFORE(ae, new) \
defines
#define IS_LASTREF(a) ((a) == lastarray)
defines
#define INVALIDATE_LASTREF(a) \
defines
#define SET_LASTREF(a, e) \
defines
#define UNSET_LASTREF() \
functions
else if (mflags & MATCH_QUOTED) { /* ${array[@]}
functions
else if (mflags & MATCH_QUOTED) { /* ${array[@]}
functions
void fatal_error(const char *s, ...) { fprintf(stderr, "array_test: fatal memory error\n"); abort(); }
functions
void programming_error(const char *s, ...) { fprintf(stderr, "array_test: fatal programming error\n"); abort(); }
includes
#include <string.h>
includes
#include <errno.h>
includes
#include <ctype.h>
includes
#include <stdlib.h>
includes
#include <assert.h>
defines
#define READF_TMP 50
functions
void set_integer (void *dest, GFC_INTEGER_LARGEST value, int length) { switch (length) { #ifdef HAVE_GFC_INTEGER_16 /* length=10 comes about for kind=10 real/complex BOZ, cf. PR41711. */ case 10: case 16: { GFC_INTEGER_16 tmp = value; memcpy (dest, (void *) &tmp, length); }
functions
GFC_UINTEGER_LARGEST si_max (int length) { #if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10 GFC_UINTEGER_LARGEST value; #endif switch (length) { #if defined HAVE_GFC_REAL_16 || defined HAVE_GFC_REAL_10 case 16: case 10: value = 1; for (int n = 1; n < 4 * length; n++) value...
functions
int convert_real (st_parameter_dt *dtp, void *dest, const char *buffer, int length) { char *endptr = NULL; int round_mode, old_round_mode; switch (dtp->u.p.current_unit->round_status) { case ROUND_COMPATIBLE: /* FIXME: As NEAREST but round away from zero for a tie. */ case ROUND_UNSPECIFIED: /...
functions
int convert_infnan (st_parameter_dt *dtp, void *dest, const char *buffer, int length) { const char *s = buffer; int is_inf, plus = 1; if (*s == '+') s++; else if (*s == '-') { s++; plus = 0; }
functions
void read_l (st_parameter_dt *dtp, const fnode *f, char *dest, int length) { char *p; int w; w = f->u.w; p = read_block_form (dtp, &w); if (p == NULL) return; while (*p == ' ') { if (--w == 0) goto bad; p++; }
functions
gfc_char4_t read_utf8 (st_parameter_dt *dtp, int *nbytes) { static const uchar masks[6] = { 0x7F, 0x1F, 0x0F, 0x07, 0x02, 0x01 }
functions
void read_utf8_char1 (st_parameter_dt *dtp, char *p, int len, int width) { gfc_char4_t c; char *dest; int nbytes; int i, j; len = (width < len) ? len : width; dest = (char *) p; /* Proceed with decoding one character at a time. */ for (j = 0; j < len; j++, dest++) { c = read_utf8 (dtp, &nb...
functions
void read_default_char1 (st_parameter_dt *dtp, char *p, int len, int width) { char *s; int m, n; s = read_block_form (dtp, &width); if (s == NULL) return; if (width > len) s += (width - len); m = (width > len) ? len : width; memcpy (p, s, m); n = len - width; if (n > 0) memset (p + ...
functions
void read_utf8_char4 (st_parameter_dt *dtp, void *p, int len, int width) { gfc_char4_t *dest; int nbytes; int i, j; len = (width < len) ? len : width; dest = (gfc_char4_t *) p; /* Proceed with decoding one character at a time. */ for (j = 0; j < len; j++, dest++) { *dest = read_utf8 (dtp, &n...
functions
void read_default_char4 (st_parameter_dt *dtp, char *p, int len, int width) { int m, n; gfc_char4_t *dest; if (is_char4_unit(dtp)) { gfc_char4_t *s4; s4 = (gfc_char4_t *) read_block_form4 (dtp, &width); if (s4 == NULL) return; if (width > len) s4 += (width - len); m = ((in...
functions
void read_a (st_parameter_dt *dtp, const fnode *f, char *p, int length) { int wi; int w; wi = f->u.w; if (wi == -1) /* '(A)' edit descriptor */ wi = length; w = wi; /* Read in w characters, treating comma as not a separator. */ dtp->u.p.sf_read_comma = 0; if (dtp->u.p.current_unit->flags.encodi...
functions
void read_a_char4 (st_parameter_dt *dtp, const fnode *f, char *p, int length) { int w; w = f->u.w; if (w == -1) /* '(A)' edit descriptor */ w = length; /* Read in w characters, treating comma as not a separator. */ dtp->u.p.sf_read_comma = 0; if (dtp->u.p.current_unit->flags.encoding == ENCODING_UT...
functions
char next_char (st_parameter_dt *dtp, char **p, int *w) { char c, *q; if (*w == 0) return '\0'; q = *p; c = *q++; *p = q; (*w)--; if (c != ' ') return c; if (dtp->u.p.blank_status != BLANK_UNSPECIFIED) return ' '; /* return a blank to signal a null */ /* At this point, the rest of t...
functions
void read_decimal (st_parameter_dt *dtp, const fnode *f, char *dest, int length) { GFC_UINTEGER_LARGEST value, maxv, maxv_10; GFC_INTEGER_LARGEST v; int w, negative; char c, *p; w = f->u.w; p = read_block_form (dtp, &w); if (p == NULL) return; p = eat_leading_spaces (&w, p); if (w == 0) {...
functions
void read_radix (st_parameter_dt *dtp, const fnode *f, char *dest, int length, int radix) { GFC_UINTEGER_LARGEST value, maxv, maxv_r; GFC_INTEGER_LARGEST v; int w, negative; char c, *p; w = f->u.w; p = read_block_form (dtp, &w); if (p == NULL) return; p = eat_leading_spaces (&w, p); if (w...
functions
void read_f (st_parameter_dt *dtp, const fnode *f, char *dest, int length) { char tmp[READF_TMP]; size_t buf_size = 0; int w, seen_dp, exponent; int exponent_sign; const char *p; char *buffer; char *out; int seen_int_digit; /* Seen a digit before the decimal point? */ int seen_dec_digit; /* Seen a d...
functions
else if (!seen_int_digit && !seen_dec_digit) { notify_std (&dtp->common, GFC_STD_LEGACY, "REAL input of style 'E+NN'"); *(out++) = '0'; }
functions
void read_x (st_parameter_dt *dtp, int n) { int length, q, q2; if ((dtp->u.p.current_unit->pad_status == PAD_NO || is_internal_unit (dtp)) && dtp->u.p.current_unit->bytes_left < n) n = dtp->u.p.current_unit->bytes_left; if (n == 0) return; length = n; if (is_internal_unit (dtp)) { ...
functions
else if (q == '\n' || q == '\r') { /* Unexpected end of line. Set the position. */ dtp->u.p.sf_seen_eor = 1; /* If we see an EOR during non-advancing I/O, we need to skip the rest of the I/O statement. Set the corresponding flag. */ if (dtp->u.p.advance_status == ADVANCE_NO || dtp->u.p.seen_dolla...
includes
#include <linux/module.h>
includes
#include <linux/blkdev.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/errno.h>
includes
#include <linux/kernel.h>
includes
#include <linux/sched.h>
includes
#include <linux/mm.h>
includes
#include <linux/string.h>
includes
#include <linux/uaccess.h>
includes
#include <scsi/scsi.h>
includes
#include <scsi/scsi_cmnd.h>
includes
#include <scsi/scsi_device.h>
includes
#include <scsi/scsi_eh.h>
includes
#include <scsi/scsi_host.h>
includes
#include <scsi/scsi_ioctl.h>
includes
#include <scsi/sg.h>
includes
#include <scsi/scsi_dbg.h>
defines
#define NORMAL_RETRIES 5
defines
#define IOCTL_NORMAL_TIMEOUT (10 * HZ)
defines
#define MAX_BUF PAGE_SIZE
functions
int ioctl_probe(struct Scsi_Host *host, void __user *buffer) { unsigned int len, slen; const char *string; if (buffer) { if (get_user(len, (unsigned int __user *) buffer)) return -EFAULT; if (host->hostt->info) string = host->hostt->info(host); else string = host->hostt->name; if (string) { sle...
functions
int ioctl_internal_command(struct scsi_device *sdev, char *cmd, int timeout, int retries) { int result; struct scsi_sense_hdr sshdr; SCSI_LOG_IOCTL(1, sdev_printk(KERN_INFO, sdev, "Trying ioctl with scsi command %d\n", *cmd)); result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, &sshdr, t...
functions
int scsi_set_medium_removal(struct scsi_device *sdev, char state) { char scsi_cmd[MAX_COMMAND_SIZE]; int ret; if (!sdev->removable || !sdev->lockable) return 0; scsi_cmd[0] = ALLOW_MEDIUM_REMOVAL; scsi_cmd[1] = 0; scsi_cmd[2] = 0; scsi_cmd[3] = 0; scsi_cmd[4] = state; scsi_cmd[5] = 0; ret = ioctl_i...
functions
int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg) { struct device *dev = scsi_get_device(sdev->host); const char *name; if (!dev) return -ENXIO; name = dev_name(dev); /* compatibility with old ioctl which only returned * 20 characters */ return copy_to_user(arg, name, min(str...
functions
int scsi_ioctl_common(struct scsi_device *sdev, int cmd, void __user *arg) { char scsi_cmd[MAX_COMMAND_SIZE]; struct scsi_sense_hdr sense_hdr; /* Check for deprecated ioctls ... all the ioctls which don't * follow the new unique numbering scheme are deprecated */ switch (cmd) { case SCSI_IOCTL_SEND_COMMAND: ca...
functions
int scsi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) { int ret = scsi_ioctl_common(sdev, cmd, arg); if (ret != -ENOIOCTLCMD) return ret; if (sdev->host->hostt->ioctl) return sdev->host->hostt->ioctl(sdev, cmd, arg); return -EINVAL; }
functions
int scsi_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) { int ret = scsi_ioctl_common(sdev, cmd, arg); if (ret != -ENOIOCTLCMD) return ret; if (sdev->host->hostt->compat_ioctl) return sdev->host->hostt->compat_ioctl(sdev, cmd, arg); return ret; }
functions
int scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev, int cmd, bool ndelay) { if (cmd == SG_SCSI_RESET && ndelay) { if (scsi_host_in_recovery(sdev->host)) return -EAGAIN; }
includes
#include <stdarg.h>
defines
#define A 3
defines
#define B 4
defines
#define N 256
functions
void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy) { int i; h /= 16; for (i = 0; i < h; i++) { dst[0] += A*src[0] + src[stride]; dst[1] += A*src[1] + src[1+stride]; dst[2] += A*src[2] + src[2+stride]; dst[3] += A*src[3] + src[3+stride]; ds...
main
int main (void) { int i; check_vect (); for (i = 0; i < N; i++) { dst[i] = 0; src[i] = i; }
functions
_Decimal128 __bid_floatunssitd (USItype x) { union decimal128 res; res.i = __bid128_from_uint32 (x); return (res.d); }
includes
#include <linux/module.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/delay.h>
includes
#include <linux/string.h>
includes
#include <linux/ctype.h>