blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 3
333
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
58
| license_type
stringclasses 2
values | repo_name
stringlengths 5
113
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 604
values | visit_date
timestamp[us]date 2016-08-02 21:20:34
2023-09-06 10:17:08
| revision_date
timestamp[us]date 1970-01-01 00:00:00
2023-09-05 20:12:54
| committer_date
timestamp[us]date 1970-01-01 00:00:00
2023-09-05 20:12:54
| github_id
int64 966
664M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 23
values | gha_event_created_at
timestamp[us]date 2012-06-18 16:43:44
2023-09-14 21:58:39
⌀ | gha_created_at
timestamp[us]date 2008-02-03 21:17:16
2023-07-07 15:57:14
⌀ | gha_language
stringclasses 121
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 128
17.8k
| extension
stringclasses 134
values | content
stringlengths 128
8.19k
| authors
listlengths 1
1
| author_id
stringlengths 1
143
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
89efef9026ebcddb042b6c7edf2e90a146ec4570 | 7d01906145dbb0b1f301337cae6a40b8fcab4413 | /lib/fontops/otl/gsub-single.h | f4349742408d03c50febafc177f6be706129209c | [
"Apache-2.0"
] | permissive | huntzhan/otfcc | 443d9cea75ea4ee7acd0f54d3a80845eb01bd1ef | f84810755cfdb24599dbc97a3212bbe3de94a3f9 | refs/heads/master | 2021-01-18T08:10:28.988610 | 2016-07-31T07:26:07 | 2016-07-31T07:26:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 219 | h | #ifndef CARYLL_FONTOPS_OTL_GSUB_SINGLE_H
#define CARYLL_FONTOPS_OTL_GSUB_SINGLE_H
#include "common.h"
bool consolidate_gsub_single(caryll_font *font, table_otl *table, otl_subtable *_subtable, sds lookupName);
#endif
| [
"[email protected]"
] | |
babac96ef253b9b560dedd1f4c5852c614b384a9 | dbe74fdf6bded2ceb98eec965fe05ddf7d6dd931 | /models/Flight/source/ivory.h | 9162753fcd4dcdce8f8e22b81baadb8d20f9100a | [
"BSD-3-Clause"
] | permissive | smaccm/smaccm | 7f79bf5fe74bb1b856d69625fab4ffb1e138101e | 7393c423b5aca1a272a88cbb89b5dcfd08a5a47c | refs/heads/master | 2021-01-23T15:51:42.639585 | 2019-02-21T22:28:42 | 2019-02-21T22:28:42 | 12,084,628 | 27 | 27 | BSD-3-Clause | 2019-01-02T17:22:41 | 2013-08-13T14:59:47 | Java | UTF-8 | C | false | false | 3,093 | h | #ifndef IVORY_H
#define IVORY_H
#include<stdint.h>
#include<math.h>
#include<stdbool.h>
#include<string.h>
/* Requires and Provides statements */
#ifdef IVORY_TEST
#ifdef __arm__
/* TODO: We could write a better "assert" that suspends all RTOS
* tasks and tries to write a debug string somewhere, but this is at
* least somewhat useful while running under GDB. */
#define ivory_assert(arg) \
do { \
if (!(arg)) { \
asm volatile("bkpt"); \
} \
} while (0)
#define REQUIRES(arg) ivory_assert(arg)
#define ENSURES(arg) ivory_assert(arg)
#define ASSUMES(arg) ivory_assert(arg)
#define ASSERTS(arg) ivory_assert(arg)
#else /* ! __arm__ */
#include <assert.h>
#define REQUIRES(arg) assert(arg)
#define ENSURES(arg) assert(arg)
#define ASSUMES(arg) assert(arg)
#define ASSERTS(arg) assert(arg)
#endif /* __arm__ */
#endif /* IVORY_TEST */
#ifdef IVORY_CBMC
#define REQUIRES(arg) __CPROVER_assume(arg)
#define ENSURES(arg) __CPROVER_assert(arg, "")
#define ASSERTS(arg) __CPROVER_assert(arg, "")
#define ASSUMES(arg) __CPROVER_assume(arg)
#endif /* IVORY_CBMC */
#ifdef IVORY_DEPLOY
#define REQUIRES(arg)
#define ENSURES(arg)
#define ASSERTS(arg)
#define ASSUMES(arg)
#endif /* IVORY_DEPLOY */
/* So CBMC can handle forever loops. */
#ifdef IVORY_CBMC
#define FOREVER forever_loop < 1
#define FOREVER_INC forever_loop++
#else
#define FOREVER true
#define FOREVER_INC
#endif
/* abs implementations */
static inline char abs_char(char i) {
return i >= 0 ? i : -i;
}
static inline int8_t abs_i8(int8_t i) {
return i >= 0 ? i : -i;
}
static inline int16_t abs_i16(int16_t i) {
return i >= 0 ? i : -i;
}
static inline int32_t abs_i32(int32_t i) {
return i >= 0 ? i : -i;
}
static inline int64_t abs_i64(int64_t i) {
return i >= 0 ? i : -i;
}
/* signum implementations */
static inline char signum_char(char i) {
if (i > 0) return 1;
if (i < 0) return (-1);
return 0;
}
static inline int8_t signum_i8(int8_t i) {
if (i > 0) return 1;
if (i < 0) return (-1);
return 0;
}
static inline int16_t signum_i16(int16_t i) {
if (i > 0) return 1;
if (i < 0) return (-1);
return 0;
}
static inline int32_t signum_i32(int32_t i) {
if (i > 0) return 1;
if (i < 0) return (-1);
return 0;
}
static inline int64_t signum_i64(int64_t i) {
if (i > 0) return 1;
if (i < 0) return (-1);
return 0;
}
static inline float signum_float(float i) {
if (i > 0) return 1;
if (i < 0) return (-1);
return 0;
}
static inline double signum_double(double i) {
if (i > 0) return 1;
if (i < 0) return (-1);
return 0;
}
static inline uint8_t signum_u8(uint8_t i) {
if (i > 0) return 1;
return 0;
}
static inline uint16_t signum_u16(uint16_t i) {
if (i > 0) return 1;
return 0;
}
static inline uint32_t signum_u32(uint32_t i) {
if (i > 0) return 1;
return 0;
}
static inline uint64_t signum_u64(uint64_t i) {
if (i > 0) return 1;
return 0;
}
/* index type */
/* machine-depdentent size */
typedef int idx;
#endif // IVORY_H
| [
"[email protected]"
] | |
16e269c7874ab339e844fdc2cdb3dd20e9580cc8 | a1af6fa9c319412d5405bbcf22d3923be3883848 | /3650b/01/add1.c | f0b091b3936fb2f1866d14ff71724a24cde4c10d | [] | no_license | NatTuck/scratch-2020-01 | 4b076a8d8431952cba2d20ad69344ae5b915c8e7 | 085a82a0b9b90e0494cee6306ed20fbe683a871c | refs/heads/master | 2020-12-02T21:48:11.725406 | 2020-04-13T03:45:13 | 2020-04-13T03:45:13 | 231,131,261 | 2 | 20 | null | null | null | null | UTF-8 | C | false | false | 140 | c | long
add1(long x)
{
return x + 1;
}
int
main(int _argc, char* _argv[])
{
long x = add1(5);
printf("%ld\n", x);
return 0;
}
| [
"[email protected]"
] | |
daf6f4900c1c950baad2d13c31027f34b8c8feb6 | e805ac1654afd2419a5a11091bd631e3ac976db1 | /sebastien_rt/lib/libft/ft_strcpy.c | f5b37f9323829d44e5dd19a21dedf1d3c8823a7d | [] | no_license | chabaud/RTGroupe | 768bb6fe3935e260fecc07c66204a6dfd8f56148 | e8b097ddc30bf4d692be106521ceba83262690d6 | refs/heads/master | 2021-08-08T05:27:13.861691 | 2017-11-09T17:15:46 | 2017-11-09T17:15:46 | 110,144,279 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,095 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abara <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/11/24 08:59:14 by abara #+# #+# */
/* Updated: 2015/12/02 15:07:55 by abara ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcpy(char *dest, const char *src)
{
int index;
index = 0;
while (src[index])
{
dest[index] = src[index];
index++;
}
dest[index] = src[index];
return (dest);
}
| [
"[email protected]"
] | |
8abd1757a74e4e8de9a2f41c97b392cb23b50dbb | 3a4c1cd06e305a2a3814b824f4427442c915df00 | /libs/tomcrypt/encauth/gcm/gcm_add_aad.c | 26e47f647b8c201cece12a76936b944c3fee9fd5 | [
"WTFPL",
"MIT",
"CC0-1.0",
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | vinthewrench/S4 | 8544cd61b344ff445488f86ff767a7fab4961335 | c604ad8a17c25e1af5b3d68cefdede5448344637 | refs/heads/master | 2021-12-12T05:39:44.966762 | 2021-12-08T18:22:17 | 2021-12-08T18:22:17 | 45,482,820 | 3 | 0 | NOASSERTION | 2023-02-14T23:54:33 | 2015-11-03T17:21:06 | C | UTF-8 | C | false | false | 2,999 | c | /* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, [email protected], http://libtom.org
*/
/**
@file gcm_add_aad.c
GCM implementation, Add AAD data to the stream, by Tom St Denis
*/
#include "tomcrypt.h"
#ifdef LTC_GCM_MODE
/**
Add AAD to the GCM state
@param gcm The GCM state
@param adata The additional authentication data to add to the GCM state
@param adatalen The length of the AAD data.
@return CRYPT_OK on success
*/
int gcm_add_aad(gcm_state *gcm,
const unsigned char *adata, unsigned long adatalen)
{
unsigned long x;
int err;
#ifdef LTC_FAST
unsigned long y;
#endif
LTC_ARGCHK(gcm != NULL);
if (adatalen > 0) {
LTC_ARGCHK(adata != NULL);
}
if (gcm->buflen > 16 || gcm->buflen < 0) {
return CRYPT_INVALID_ARG;
}
if ((err = cipher_is_valid(gcm->cipher)) != CRYPT_OK) {
return err;
}
/* in IV mode? */
if (gcm->mode == LTC_GCM_MODE_IV) {
/* let's process the IV */
if (gcm->ivmode || gcm->buflen != 12) {
for (x = 0; x < (unsigned long)gcm->buflen; x++) {
gcm->X[x] ^= gcm->buf[x];
}
if (gcm->buflen) {
gcm->totlen += gcm->buflen * CONST64(8);
gcm_mult_h(gcm, gcm->X);
}
/* mix in the length */
zeromem(gcm->buf, 8);
STORE64H(gcm->totlen, gcm->buf+8);
for (x = 0; x < 16; x++) {
gcm->X[x] ^= gcm->buf[x];
}
gcm_mult_h(gcm, gcm->X);
/* copy counter out */
XMEMCPY(gcm->Y, gcm->X, 16);
zeromem(gcm->X, 16);
} else {
XMEMCPY(gcm->Y, gcm->buf, 12);
gcm->Y[12] = 0;
gcm->Y[13] = 0;
gcm->Y[14] = 0;
gcm->Y[15] = 1;
}
XMEMCPY(gcm->Y_0, gcm->Y, 16);
zeromem(gcm->buf, 16);
gcm->buflen = 0;
gcm->totlen = 0;
gcm->mode = LTC_GCM_MODE_AAD;
}
if (gcm->mode != LTC_GCM_MODE_AAD || gcm->buflen >= 16) {
return CRYPT_INVALID_ARG;
}
x = 0;
#ifdef LTC_FAST
if (gcm->buflen == 0) {
for (x = 0; x < (adatalen & ~15); x += 16) {
for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) {
*((LTC_FAST_TYPE*)(&gcm->X[y])) ^= *((LTC_FAST_TYPE*)(&adata[x + y]));
}
gcm_mult_h(gcm, gcm->X);
gcm->totlen += 128;
}
adata += x;
}
#endif
/* start adding AAD data to the state */
for (; x < adatalen; x++) {
gcm->X[gcm->buflen++] ^= *adata++;
if (gcm->buflen == 16) {
/* GF mult it */
gcm_mult_h(gcm, gcm->X);
gcm->buflen = 0;
gcm->totlen += 128;
}
}
return CRYPT_OK;
}
#endif
/* $Source$ */
/* $Revision$ */
/* $Date$ */
| [
"[email protected]"
] | |
456e6641e85b6acb456b3da4b603199908d8a389 | 9ceacf33fd96913cac7ef15492c126d96cae6911 | /lib/libcrypto/hidden/openssl/dsa.h | b2b0058cb9ddb9a42e7f99f3a70e7f5df624202d | [] | no_license | openbsd/src | ab97ef834fd2d5a7f6729814665e9782b586c130 | 9e79f3a0ebd11a25b4bff61e900cb6de9e7795e9 | refs/heads/master | 2023-09-02T18:54:56.624627 | 2023-09-02T15:16:12 | 2023-09-02T15:16:12 | 66,966,208 | 3,394 | 1,235 | null | 2023-08-08T02:42:25 | 2016-08-30T18:18:25 | C | UTF-8 | C | false | false | 3,008 | h | /* $OpenBSD: dsa.h,v 1.1 2023/07/08 14:28:15 beck Exp $ */
/*
* Copyright (c) 2023 Bob Beck <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _LIBCRYPTO_DSA_H
#define _LIBCRYPTO_DSA_H
#ifndef _MSC_VER
#include_next <openssl/dsa.h>
#else
#include "../include/openssl/dsa.h"
#endif
#include "crypto_namespace.h"
LCRYPTO_USED(d2i_DSAparams_bio);
LCRYPTO_USED(i2d_DSAparams_bio);
LCRYPTO_USED(d2i_DSAparams_fp);
LCRYPTO_USED(i2d_DSAparams_fp);
LCRYPTO_USED(DSAparams_dup);
LCRYPTO_USED(DSA_SIG_new);
LCRYPTO_USED(DSA_SIG_free);
LCRYPTO_USED(i2d_DSA_SIG);
LCRYPTO_USED(d2i_DSA_SIG);
LCRYPTO_USED(DSA_SIG_get0);
LCRYPTO_USED(DSA_SIG_set0);
LCRYPTO_USED(DSA_do_sign);
LCRYPTO_USED(DSA_do_verify);
LCRYPTO_USED(DSA_OpenSSL);
LCRYPTO_USED(DSA_set_default_method);
LCRYPTO_USED(DSA_get_default_method);
LCRYPTO_USED(DSA_set_method);
LCRYPTO_USED(DSA_new);
LCRYPTO_USED(DSA_new_method);
LCRYPTO_USED(DSA_free);
LCRYPTO_USED(DSA_up_ref);
LCRYPTO_USED(DSA_size);
LCRYPTO_USED(DSA_bits);
LCRYPTO_USED(DSA_sign_setup);
LCRYPTO_USED(DSA_sign);
LCRYPTO_USED(DSA_verify);
LCRYPTO_USED(DSA_get_ex_new_index);
LCRYPTO_USED(DSA_set_ex_data);
LCRYPTO_USED(DSA_get_ex_data);
LCRYPTO_USED(DSA_security_bits);
LCRYPTO_USED(d2i_DSAPublicKey);
LCRYPTO_USED(i2d_DSAPublicKey);
LCRYPTO_USED(d2i_DSAPrivateKey);
LCRYPTO_USED(i2d_DSAPrivateKey);
LCRYPTO_USED(d2i_DSAparams);
LCRYPTO_USED(i2d_DSAparams);
LCRYPTO_USED(DSA_generate_parameters);
LCRYPTO_USED(DSA_generate_parameters_ex);
LCRYPTO_USED(DSA_generate_key);
LCRYPTO_USED(DSAparams_print);
LCRYPTO_USED(DSA_print);
LCRYPTO_USED(DSAparams_print_fp);
LCRYPTO_USED(DSA_print_fp);
LCRYPTO_USED(DSA_dup_DH);
LCRYPTO_USED(DSA_get0_pqg);
LCRYPTO_USED(DSA_set0_pqg);
LCRYPTO_USED(DSA_get0_key);
LCRYPTO_USED(DSA_set0_key);
LCRYPTO_USED(DSA_get0_p);
LCRYPTO_USED(DSA_get0_q);
LCRYPTO_USED(DSA_get0_g);
LCRYPTO_USED(DSA_get0_pub_key);
LCRYPTO_USED(DSA_get0_priv_key);
LCRYPTO_USED(DSA_clear_flags);
LCRYPTO_USED(DSA_test_flags);
LCRYPTO_USED(DSA_set_flags);
LCRYPTO_USED(DSA_get0_engine);
LCRYPTO_USED(DSA_meth_new);
LCRYPTO_USED(DSA_meth_free);
LCRYPTO_USED(DSA_meth_dup);
LCRYPTO_USED(DSA_meth_get0_name);
LCRYPTO_USED(DSA_meth_set1_name);
LCRYPTO_USED(DSA_meth_set_sign);
LCRYPTO_USED(DSA_meth_set_finish);
LCRYPTO_USED(ERR_load_DSA_strings);
#endif /* _LIBCRYPTO_DSA_H */
| [
"[email protected]"
] | |
e2d724d99a2761c69f63b53560a08e564f75e346 | f64c534ca3274332a20b48ee5d29dc577b98a602 | /network/phtread_mutex/mutex.c | 375ded3776d6976d0db2817309e875f052091243 | [] | no_license | wolf623/c_code | 7bfbdd8c95f685b3d00663bbd09b3ce4ef130cae | 49531c8ca65fb1e8ebd5145756a60deffbe614aa | refs/heads/master | 2021-07-09T02:19:02.902656 | 2016-09-14T01:52:13 | 2016-09-14T01:52:13 | 9,499,041 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,808 | c | #include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#define PTHREAD_NUM 2 //max pthread number
#define FILE_NAME "temp.txt"
FILE *fp = NULL;
int g_value = 0;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
typedef void (*func)(int *);
void write_file1(int *arg)
{
pthread_mutex_lock(&mutex);
printf("%s(): arg %d\n", __FUNCTION__, *arg);
if(fp == NULL)
{
fp = fopen(FILE_NAME, "w+");
if(fp == NULL)
{
printf("fopen failed!\n", strerror(errno));
return;
}
}
char *ptr = "write somgthing here...";
fwrite(ptr, strlen(ptr), 1, fp);
printf("in func1 before add, value %d\n", g_value);
struct timeval now;
struct timespec outtime;
gettimeofday(&now, NULL);
outtime.tv_sec = now.tv_sec + 2;
outtime.tv_nsec = now.tv_usec * 1000;
//pthread_cond_wait(&cond, &mutex);
pthread_cond_timedwait(&cond, &mutex, &outtime);
printf("time out...I am ready to go!!!\n");
g_value++;
printf("in func1 after add, value %d\n", g_value);
pthread_mutex_unlock(&mutex);
pthread_exit("pthread exit message - 1");
}
void write_file2(int *arg)
{
pthread_mutex_lock(&mutex);
printf("%s(): arg %d\n", __FUNCTION__, *arg);
if(fp == NULL)
{
fp = fopen(FILE_NAME, "w+");
if(fp == NULL)
{
printf("fopen failed!\n", strerror(errno));
return;
}
}
char *ptr = "write somgthing here...";
fwrite(ptr, strlen(ptr), 1, fp);
printf("in func2 before add, value %d\n", g_value);
pthread_cond_wait(&cond, &mutex);
g_value++;
printf("in func2 after add, value %d\n", g_value);
pthread_mutex_unlock(&mutex);
pthread_exit("pthread exit message - 2");
}
int main(int argc, char *argv[])
{
pthread_t pthread_ns[PTHREAD_NUM];
int i = 0, ec = 0;
void *msg = NULL;
func func_array[PTHREAD_NUM] = {write_file1, write_file2};
pthread_attr_t attr;
pthread_attr_init(&attr);
//pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); //fenli
pthread_mutexattr_t mtattr;
pthread_mutexattr_init(&mtattr);
pthread_mutexattr_settype(&mtattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &mtattr);
pthread_cond_init(&cond, NULL);
//pthread_condattr_setclock(&cond, (clockid_t)CLOCK_MONOTONIC); //CLOCK_REALTIME
for(i=0; i<PTHREAD_NUM; i++)
{
ec = pthread_create(&pthread_ns[i], &attr, (void *(*)(void *))func_array[i], &i);
if(ec != 0)
{
printf("pthread failed!\n");
}
}
sleep(1);
printf("I am here...\n");
//pthread_cond_broadcast(&cond);
pthread_cond_signal(&cond);
for(i=0; i<PTHREAD_NUM; i++)
{
pthread_join(pthread_ns[i], &msg);
printf("end...%s\n", (char *)msg);
}
pthread_attr_destroy(&attr);
pthread_mutexattr_destroy(&mtattr);
pthread_cond_destroy(&cond);
pthread_mutex_destroy(&mutex);
return 0;
}
| [
"[email protected]"
] | |
83e945f48ad687876dfa5a54013b719ec7e03dfe | fc9987b603be2e9541c087d9436b16cb6173128b | /components/ble/ble-profiles/sources/services/svc_scpss.h | c8caa441db9b50145b44ea5b3318bc376a9f13ec | [] | no_license | forzalife/zephyr-kit | 1da829b24db3af79696ed7a51a6983585beea225 | f6e8ac984593c95054452276e9e8b99e20594bd7 | refs/heads/master | 2023-08-21T23:26:54.336463 | 2020-11-28T10:52:27 | 2020-11-28T10:52:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,559 | h | /*************************************************************************************************/
/*!
* \file
*
* \brief Example Scan Parameter Service Server implementation.
*
* Copyright (c) 2016-2018 Arm Ltd.
*
* Copyright (c) 2019 Packetcraft, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*************************************************************************************************/
#ifndef SVC_SCPSS_H
#define SVC_SCPSS_H
#ifdef __cplusplus
extern "C" {
#endif
/*! \addtogroup SCAN_PARAMETER_SERVICE
* \{ */
/**************************************************************************************************
Handle Ranges
**************************************************************************************************/
/** \name Scan Parameter Service Handles
*
*/
/**@{*/
#define SCPSS_START_HDL 0x0300 /*!< \brief Start handle. */
#define SCPSS_END_HDL (SCPSS_MAX_HDL - 1) /*!< \brief End handle. */
/**************************************************************************************************
Handles
**************************************************************************************************/
/*! \brief Scan Parameter Service Handles */
enum
{
SCPSS_SVC_HDL = SCPSS_START_HDL, /*!< \brief Scan Parameter Server Service declaration */
SCPSS_SIW_CH_HDL, /*!< \brief Scan Interval Window characteristic */
SCPSS_SIW_HDL, /*!< \brief Scan Interval Window */
SCPSS_MAX_HDL /*!< \brief Maximum handle. */
};
/**@}*/
/**************************************************************************************************
Function Declarations
**************************************************************************************************/
/*************************************************************************************************/
/*!
* \brief Add the services to the attribute server.
*
* \return None.
*/
/*************************************************************************************************/
void SvcScpssAddGroup(void);
/*************************************************************************************************/
/*!
* \brief Remove the services from the attribute server.
*
* \return None.
*/
/*************************************************************************************************/
void SvcScpssRemoveGroup(void);
/*************************************************************************************************/
/*!
* \brief Register callbacks for the service.
*
* \param writeCback Write callback function.
*
* \return None.
*/
/*************************************************************************************************/
void SvcScpssCbackRegister(attsWriteCback_t writeCback);
/*! \} */ /* SCAN_PARAMETER_SERVICE */
#ifdef __cplusplus
};
#endif
#endif /* SVC_SCPSS_H */
| [
"[email protected]"
] | |
563d1a8494b9b9d953ecd87875191a27618ed166 | 5f5fe64ea6ebee438152a69e01948ba5f9025dea | /pchar.c | ff6873913eba2ef64e386afc358059c2240bc607 | [] | no_license | blsoko/monty | 7d101fcd61a9c4724b67be3ac10b05f70f551f60 | 534000b62359d5411af715bb7f43fb3036605017 | refs/heads/master | 2022-12-10T06:48:44.813102 | 2020-09-18T20:13:07 | 2020-09-18T20:13:07 | 263,770,811 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 550 | c | #include "monty.h"
/**
* pchar - release memory
*
* @stack: stack
* @line_number: number of line
*
* Return: nothing
*/
void pchar(stack_t **stack, unsigned int line_number)
{
int x = 0;
if ((*stack) == NULL)
{
jutsu_liberacion();
kai(stack);
fprintf(stderr, "L%u: can't pchar, stack empty\n", line_number);
exit(EXIT_FAILURE);
}
x = (*stack)->n;
if (x < 0 || x > 127)
{
jutsu_liberacion();
kai(stack);
fprintf(stderr, "L%u: can't pchar, value out of range\n", line_number);
exit(EXIT_FAILURE);
}
printf("%c\n", x);
}
| [
"[email protected]"
] | |
f4b10dc640d6aa1aaee4d232a3d405693b6134a6 | 6580c296be797a5ac8d5fb655ebb2e7b23b75254 | /corelib/Oes_resources_en_US.h | 285ff3560e2ec442d053d0740074324e1df87d02 | [
"MIT",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | navicore/oescript_c | 2add949951c2fa94cd62fdf7f3073ca8f2dc411a | f0bf8460dfb98bbc45070565934f753ef026b1dc | refs/heads/master | 2022-12-22T04:06:39.024882 | 2014-08-19T14:59:10 | 2014-08-19T14:59:10 | 14,442,589 | 0 | 0 | Apache-2.0 | 2022-11-25T21:16:50 | 2013-11-16T05:59:50 | C | UTF-8 | C | false | false | 224 | h | /*
* OeScript http://www.oescript.net
* Copyright 2012 Ed Sweeney, all rights reserved.
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef OES_RES_EN_US_H
#define OES_RES_EN_US_H
#endif
#ifdef __cplusplus
}
#endif
| [
"[email protected]"
] | |
3878a434fd9014d277b04e8222533fd85008bfb2 | 0c0dac0626aaadd561e250fb47eeede8312d5d82 | /sbin/unwind/unwind.h | bbd0f9657c98a03b6bdd4058999d16d5102374e5 | [] | no_license | arekinath/openbsd-6.9-a3 | 5c25a287c481699a09c9c4630c5c773a38412e0a | 744a280e5e7d8e71664847a5d9a9693e80f7f5ec | refs/heads/main | 2023-08-19T04:33:48.119966 | 2021-10-05T02:07:50 | 2021-10-05T11:12:50 | 413,786,977 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,071 | h | /* $OpenBSD: unwind.h,v 1.53 2021/01/27 08:30:50 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <[email protected]>
* Copyright (c) 2004 Esben Norby <[email protected]>
* Copyright (c) 2003, 2004 Henning Brauer <[email protected]>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
#include <sys/tree.h>
#include <netinet/in.h> /* INET6_ADDRSTRLEN */
#include <event.h>
#include <imsg.h>
#include <netdb.h> /* NI_MAXHOST */
#include <stdint.h>
#ifndef nitems
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
#endif
#define _PATH_CONF_FILE "/etc/unwind.conf"
#define _PATH_UNWIND_SOCKET "/dev/unwind.sock"
#define UNWIND_USER "_unwind"
#define OPT_VERBOSE 0x00000001
#define OPT_VERBOSE2 0x00000002
#define OPT_VERBOSE3 0x00000004
#define OPT_NOACTION 0x00000008
#define ROOT_DNSKEY_TTL 172800 /* TTL from authority */
#define KSK2017 ". 172800 IN DNSKEY 257 3 8 AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kvArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+eoZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfdRUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwNR1AkUTV74bU="
#define IMSG_DATA_SIZE(imsg) ((imsg).hdr.len - IMSG_HEADER_SIZE)
enum uw_resolver_type {
UW_RES_RECURSOR,
UW_RES_DHCP,
UW_RES_ODOT_DHCP,
UW_RES_ASR,
UW_RES_FORWARDER,
UW_RES_ODOT_FORWARDER,
UW_RES_DOT,
UW_RES_NONE
};
static const char * const uw_resolver_type_str[] = {
"recursor",
"dhcp",
"oDoT-dhcp",
"stub",
"forwarder",
"oDoT-forwarder",
"DoT"
};
static const char * const uw_resolver_type_short[] = {
"rec",
"dhcp",
"dhcp*",
"stub",
"forw",
"forw*",
"DoT"
};
struct imsgev {
struct imsgbuf ibuf;
void (*handler)(int, short, void *);
struct event ev;
short events;
};
enum imsg_type {
IMSG_NONE,
IMSG_CTL_LOG_VERBOSE,
IMSG_CTL_RELOAD,
IMSG_CTL_STATUS,
IMSG_CTL_AUTOCONF,
IMSG_CTL_MEM,
IMSG_RECONF_CONF,
IMSG_RECONF_BLOCKLIST_FILE,
IMSG_RECONF_FORWARDER,
IMSG_RECONF_DOT_FORWARDER,
IMSG_RECONF_FORCE,
IMSG_RECONF_END,
IMSG_UDP4SOCK,
IMSG_UDP6SOCK,
IMSG_TCP4SOCK,
IMSG_TCP6SOCK,
IMSG_ROUTESOCK,
IMSG_CONTROLFD,
IMSG_STARTUP,
IMSG_STARTUP_DONE,
IMSG_SOCKET_IPC_FRONTEND,
IMSG_SOCKET_IPC_RESOLVER,
IMSG_QUERY,
IMSG_ANSWER,
IMSG_CTL_RESOLVER_INFO,
IMSG_CTL_AUTOCONF_RESOLVER_INFO,
IMSG_CTL_MEM_INFO,
IMSG_CTL_END,
IMSG_HTTPSOCK,
IMSG_TAFD,
IMSG_NEW_TA,
IMSG_NEW_TAS_ABORT,
IMSG_NEW_TAS_DONE,
IMSG_NETWORK_CHANGED,
IMSG_BLFD,
IMSG_REPLACE_DNS,
IMSG_NEW_DNS64_PREFIXES_START,
IMSG_NEW_DNS64_PREFIX,
IMSG_NEW_DNS64_PREFIXES_DONE,
IMSG_CHANGE_AFS,
};
struct uw_forwarder {
TAILQ_ENTRY(uw_forwarder) entry;
char ip[INET6_ADDRSTRLEN];
char auth_name[NI_MAXHOST];
uint16_t port;
uint32_t if_index;
int src;
};
struct force_tree_entry {
RB_ENTRY(force_tree_entry) entry;
char domain[NI_MAXHOST];
enum uw_resolver_type type;
int acceptbogus;
};
RB_HEAD(force_tree, force_tree_entry);
struct resolver_preference {
enum uw_resolver_type types[UW_RES_NONE];
int len;
};
TAILQ_HEAD(uw_forwarder_head, uw_forwarder);
struct uw_conf {
struct uw_forwarder_head uw_forwarder_list;
struct uw_forwarder_head uw_dot_forwarder_list;
struct force_tree force;
struct resolver_preference res_pref;
char *blocklist_file;
int blocklist_log;
};
struct query_imsg {
uint64_t id;
char qname[NI_MAXHOST];
int t;
int c;
struct timespec tp;
};
struct answer_header {
uint64_t id;
int srvfail;
int bogus;
int answer_len;
};
extern uint32_t cmd_opts;
/* unwind.c */
void main_imsg_compose_frontend(int, pid_t, void *, uint16_t);
void main_imsg_compose_frontend_fd(int, pid_t, int);
void main_imsg_compose_resolver(int, pid_t, void *, uint16_t);
void merge_config(struct uw_conf *, struct uw_conf *);
void imsg_event_add(struct imsgev *);
int imsg_compose_event(struct imsgev *, uint16_t, uint32_t, pid_t,
int, void *, uint16_t);
void imsg_receive_config(struct imsg *, struct uw_conf **);
struct uw_conf *config_new_empty(void);
void config_clear(struct uw_conf *);
/* printconf.c */
void print_config(struct uw_conf *);
/* parse.y */
struct uw_conf *parse_config(char *);
int cmdline_symset(char *);
RB_PROTOTYPE(force_tree, force_tree_entry, entry, force_tree_cmp);
| [
"[email protected]"
] | |
b20b8c33e6cd860b284d546c9551c3dd3cb75607 | 93866c0c5bcc3826e973cc0dcec5916e0f3f205b | /Pods/Target Support Files/Pods-Bending/Pods-Bending-environment.h | 6972004db193a92500cc0575792f0199be41e328 | [] | no_license | yishuiliunian/WanLeMa | 62691eec561e48af289ef5b55766dd726c655932 | f6e4cfd4beba77b501f97989ff51218356b2a4a9 | refs/heads/master | 2020-06-05T05:56:44.854420 | 2014-12-02T10:39:34 | 2014-12-02T10:39:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,495 | h |
// To check if a library is compiled with CocoaPods you
// can use the `COCOAPODS` macro definition which is
// defined in the xcconfigs so it is available in
// headers also when they are imported in the client
// project.
// DZCDNFiles
#define COCOAPODS_POD_AVAILABLE_DZCDNFiles
#define COCOAPODS_VERSION_MAJOR_DZCDNFiles 1
#define COCOAPODS_VERSION_MINOR_DZCDNFiles 0
#define COCOAPODS_VERSION_PATCH_DZCDNFiles 1
// DZCache
#define COCOAPODS_POD_AVAILABLE_DZCache
#define COCOAPODS_VERSION_MAJOR_DZCache 1
#define COCOAPODS_VERSION_MINOR_DZCache 0
#define COCOAPODS_VERSION_PATCH_DZCache 0
// DZGeometryTools
#define COCOAPODS_POD_AVAILABLE_DZGeometryTools
#define COCOAPODS_VERSION_MAJOR_DZGeometryTools 1
#define COCOAPODS_VERSION_MINOR_DZGeometryTools 0
#define COCOAPODS_VERSION_PATCH_DZGeometryTools 0
// DZProgrameDefines
#define COCOAPODS_POD_AVAILABLE_DZProgrameDefines
#define COCOAPODS_VERSION_MAJOR_DZProgrameDefines 1
#define COCOAPODS_VERSION_MINOR_DZProgrameDefines 0
#define COCOAPODS_VERSION_PATCH_DZProgrameDefines 0
// DZSinglonFactory
#define COCOAPODS_POD_AVAILABLE_DZSinglonFactory
#define COCOAPODS_VERSION_MAJOR_DZSinglonFactory 1
#define COCOAPODS_VERSION_MINOR_DZSinglonFactory 0
#define COCOAPODS_VERSION_PATCH_DZSinglonFactory 0
// UIColor-HexString
#define COCOAPODS_POD_AVAILABLE_UIColor_HexString
#define COCOAPODS_VERSION_MAJOR_UIColor_HexString 1
#define COCOAPODS_VERSION_MINOR_UIColor_HexString 1
#define COCOAPODS_VERSION_PATCH_UIColor_HexString 0
| [
"[email protected]"
] | |
286dcfc89e1fe9b2963a0fe1669541a0f51be3a6 | 8244a7dfae7a61466c73b1c9508d4608002d0168 | /syscalls/sys_linkat.h | 0431225141783a9ad67f93bfe942e095524c11a4 | [] | no_license | sebcat/nolibs-stub | 60c79e7742618298d7a3670144615548ac5994cc | 3ff962ab5e71fa64179fc95f7b2601e0f0d944d6 | refs/heads/master | 2020-05-15T07:45:20.460314 | 2014-09-10T11:50:49 | 2014-09-10T11:50:49 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 154 | h |
#ifndef __SYS_LINKAT_H
#define __SYS_LINKAT_H
#include <systm/types.h>
int sys_linkat(int fd1, char *path1, int fd2, char *path2, int flag);
#endif
| [
"[email protected]"
] | |
7c6f1b215eda08999e9a7975658e4e1f38478bcc | d2fb019e63eb66f9ddcbdf39d07f7670f8cf79de | /groups/bsl/bsl+bslhdrs/bsl_c_ctype.h | 777429106475a513f4d42dfe04631dd524792cee | [
"MIT"
] | permissive | gosuwachu/bsl | 4fa8163a7e4b39e4253ad285b97f8a4d58020494 | 88cc2b2c480bcfca19e0f72753b4ec0359aba718 | refs/heads/master | 2021-01-17T05:36:55.605787 | 2013-01-15T19:48:00 | 2013-01-15T19:48:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,027 | h | /* bsl_c_ctype.h -*-C-*- */
#ifndef INCLUDED_BSL_C_CTYPE
#define INCLUDED_BSL_C_CTYPE
#ifndef INCLUDED_BSLS_IDENT
#include <bsls_ident.h>
#endif
BSLS_IDENT("$Id: $")
/*
//@PURPOSE: Provide functionality of the corresponding C Standard header.
//
//@SEE_ALSO: package bsl+stdhdrs
//
//@DESCRIPTION: Provide types, in the 'bsl' namespace, equivalent to those
// defined in the corresponding C standard header. Include the native
// compiler-provided standard header, and also directly include Bloomberg's
// implementation of the C standard type (if one exists). Finally, place the
// included symbols from the 'std' namespace (if any) into the 'bsl' namespace.
*/
#include <ctype.h>
#endif
/*
// ----------------------------------------------------------------------------
// Copyright (C) 2012 Bloomberg L.P.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
// ----------------------------- END-OF-FILE ----------------------------------
*/
| [
"[email protected]"
] | |
1f6b87833241f8dc601b7c9054678bdff4cb1a48 | 389b665b1483eebd8248a1ca8099794c310e1800 | /Day06/Day06_06.c | 376b27dbe80ea5b73f05b033e4d334c6703578aa | [] | no_license | Sharadchandra-Patil/C-Programming | c52113f3feba1f0f224f240654b99d0e217ff311 | da2756926e95d9acff1971331f1496045c014f40 | refs/heads/master | 2023-07-31T17:16:45.986519 | 2021-09-20T15:55:43 | 2021-09-20T15:55:43 | 363,111,846 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 737 | c | #include<stdio.h>
int main()
{
/*
int num=100;
double d1=12.33;
char ch='A';
printf("%d\n",sizeof(num+d1+ch));
// int + double + char
// double
printf("%d",sizeof(100+12.33+'A'));
// int + double + char
// double
*/
/*
char ch ='A';
short int num = 100;
printf("\n %u",sizeof(ch + num));
// char + short
// int + short
// int
sizeof is evaluated at compile time
*/
//Char types are treated as integers (ASCII values) for calculation
printf("%d",65 + 'A');
// int + 'A'
// int + 65
// 65 + 65
// 130
} | [
"[email protected]"
] | |
7925282697cb2aeaddabe565788f6757038d10a1 | 6b40e9dccf2edc767c44df3acd9b626fcd586b4d | /NT/com/ole32/com/dcomrem/vsevfire.h | 2f2fd14b1c107f41f2b72ce42d8f935fb4aa7c98 | [] | no_license | jjzhang166/WinNT5_src_20201004 | 712894fcf94fb82c49e5cd09d719da00740e0436 | b2db264153b80fbb91ef5fc9f57b387e223dbfc2 | refs/heads/Win2K3 | 2023-08-12T01:31:59.670176 | 2021-10-14T15:14:37 | 2021-10-14T15:14:37 | 586,134,273 | 1 | 0 | null | 2023-01-07T03:47:45 | 2023-01-07T03:47:44 | null | UTF-8 | C | false | false | 3,644 | h | //+-------------------------------------------------------------------
//
// File: vsevfile.h
//
// Contents: Vista events and related functions
//
// History: 26-Sep-97 RongC Created
//
// Note: This file was generated from vsevfire.idl in the Vista land.
// Since we only use a very small and stable subset part of
// the original file, we don't want to build the IDL file
// everytime. We may, however, consider building vsevfire.idl
// when it ships with NT 5.0 SDK.
//
//--------------------------------------------------------------------
typedef enum VSAParameterType {
cVSAParameterKeyMask = 0x80000000,
cVSAParameterKeyString = 0x80000000,
cVSAParameterValueMask = 0x7ffff,
cVSAParameterValueTypeMask = 0x70000,
cVSAParameterValueUnicodeString = 0,
cVSAParameterValueANSIString = 0x10000,
cVSAParameterValueGUID = 0x20000,
cVSAParameterValueDWORD = 0x30000,
cVSAParameterValueBYTEArray = 0x40000,
cVSAParameterValueLengthMask = 0xffff
} VSAParameterFlags;
typedef enum VSAStandardParameter {
cVSAStandardParameterSourceMachine = 0,
cVSAStandardParameterSourceProcess = 1,
cVSAStandardParameterSourceThread = 2,
cVSAStandardParameterSourceComponent = 3,
cVSAStandardParameterSourceSession = 4,
cVSAStandardParameterTargetMachine = 5,
cVSAStandardParameterTargetProcess = 6,
cVSAStandardParameterTargetThread = 7,
cVSAStandardParameterTargetComponent = 8,
cVSAStandardParameterTargetSession = 9,
cVSAStandardParameterSecurityIdentity = 10,
cVSAStandardParameterCausalityID = 11,
cVSAStandardParameterNoDefault = 0x4000,
cVSAStandardParameterSourceHandle = 0x4000,
cVSAStandardParameterTargetHandle = 0x4001,
cVSAStandardParameterArguments = 0x4002,
cVSAStandardParameterReturnValue = 0x4003,
cVSAStandardParameterException = 0x4004,
cVSAStandardParameterCorrelationID = 0x4005
} VSAStandardParameters;
typedef enum eVSAEventFlags {
cVSAEventStandard = 0,
cVSAEventDefaultSource = 1,
cVSAEventDefaultTarget = 2,
cVSAEventCanBreak = 4
} VSAEventFlags;
const IID IID_ISystemDebugEventFire =
{0x6C736DC1,0xAB0D,0x11D0,{0xA2,0xAD,0x00,0xA0,0xC9,0x0F,0x27,0xE8}};
interface ISystemDebugEventFire : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE BeginSession(
/* [in] */ REFGUID guidSourceID,
/* [in] */ LPCOLESTR strSessionName) = 0;
virtual HRESULT STDMETHODCALLTYPE EndSession( void) = 0;
virtual HRESULT STDMETHODCALLTYPE IsActive( void) = 0;
virtual HRESULT STDMETHODCALLTYPE FireEvent(
/* [in] */ REFGUID guidEvent,
/* [in] */ int nEntries,
/* [size_is][in] */ PULONG_PTR rgKeys,
/* [size_is][in] */ PULONG_PTR rgValues,
/* [size_is][in] */ LPDWORD rgTypes,
/* [in] */ DWORD dwTimeLow,
/* [in] */ LONG dwTimeHigh,
/* [in] */ VSAEventFlags dwFlags) = 0;
};
const IID IID_ISystemDebugEventShutdown =
{0x6C736DCF,0xAB0D,0x11D0,{0xA2,0xAD,0x00,0xA0,0xC9,0x0F,0x27,0xE8}};
interface ISystemDebugEventShutdown : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Shutdown( void) = 0;
};
extern const CLSID CLSID_VSA_IEC =
{0x6C736DB1,0xBD94,0x11D0,{0x8A,0x23,0x00,0xAA,0x00,0xB5,0x8E,0x10}};
| [
"[email protected]"
] | |
810cc49e2372bf46b4359db4c6581b69620331e3 | 7244aae24f6a5f7376501ffb4ca743c65dddb074 | /scaler/hana_scaler/tscalhist_main.C | 39d221d7d95d2dbdbabb8e19bc8d1dacf9f729d8 | [] | no_license | tgdragon/HallA-Online-Tritium | 59f61eb6ae299d8c816e436dbdf0ef18901a7447 | c01f776e56cc895d976c028e90ef2c660f1abbaa | refs/heads/master | 2020-03-23T06:09:52.193630 | 2018-10-15T15:14:38 | 2018-10-15T15:14:38 | 141,192,611 | 0 | 2 | null | 2018-07-16T20:46:27 | 2018-07-16T20:46:27 | null | UTF-8 | C | false | false | 3,438 | c | //--------------------------------------------------------
// tscalhist_main.C
//
// Test of scaler class, for reading scaler history (end-of-run)
// files and obtaining data.
// This version also fills an ntuple
// Hint: if you have two scaler history files (for L and R arm),
// try to concatenate them 'cat file1 file2 > file3' and analyze
// the resulting concatenated file3.
//
// R. Michaels, updated Mar 2005
//--------------------------------------------------------
#include <iostream>
#include <string>
#include "THaScaler.h"
#ifndef __CINT__
#include "TROOT.h"
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"
#include "TProfile.h"
#include "TNtuple.h"
#include "TRandom.h"
#endif
using namespace std;
int main(int argc, char* argv[]) {
const Double_t calib_u3 = 4114; // calibrations (an example)
const Double_t calib_d10 = 12728;
const Double_t off_u3 = 167.1;
const Double_t off_d10 = 199.5;
// Initialize root and output
TROOT scalana("scalroot","Hall A scaler analysis");
TFile hfile("scalerhist.root","RECREATE","Scaler history in Hall A");
// Define the ntuple here
// 0 1 2 3 4 5 6 7 8 9 10 11
char cdata[]="run:time:u3:d10:ct1:ct2:ct3:ct4:ct5:ct6:ct7:ctacc";
int nlen = strlen(cdata);
char *string_ntup = new char[nlen+1];
strcpy(string_ntup,cdata);
TNtuple *ntup = new TNtuple("ascal","Scaler History Data",string_ntup);
Float_t farray_ntup[12]; // Note, dimension is same as size of string_ntup
cout << "Enter bank 'Right' or 'Left' (spectrometer) ->" << endl;
string bank; cin >> bank;
cout << "enter [runlo, runhi] = interval of runs to summarize ->" << endl;
int runlo; cout << "runlo: " << endl; cin >> runlo;
int runhi; cout << "runhi: " << endl; cin >> runhi;
THaScaler scaler(bank.c_str());
if (scaler.Init() == -1) { // Init for default time ("now").
cout << "Error initializing scaler "<<endl; return 1;
}
int status;
for (int run = runlo; run < runhi; run++) {
status = scaler.LoadDataHistoryFile(run); // load data from default history file
if ( status != 0 ) continue;
for (int i = 0; i < 12; i++) farray_ntup[i] = 0;
cout << "\nScalers for run = "<<run<<endl<<flush;
cout << "Time --- Beam Current (uA) ---- | --- Triggers --- "<<endl;
cout << "(min) u3 d10";
cout << " T1(Right) T3(Left) T5(coinc)"<<endl;
double time_sec = scaler.GetPulser("clock")/1024;
double curr_u3 = (scaler.GetBcm("bcm_u3")/time_sec - off_u3)/calib_u3;
double curr_d10 = (scaler.GetBcm("bcm_d10")/time_sec - off_d10)/calib_d10;
printf("%7.2f %7.2f %7.2f %d %d %d\n",
time_sec/60, curr_u3, curr_d10, scaler.GetTrig(1), scaler.GetTrig(3),
scaler.GetTrig(5));
cout << " T6 T7 Tot accepted"<<endl;
printf(" %d %d %d\n",
scaler.GetTrig(6), scaler.GetTrig(7),scaler.GetNormData(0,12));
farray_ntup[0] = run;
farray_ntup[1] = time_sec;
farray_ntup[2] = curr_u3;
farray_ntup[3] = curr_d10;
for (int itrig = 1; itrig <= 7; itrig++) farray_ntup[3+itrig]=scaler.GetTrig(itrig);
farray_ntup[11] = scaler.GetNormData(0,12);
ntup->Fill(farray_ntup);
}
hfile.Write();
hfile.Close();
return 0;
}
| [
"[email protected]"
] | |
b0504f07418310c5cf64f48bdb6b751f91dd000c | f3c2026baf2ec2e56fc76181ff0e6d756a08e0d1 | /oldstudycode/driver/led/myled.c | 4a08bfee5b65d8c5e11e4d6240deaad7b1104720 | [] | no_license | Lava-Liu/media | 9572e8bece6187c26e122d02481a886e9a9f6f07 | ab77d860889655c899206a032462266dd5a42d84 | refs/heads/master | 2023-02-04T16:25:50.091020 | 2019-12-12T01:27:31 | 2019-12-12T01:27:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,439 | c | /* ==================================================================
* Filename: myled.c
* Description:
* Created: 2013年10月22日 16时31分54秒
* Compiler: gcc/g++
* Author: Star (Liu Wei), [email protected]
* Company: 昆山杰普科技有限公司
* ==================================================================*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/cdev.h>
#include <linux/moduleparam.h>
#include <asm/uaccess.h>
#include <linux/device.h>
#include <asm/io.h>
#include "myled.h"
MODULE_LICENSE("Dual BSD/GPL");
typedef struct led_dev
{
struct cdev cdev;
unsigned int* ctrl_reg;//0x56000010
unsigned int* data_reg;//0x56000014
struct class *cls;
struct device *dev;
}global_dev;
global_dev* devp = NULL;
static int led_open(struct inode* inode, struct file* file)
{
//获取描述设备的结构体
global_dev *dev = container_of(inode->i_cdev, struct led_dev, cdev);
//数据私有化
file->private_data = dev;
if((file->f_flags & O_ACCMODE)==O_WRONLY)
{
file->f_pos = 0;
}
printk(KERN_INFO"open led successful!\n");
return 0;
}
static int led_close(struct inode* inode , struct file* file )
{
printk(KERN_INFO"led_close() invoke!\n");
return 0;
}
static void led_setup(unsigned long num, int p)
{
unsigned int t = ioread32(devp->data_reg);
if(p)
{//LED light
unsigned int v = ~(0x1 << (num + 4));
t &= v;
}else
{//LED shadow
unsigned int v = 0x1<< (num+4) ;
t |=v;
}
iowrite32(t, devp->data_reg);
}
static int led_ioctl(struct inode* inode, struct file* file , unsigned int cmd, unsigned long arg)
{
int ret = 0;
switch(cmd)
{
case LED_ON:
led_setup(arg, 1);
break;
default:
led_setup(arg, 0);
break;
}
return ret;
}
static const struct file_operations fops =
{
.owner = THIS_MODULE,
.open = led_open,
.release = led_close,
.ioctl = led_ioctl,
};
static int __init led_init(void)
{
int ret = 0;
//临时保存控制寄存器的控制数据
unsigned int out = 0;
dev_t devno = MKDEV(major, 0);
//获取LED设备的设备编号
ret = register_chrdev_region(devno, 1, led_name);
if(ret < 0)
{
printk(KERN_ERR"register_chrdev_region error!\n");
ret = alloc_chrdev_region(&devno, 0, 1, led_name);
if(ret < 0)
{
printk(KERN_ERR"alloc error !\n");
return -EBUSY;
}
}
printk(KERN_INFO"register success!\n");
major = MAJOR(devno);
//为设备分配内存
devp = (global_dev *)kmalloc(sizeof(global_dev), GFP_KERNEL);
if(devp == NULL)
{
printk(KERN_ERR"kmalloc error!\n");
goto err1;
}else{
printk(KERN_INFO"kmalloc success!\n");
}
//3、建立控制寄存器和数据寄存器的映射
devp->ctrl_reg = (unsigned int *)ioremap(0x56000010, 4);
devp->data_reg = (unsigned int* )ioremap(0x56000014, 4);
//4、设置led的控制位
out |=(0x01 << 10) | (0x01 << 12) | (0x01 << 14) | (0x01 << 16);
iowrite32(out, devp->ctrl_reg);
//5、初始化具体设备在系统中的通用描述
cdev_init(&devp->cdev, &fops);
devp->cdev.owner = THIS_MODULE;
devp->cdev.ops = &fops;
//6、将通用设备描述添加到内核管理列表
if(cdev_add(&devp->cdev, devno, 1))
{
printk(KERN_ERR"cdev_add error!\n");
goto err2;
}else{
printk(KERN_INFO"cdev_add success!\n");
}
//7.在sysfs中自动创建设备类别
devp->cls=class_create(THIS_MODULE, led_name);
if(devp->cls == NULL)
{
printk(KERN_ERR"class_create error!\n");
goto warn;
}
//8、在sysfs中自动创建设备个体并创建设备文件
devp->dev = device_create(devp->cls, NULL, devno, NULL, "%s%d", led_name, MINOR(devno));
if(NULL == devp->dev)
{
printk(KERN_ERR"device_create errpr!\n");
}else{
printk(KERN_INFO"auto create success!\n");
}
return 0;
warn:
return 0;
err2:
iounmap(devp->ctrl_reg);
iounmap(devp->data_reg);
kfree(devp);
devp = NULL;
err1:
unregister_chrdev_region(devno, 1);
return -ENOMEM;
}
static void __exit led_exit(void)
{
device_destroy(devp->cls,MKDEV(major, 0) );
class_destroy(devp->cls);
cdev_del(&devp->cdev);
iounmap(devp->ctrl_reg);
iounmap(devp->data_reg);
kfree(devp);
devp = NULL;
unregister_chrdev_region(MKDEV(major, 0), 1);
printk("led_exit() invoked!\n");
}
module_param(counter, int , 0644);
module_param(led_name, charp, 0644);
module_param(major, int, 0644);
module_init(led_init);
module_exit(led_exit);
| [
"silence@silence-VirtualBox.(none)"
] | silence@silence-VirtualBox.(none) |
fa2799027b904c700ab0bc5d48e72786981e4924 | c47c254ca476c1f9969f8f3e89acb4d0618c14b6 | /datasets/linux-4.11-rc3/drivers/infiniband/hw/cxgb3/iwch_cm.h | e66e75921797446019fc67974a2baf4e1d4980a5 | [
"BSD-2-Clause",
"Linux-syscall-note",
"GPL-2.0-only"
] | permissive | yijunyu/demo | 5cf4e83f585254a28b31c4a050630b8f661a90c8 | 11c0c84081a3181494b9c469bda42a313c457ad2 | refs/heads/master | 2023-02-22T09:00:12.023083 | 2021-01-25T16:51:40 | 2021-01-25T16:51:40 | 175,939,000 | 3 | 6 | BSD-2-Clause | 2021-01-09T23:00:12 | 2019-03-16T07:13:00 | C | UTF-8 | C | false | false | 5,811 | h | /*
* Copyright (c) 2006 Chelsio, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef _IWCH_CM_H_
#define _IWCH_CM_H_
#include <linux/inet.h>
#include <linux/wait.h>
#include <linux/spinlock.h>
#include <linux/kref.h>
#include <rdma/ib_verbs.h>
#include <rdma/iw_cm.h>
#include "cxgb3_offload.h"
#include "iwch_provider.h"
#define MPA_KEY_REQ "MPA ID Req Frame"
#define MPA_KEY_REP "MPA ID Rep Frame"
#define MPA_MAX_PRIVATE_DATA 256
#define MPA_REV 0 /* XXX - amso1100 uses rev 0 ! */
#define MPA_REJECT 0x20
#define MPA_CRC 0x40
#define MPA_MARKERS 0x80
#define MPA_FLAGS_MASK 0xE0
#define put_ep(ep) { \
PDBG("put_ep (via %s:%u) ep %p refcnt %d\n", __func__, __LINE__, \
ep, kref_read(&((ep)->kref))); \
WARN_ON(kref_read(&((ep)->kref)) < 1); \
kref_put(&((ep)->kref), __free_ep); \
}
#define get_ep(ep) { \
PDBG("get_ep (via %s:%u) ep %p, refcnt %d\n", __func__, __LINE__, \
ep, kref_read(&((ep)->kref))); \
kref_get(&((ep)->kref)); \
}
struct mpa_message {
u8 key[16];
u8 flags;
u8 revision;
__be16 private_data_size;
u8 private_data[0];
};
struct terminate_message {
u8 layer_etype;
u8 ecode;
__be16 hdrct_rsvd;
u8 len_hdrs[0];
};
#define TERM_MAX_LENGTH (sizeof(struct terminate_message) + 2 + 18 + 28)
enum iwch_layers_types {
LAYER_RDMAP = 0x00,
LAYER_DDP = 0x10,
LAYER_MPA = 0x20,
RDMAP_LOCAL_CATA = 0x00,
RDMAP_REMOTE_PROT = 0x01,
RDMAP_REMOTE_OP = 0x02,
DDP_LOCAL_CATA = 0x00,
DDP_TAGGED_ERR = 0x01,
DDP_UNTAGGED_ERR = 0x02,
DDP_LLP = 0x03
};
enum iwch_rdma_ecodes {
RDMAP_INV_STAG = 0x00,
RDMAP_BASE_BOUNDS = 0x01,
RDMAP_ACC_VIOL = 0x02,
RDMAP_STAG_NOT_ASSOC = 0x03,
RDMAP_TO_WRAP = 0x04,
RDMAP_INV_VERS = 0x05,
RDMAP_INV_OPCODE = 0x06,
RDMAP_STREAM_CATA = 0x07,
RDMAP_GLOBAL_CATA = 0x08,
RDMAP_CANT_INV_STAG = 0x09,
RDMAP_UNSPECIFIED = 0xff
};
enum iwch_ddp_ecodes {
DDPT_INV_STAG = 0x00,
DDPT_BASE_BOUNDS = 0x01,
DDPT_STAG_NOT_ASSOC = 0x02,
DDPT_TO_WRAP = 0x03,
DDPT_INV_VERS = 0x04,
DDPU_INV_QN = 0x01,
DDPU_INV_MSN_NOBUF = 0x02,
DDPU_INV_MSN_RANGE = 0x03,
DDPU_INV_MO = 0x04,
DDPU_MSG_TOOBIG = 0x05,
DDPU_INV_VERS = 0x06
};
enum iwch_mpa_ecodes {
MPA_CRC_ERR = 0x02,
MPA_MARKER_ERR = 0x03
};
enum iwch_ep_state {
IDLE = 0,
LISTEN,
CONNECTING,
MPA_REQ_WAIT,
MPA_REQ_SENT,
MPA_REQ_RCVD,
MPA_REP_SENT,
FPDU_MODE,
ABORTING,
CLOSING,
MORIBUND,
DEAD,
};
enum iwch_ep_flags {
PEER_ABORT_IN_PROGRESS = 0,
ABORT_REQ_IN_PROGRESS = 1,
RELEASE_RESOURCES = 2,
CLOSE_SENT = 3,
};
struct iwch_ep_common {
struct iw_cm_id *cm_id;
struct iwch_qp *qp;
struct t3cdev *tdev;
enum iwch_ep_state state;
struct kref kref;
spinlock_t lock;
struct sockaddr_in local_addr;
struct sockaddr_in remote_addr;
wait_queue_head_t waitq;
int rpl_done;
int rpl_err;
unsigned long flags;
};
struct iwch_listen_ep {
struct iwch_ep_common com;
unsigned int stid;
int backlog;
};
struct iwch_ep {
struct iwch_ep_common com;
struct iwch_ep *parent_ep;
struct timer_list timer;
unsigned int atid;
u32 hwtid;
u32 snd_seq;
u32 rcv_seq;
struct l2t_entry *l2t;
struct dst_entry *dst;
struct sk_buff *mpa_skb;
struct iwch_mpa_attributes mpa_attr;
unsigned int mpa_pkt_len;
u8 mpa_pkt[sizeof(struct mpa_message) + MPA_MAX_PRIVATE_DATA];
u8 tos;
u16 emss;
u16 plen;
u32 ird;
u32 ord;
};
static inline struct iwch_ep *to_ep(struct iw_cm_id *cm_id)
{
return cm_id->provider_data;
}
static inline struct iwch_listen_ep *to_listen_ep(struct iw_cm_id *cm_id)
{
return cm_id->provider_data;
}
static inline int compute_wscale(int win)
{
int wscale = 0;
while (wscale < 14 && (65535<<wscale) < win)
wscale++;
return wscale;
}
/* CM prototypes */
int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param);
int iwch_create_listen(struct iw_cm_id *cm_id, int backlog);
int iwch_destroy_listen(struct iw_cm_id *cm_id);
int iwch_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len);
int iwch_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param);
int iwch_ep_disconnect(struct iwch_ep *ep, int abrupt, gfp_t gfp);
int iwch_quiesce_tid(struct iwch_ep *ep);
int iwch_resume_tid(struct iwch_ep *ep);
void __free_ep(struct kref *kref);
void iwch_rearp(struct iwch_ep *ep);
int iwch_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new, struct l2t_entry *l2t);
int __init iwch_cm_init(void);
void __exit iwch_cm_term(void);
extern int peer2peer;
#endif /* _IWCH_CM_H_ */
| [
"[email protected]"
] | |
078c1a56029711552dc6fb727becb46f76d25c4d | a280aa9ac69d3834dc00219e9a4ba07996dfb4dd | /regularexpress/home/weilaidb/work/kernel/linux-3.0.8/arch/arm/mach-msm/gpiomux.c | 9b58bb520a9834c65d821b468096b795641387ca | [] | no_license | weilaidb/PythonExample | b2cc6c514816a0e1bfb7c0cbd5045cf87bd28466 | 798bf1bdfdf7594f528788c4df02f79f0f7827ce | refs/heads/master | 2021-01-12T13:56:19.346041 | 2017-07-22T16:30:33 | 2017-07-22T16:30:33 | 68,925,741 | 4 | 2 | null | null | null | null | UTF-8 | C | false | false | 366 | c | static DEFINE_SPINLOCK(gpiomux_lock);
int msm_gpiomux_write(unsigned gpio,
gpiomux_config_t active,
gpiomux_config_t suspended)
EXPORT_SYMBOL(msm_gpiomux_write);
int msm_gpiomux_get(unsigned gpio)
EXPORT_SYMBOL(msm_gpiomux_get);
int msm_gpiomux_put(unsigned gpio)
EXPORT_SYMBOL(msm_gpiomux_put);
static int __init gpiomux_init(void)
postcore_initcall(gpiomux_init);
| [
"[email protected]"
] | |
5fac4fd1e6bbdc38e38c9a89cf178d106c3d6994 | 5c255f911786e984286b1f7a4e6091a68419d049 | /code/5cb36f5a-abd7-4084-bfa0-6240d0556244.c | 94a00f56990fdd09c10e82186127ac6d2e523773 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 253 | c | #include <stdio.h>
int main() {
int i=0;
int j=14;
int k;
int l;
k = 53;
l = 54;
k = i/j;
l = i/j;
l = i/j;
l = l/j;
l = l-j;
l = j-j;
k = k-k*i;
printf("vulnerability");
printf("%d%d\n",k,l);
return 0;
}
| [
"[email protected]"
] | |
3a1e7d7b159b3c38ce0128dba846d1a26da20ffd | 528bd6c511b07472b1c6cc00a9ff91f6faa9dbcc | /programming/scripts/scripts/parsers/cheaders/printable_e.c | 5ad901d2f9b33891ee0f5c73572fa734cf003f43 | [] | no_license | tbots/docs | 15448fdfdcb10b50a958de262e2c5f9396d9bb76 | 8443141926cf4bd3949d94eae20f70963802ab5b | refs/heads/master | 2020-08-17T03:16:14.686338 | 2019-10-12T16:34:18 | 2019-10-12T16:34:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 459 | c | #include <stdio.h>
#include <ctype.h>
void printable_e(char c,int np) {
if(np) { /* display non-printable characters */
printf("[\033[90m");
switch (c) {
case '\t': printf("\\t"); break;
case ' ': printf(" "); break;
case '\n': printf("\\n"); break;
default : printf("%d",c); /* print ascii value by default */
}
printf("\033[0m]");
}
else
if(!isspace(c))
printf("%c",c);
else
printf(" ");
}
| [
"[email protected]"
] | |
03ad8aa2628434fd814fc572eecd1465ba41459a | d579699e6728aa74084f8cc4dc435007b9f523a8 | /data/signatures/posix/pwd.h | 79f26e0e07c5c47196b97793328e96b57a68f9a2 | [
"BSD-3-Clause"
] | permissive | BoomerangDecompiler/boomerang | b3c6b4e88c152ac6d437f3dd3640fd9ffa157cb6 | 411041305f90d1d7c994f67255b5c03ea8666e60 | refs/heads/develop | 2023-08-31T03:50:56.112711 | 2020-12-28T12:11:55 | 2020-12-28T17:38:56 | 7,819,729 | 281 | 41 | NOASSERTION | 2020-12-27T17:59:52 | 2013-01-25T12:26:59 | C++ | UTF-8 | C | false | false | 520 | h |
struct passwd
{
char *pw_name;
uid_t pw_uid;
gid_t pw_gid;
char *pw_dir;
char *pw_shell;
};
passwd *getpwnam(const char *name);
passwd *getpwuid(uid_t uid);
int getpwnam_r(const char *nam, struct passwd *pwd, char *buffer,
size_t bufsize, struct passwd **result);
int getpwuid_r(uid_t uid, struct passwd *pwd, char *buffer,
size_t bufsize, struct passwd **result);
void endpwent(void);
passwd *getpwent(void);
void setpwent(void);
| [
"[email protected]"
] | |
589b52923737da00d079e2fc8ea754c384f95dd9 | 593b2c1fcd44e00614b5af77c436dd038704a4c5 | /WithIo/Qt/VidyoIoWrapper/VidyoClient-WindowsSDK/include/Lmi/VidyoClient/VidyoRoomPropertiesInline.h | ab316a2317c93b76650de32e69c69d89058f8648 | [] | no_license | vidyoworks/VidyoWorksSamples | 2eed56133a55d7688efd27feb699de9f5c856850 | 6097e9d30b2d1b3c0e25effbaed186f9c715eba1 | refs/heads/master | 2021-01-20T15:26:51.017321 | 2020-09-22T10:45:08 | 2020-09-22T10:45:08 | 93,974,728 | 9 | 15 | null | 2019-06-21T09:54:14 | 2017-06-11T01:28:13 | C | UTF-8 | C | false | false | 563 | h | /**
{file:
{name: VidyoRoomPropertiesInline.h}
{description: }
{copyright:
(c) 2014-2015 Vidyo, Inc.,
433 Hackensack Avenue,
Hackensack, NJ 07601.
All rights reserved.
The information contained herein is proprietary to Vidyo, Inc.
and shall not be reproduced, copied (in whole or in part), adapted,
modified, disseminated, transmitted, transcribed, stored in a retrieval
system, or translated into any language in any form by any means
without the express written consent of Vidyo, Inc.
***** CONFIDENTIAL *****
}
}
*/ | [
"[email protected]"
] | |
49e2b4b0fa504aec3d47967197d08f6d11c5e864 | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/git/extr_refs.c_ref_update_reject_duplicates.c | 84dc0073ded01dace1d90a027c9ed6c51cbb6ef5 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,321 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct string_list {size_t nr; TYPE_1__* items; } ;
struct strbuf {int dummy; } ;
struct TYPE_2__ {int /*<<< orphan*/ string; } ;
/* Variables and functions */
int /*<<< orphan*/ BUG (char*) ;
int /*<<< orphan*/ _ (char*) ;
int /*<<< orphan*/ assert (struct strbuf*) ;
int /*<<< orphan*/ strbuf_addf (struct strbuf*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int strcmp (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int ref_update_reject_duplicates(struct string_list *refnames,
struct strbuf *err)
{
size_t i, n = refnames->nr;
assert(err);
for (i = 1; i < n; i++) {
int cmp = strcmp(refnames->items[i - 1].string,
refnames->items[i].string);
if (!cmp) {
strbuf_addf(err,
_("multiple updates for ref '%s' not allowed"),
refnames->items[i].string);
return 1;
} else if (cmp > 0) {
BUG("ref_update_reject_duplicates() received unsorted list");
}
}
return 0;
} | [
"[email protected]"
] | |
56c705f8086aaaeaa1eb3209f88ebe850c6d6a48 | a33aac97878b2cb15677be26e308cbc46e2862d2 | /program_data/PKU_raw/38/24.c | ba836d949d7f6248e824e902be9c4f67dc4bad06 | [] | no_license | GabeOchieng/ggnn.tensorflow | f5d7d0bca52258336fc12c9de6ae38223f28f786 | 7c62c0e8427bea6c8bec2cebf157b6f1ea70a213 | refs/heads/master | 2022-05-30T11:17:42.278048 | 2020-05-02T11:33:31 | 2020-05-02T11:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 370 | c | int main(){
int n,i,j;
double a[100],sum,jun,s,m;
double *p=a;
scanf("%d",&n);
for(j=0;j<n;j++){
scanf("%lf",&m);
for(i=0;i<m;i++){
scanf("%lf",p+i);
}
sum=0;
for(i=0;i<m;i++){
sum=sum+*(p+i);
}
jun=sum/m;
sum=0;
for(i=0;i<m;i++){
sum=sum+(*(p+i)-jun)*(*(p+i)-jun);
}
s=sum/m;
s=sqrt(s);
printf("%.5lf\n",s);
}
return 0;
}
| [
"[email protected]"
] | |
864687961bac0b955def8ee094edc25e61ea2c77 | 1f10c82447ff97e5e064267a00bc38ac5d5126ae | /src/app/main.h | 546b9934a92da7a66b69778e2089f1b4fa0afc4c | [] | no_license | chaosAD/SWD-for-ARM-Cortex-M4 | d3b5564fde606fb06d8f2e3e5c17c166e36bf66b | 937eca1abfffccdc4f3c8aba599e4dc94574331b | refs/heads/master | 2021-01-22T16:45:30.825367 | 2015-11-14T19:30:25 | 2015-11-14T19:56:14 | 45,586,109 | 0 | 0 | null | 2015-11-05T03:51:50 | 2015-11-05T03:51:50 | null | UTF-8 | C | false | false | 161 | h | #ifndef __MAIN_H
#define __MAIN_H
#include <stdio.h>
#include "Swd.h"
#include "ProgramWorker.h"
#include "SystemConfigure.h"
#include "Itm.h"
#endif // main_H
| [
"[email protected]"
] | |
acf35154724ecf542f5fc9735d15c9015c5206e7 | acea543810fa0a368b66206587ead73a70b5bedd | /C/1589.c | a9be0ab1f6ae778d078f7b2743af4e67b5a5706c | [
"MIT"
] | permissive | bmviniciuss/URI | ea7575c0fcbee0317153219c49e7549ef6a20886 | cb57027e8b5f5309eb90770fb6028ffad1c703de | refs/heads/master | 2021-09-09T16:20:45.338234 | 2018-03-17T22:38:34 | 2018-03-17T22:38:34 | 105,489,368 | 4 | 1 | null | 2018-01-28T08:53:27 | 2017-10-02T01:58:58 | C | UTF-8 | C | false | false | 289 | c | //1589 - Bob Conduite
#include <stdio.h>
int main(){
int casos, i;
int raio1, raio2, raioC;
scanf("%d", &casos);
for(i = 0; i < casos; i++){
scanf("%d %d", &raio1, &raio2);
raioC = raio1 + raio2;
printf("%d\n", raioC);
}
return 0;
}
| [
"[email protected]"
] | |
de1453d08019f602f3cdb2042d100c3bc68bea67 | 78e075a96220953df6cb832a2814fb44ef17b986 | /mips-ucontext.h | 3e43d222375d5dd381b081b00f5a04186b975321 | [
"dtoa",
"MIT"
] | permissive | BruceChen7/libtask-reading | 566af1b689054950ba46cf7549da8b1ad9f6ce6b | 4914c7d11b213a8a126c225909c5d56909e21ef4 | refs/heads/master | 2020-12-01T06:09:45.898361 | 2020-04-12T07:46:30 | 2020-04-12T07:46:30 | 230,573,027 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,346 | h | typedef struct mcontext mcontext_t;
typedef struct ucontext ucontext_t;
extern int swapcontext(ucontext_t*, const ucontext_t*);
extern void makecontext(ucontext_t*, void(*)(), int, ...);
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ucontext.h 8.1 (Berkeley) 6/10/93
* JNPR: ucontext.h,v 1.2 2007/08/09 11:23:32 katta
* $FreeBSD: src/sys/mips/include/ucontext.h,v 1.2 2010/01/10 19:50:24 imp Exp $
*/
struct mcontext {
/*
* These fields must match the corresponding fields in struct
* sigcontext which follow 'sc_mask'. That way we can support
* struct sigcontext and ucontext_t at the same time.
*/
int mc_onstack; /* sigstack state to restore */
int mc_pc; /* pc at time of signal */
int mc_regs[32]; /* processor regs 0 to 31 */
int sr; /* status register */
int mullo, mulhi; /* mullo and mulhi registers... */
int mc_fpused; /* fp has been used */
int mc_fpregs[33]; /* fp regs 0 to 31 and csr */
int mc_fpc_eir; /* fp exception instruction reg */
void *mc_tls; /* pointer to TLS area */
int __spare__[8]; /* XXX reserved */
};
struct ucontext {
/*
* Keep the order of the first two fields. Also,
* keep them the first two fields in the structure.
* This way we can have a union with struct
* sigcontext and ucontext_t. This allows us to
* support them both at the same time.
* note: the union is not defined, though.
*/
sigset_t uc_sigmask;
mcontext_t uc_mcontext;
struct __ucontext *uc_link;
stack_t uc_stack;
int uc_flags;
int __spare__[4];
};
| [
"[email protected]"
] | |
3825a47c09ab214276f426321e160dde56a96046 | 202bbc35b672ebda80f7295a7793995d5d877206 | /ScubaSteve/Builds/IOS/Classes/Native/mscorlib_System_Security_Cryptography_RSAPKCS1SignatureForma.h | 801793c1992b22cd3f2cf6bc59e70403b0067c22 | [] | no_license | gohun04/ScubaSteve | c2388d677c77b374fccb62c0e8cce4740d06ca50 | 2428e54e97238f48f67652a8dd982e1f6821e7e0 | refs/heads/master | 2021-01-01T16:00:07.055501 | 2015-04-25T09:07:26 | 2015-04-25T09:07:26 | 34,557,070 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 692 | h | #pragma once
// System.Security.Cryptography.RSA
struct RSA_t1526;
// System.Security.Cryptography.HashAlgorithm
struct HashAlgorithm_t1721;
// System.Security.Cryptography.AsymmetricSignatureFormatter
#include "mscorlib_System_Security_Cryptography_AsymmetricSignatureFor.h"
// System.Security.Cryptography.RSAPKCS1SignatureFormatter
struct RSAPKCS1SignatureFormatter_t2264 : public AsymmetricSignatureFormatter_t1782
{
// System.Security.Cryptography.RSA System.Security.Cryptography.RSAPKCS1SignatureFormatter::rsa
RSA_t1526 * ___rsa_0;
// System.Security.Cryptography.HashAlgorithm System.Security.Cryptography.RSAPKCS1SignatureFormatter::hash
HashAlgorithm_t1721 * ___hash_1;
};
| [
"[email protected]"
] | |
4814beaa18ca932ad90e9e319a52a95f073e8835 | e8d1bbb3104ff4209ccc051aba4b4cdc363caf65 | /project/Nstartcode/MBF031C8T_n_reg/UART/UART_Print_DMA/HARDWARE/DMA/dma.c | 0e0bdfb4f24bb337ff81ea25ce68a064ab71defa | [] | no_license | SoCXin/MM32F031 | c3dd4a3597f7e0591fcf1b407af582208257ccc0 | a2109b76ae5a44ab55903ba53c456b9098e42ec0 | refs/heads/master | 2023-04-07T02:16:02.498002 | 2021-04-19T09:31:32 | 2021-04-19T09:31:32 | 251,277,845 | 1 | 1 | null | null | null | null | GB18030 | C | false | false | 1,882 | c | #include "dma.h"
//////////////////////////////////////////////////////////////////////////////////
//开发板
//DMA 代码
//////////////////////////////////////////////////////////////////////////////////
u16 DMA1_MEM_LEN;//保存DMA每次数据传送的长度
//DMA1的各通道配置
//这里的传输形式是固定的,这点要根据不同的情况来修改
//从存储器->外设模式/8位数据宽度/存储器增量模式
//DMA_CHx:DMA通道CHx
//cpar:外设地址
//cmar:存储器地址
//cndtr:数据传输量
/********************************************************************************************************
**函数信息 :MYDMA_Config(DMA_Channel_TypeDef* DMA_CHx,u32 cpar,u32 cmar,u16 cndtr)
**功能描述 :可修改根据输入参数修改配置的DMA配置
**输入参数 :无
**输出参数 :无
********************************************************************************************************/
void MYDMA_Config(DMA_Channel_TypeDef* DMA_CHx,u32 cpar,u32 cmar,u16 cndtr)
{
RCC->AHBENR|=RCC_AHBENR_DMA1EN; //开启DMA1时钟
DMA_CHx->CPAR=cpar; //DMA1 外设地址
DMA_CHx->CMAR=(u32)cmar; //DMA1,存储器地址
DMA1_MEM_LEN=cndtr; //保存DMA传输数据量
DMA_CHx->CNDTR=cndtr; //DMA1,传输数据量
DMA_CHx->CCR=0X00000000; //复位
DMA_CHx->CCR|=DMA_CCR1_DIR; //从存储器读
DMA_CHx->CCR&=~DMA_CCR1_CIRC; //普通模式
DMA_CHx->CCR&=~DMA_CCR1_PINC; //外设地址非增量模式
DMA_CHx->CCR|=DMA_CCR1_MINC; //存储器增量模式
DMA_CHx->CCR&=~DMA_CCR1_PSIZE_0; //外设数据宽度为8位
DMA_CHx->CCR&=~DMA_CCR1_MSIZE_0; //存储器数据宽度8位
DMA_CHx->CCR|=DMA_CCR1_PL_0; //中等优先级
DMA_CHx->CCR&=~DMA_CCR1_MEM2MEM; //非存储器到存储器模式
}
| [
"[email protected]"
] | |
da30381c640f96ee60904d4779110e378ac3a8ab | f7feeafac969d59711df7440a65510574d15c9b1 | /tubii_server/src/data.c | 631442726e5d010b94652fe27787f1e798385ae5 | [] | no_license | pennneutrinos/workspace_tubii | 34085ebcce1a6c086b0c8f7876f7c86917f12498 | 82d108f7b33113a6965f9f48df8c737fef2357be | refs/heads/master | 2020-04-12T06:10:38.834742 | 2018-02-09T00:05:04 | 2018-02-09T00:05:04 | 162,344,903 | 1 | 0 | null | 2018-12-18T21:02:44 | 2018-12-18T21:02:43 | null | UTF-8 | C | false | false | 2,120 | c | #include "ae.h"
#include <stdio.h>
#include "sock.h"
#include "anet.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "record_info.h"
#include "sds.h"
#include "logging.h"
#include "data.h"
#define BUFSIZE 4096000 /* 5 MB */
Sock *data_stream;
extern aeEventLoop *el;
int dispatch_connect(aeEventLoop *el, long long id, void *data)
{
char err[ANET_ERR_LEN];
/* Try to connect to the dispatcher. If it fails, try again 10 seconds
* later */
int sock = anetTcpConnect(err, "192.168.1.100", 4002);
if (sock == ANET_ERR) {
Log(WARNING, "failed to connect to data stream server: %s.", err);
return 10000;
}
data_stream = sock_init(sock, BUFSIZE, 0);
return AE_NOMORE;
}
void write_data_buffer(aeEventLoop *el, int fd, void *data, int mask)
{
/* Write the data stream buffer to the data stream server. If it fails,
* free the data stream connection, and try to reconnect in 10 seconds. */
Sock *s = (Sock *)data;
if (sock_write(s)) {
Log(WARNING, "error sending data stream buffer");
aeDeleteFileEvent(el, s->fd, AE_WRITABLE);
sock_free(s);
data_stream = NULL;
if (aeCreateTimeEvent(el, 10000, dispatch_connect, NULL,
NULL) == AE_ERR) {
Log(WARNING, "failed to create dispatch_connect event");
}
return;
}
if (CB_BYTES(s->sendbuf) == 0) {
aeDeleteFileEvent(el, s->fd, AE_WRITABLE);
}
}
void write_to_data_stream(struct GenericRecordHeader *header, void *record)
{
/* Write `len` bytes from `buf` to the data stream connection buffer. */
/* Return immediately if we aren't connected */
if (data_stream == NULL) return;
if (sock_append_record(data_stream, header, record)) {
Log(WARNING, "write to data stream: %s", sock_err);
}
if (aeCreateFileEvent(el, data_stream->fd, AE_WRITABLE, write_data_buffer,
data_stream) != AE_OK) {
Log(WARNING, "failed to create write event for data stream "
"connection");
}
}
| [
"[email protected]"
] | |
d61cf95ffa4b76ee01cc1ae681e7dd4e8f188a4a | 19e356aa308d3adef259a912b29950a3af37a2e2 | /Temp/il2cppOutput/il2cppOutput/Parse_Unity_System_Threading_Tasks_Task_1_U3CU3Ec__DisplayCl_60.h | 962142bcfcf6c2df317c4008fedc366b862c0776 | [] | no_license | minuJeong/AcocGame | 87314d914b72290fff347cc590ae03669d10d6ba | 24eeaba66393890998d55a633fcbd17d984549b4 | refs/heads/master | 2021-03-12T23:51:57.818655 | 2015-03-29T12:44:58 | 2015-03-29T12:44:58 | 32,936,460 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 561 | h | #pragma once
#include <stdint.h>
// System.Action`1<System.Threading.Tasks.Task`1<System.Threading.Tasks.Task`1<System.Char>>>
struct Action_1_t11215;
// System.Object
#include "mscorlib_System_Object.h"
// System.Threading.Tasks.Task`1/<>c__DisplayClass1<System.Threading.Tasks.Task`1<System.Char>>
struct U3CU3Ec__DisplayClass1_t11216 : public Object_t
{
// System.Action`1<System.Threading.Tasks.Task`1<T>> System.Threading.Tasks.Task`1/<>c__DisplayClass1<System.Threading.Tasks.Task`1<System.Char>>::continuation
Action_1_t11215 * ___continuation;
};
| [
"[email protected]"
] | |
a713f8f9b16bb63ee191374e00ba0e4e0dddefd1 | 1ba1144b09e97cbf1a79e9ba16b148d7284beddd | /lib/node_modules/@stdlib/ndarray/base/sub2ind/src/main.c | bc09f8921251d441acb88b5b3a7bddfe83b014f6 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"SunPro",
"BSD-3-Clause",
"BSL-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | doc22940/stdlib | faecf4fbd61c3c5b5d782c3e1ffe78ecd6d5ab27 | 3bfc8bcf42ee5ee3db4db534aa2b2cbdbf131db7 | refs/heads/develop | 2021-03-02T15:52:14.912013 | 2020-02-15T19:20:34 | 2020-02-15T19:20:34 | 245,879,921 | 1 | 0 | Apache-2.0 | 2021-01-28T02:43:52 | 2020-03-08T20:06:08 | null | UTF-8 | C | false | false | 3,647 | c | /**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdint.h>
#include "stdlib/ndarray/index_modes.h"
#include "stdlib/ndarray/base/sub2ind.h"
/**
* Converts subscripts to a linear index.
*
* ## Notes
*
* - When provided fewer modes than dimensions, the function recycles modes using modulo arithmetic.
* - When provided a stride array containing negative strides, if an `offset` is greater than `0`, the function treats subscripts as mapping to a linear index in an underlying data buffer for the array, thus returning a linear index from the perspective of that buffer. If an `offset` is equal to `0`, the function treats subscripts as mapping to a linear index in an array view, thus returning a linear index from the perspective of that view. In short, from the perspective of a view, view data is always ordered.
* - In "error" mode, the function returns `-1` if a subscript is out-of-bounds.
*
* @param ndims number of dimensions
* @param shape array shape (dimensions)
* @param strides array strides
* @param offset location of the first indexed value **based** on the stride array
* @param sub subscripts
* @param nmodes number of modes
* @param modes specifies how to handle subscripts which exceed array dimensions
* @return linear index
*
* @example
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/base/sub2ind.h"
*
* int64_t ndims = 3;
* int64_t shape[] = { 3, 3, 3 };
* int64_t strides[] = { 9, 3, 1 };
* int64_t offset = 0;
*
* int64_t nmodes = 1;
* enum STDLIB_NDARRAY_INDEX_MODE modes[] = { STDLIB_NDARRAY_INDEX_ERROR };
*
* int64_t sub[] = { 1, 2, 2 };
*
* int64_t idx = stdlib_ndarray_sub2ind( ndims, shape, strides, offset, sub, nmodes, modes );
* // returns 17
*/
int64_t stdlib_ndarray_sub2ind( int64_t ndims, int64_t *shape, int64_t *strides, int64_t offset, int64_t *sub, int64_t nmodes, enum STDLIB_NDARRAY_INDEX_MODE *modes ) {
enum STDLIB_NDARRAY_INDEX_MODE mode;
int64_t idx;
int64_t s;
int64_t m;
int64_t j;
int64_t i;
idx = offset;
for ( i = 0; i < ndims; i++ ) {
m = shape[ i ];
j = sub[ i ];
mode = modes[ i%nmodes ];
if ( mode == STDLIB_NDARRAY_INDEX_CLAMP ) {
if ( j < 0 ) {
j = 0;
} else if ( j >= m ) {
j = m - 1;
}
} else if ( mode == STDLIB_NDARRAY_INDEX_WRAP ) {
if ( j < 0 ) {
j += m; // slight optimization to avoid modulo arithmetic when |j| <= m
if ( j < 0 ) {
j -= m*( (int64_t)( j/m ) ); // this is equivalent to `j mod m`, where the result has same sign as dividend (i.e., `j`); cannot use `%` as the sign of the result is implementation defined in C
if ( j != 0 ) {
j += m;
}
}
} else if ( j >= m ) {
j -= m; // slight optimization to avoid modulo arithmetic when m < j <= 2m
if ( j >= m ) {
j %= m;
}
}
} else if ( j < 0 || j >= m ) { // mode == 'error'
return -1;
}
s = strides[ i ];
// Check if array view...
if ( s < 0 && offset == 0 ) {
idx -= j * s; // increments idx
} else {
idx += j * s; // may increment or decrement idx
}
}
return idx;
}
| [
"[email protected]"
] | |
524fdbfd2841583da34537fdaf9bc7c700050868 | 2f8261bcfc6416b200309b5969a7a46e29edfc8c | /utils/perl/c/i686-w64-mingw32/include/wsrm.h | c205add802f586d6d8a64d892a147bd6adf6e732 | [
"LicenseRef-scancode-public-domain-disclaimer"
] | permissive | keenanlang/winepics | d0b385b93b8d7b099b95bf66c608637294da05fc | 5cae5bb9905889ad8694ece05b2b749904d7d39d | refs/heads/master | 2020-04-06T07:01:25.600675 | 2019-03-06T21:44:54 | 2019-03-06T21:44:54 | 42,735,349 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,968 | h | /**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _WSRM_H_
#define _WSRM_H_
#define IPPROTO_RM 113
#define MAX_MCAST_TTL 255
#define RM_OPTIONSBASE 1000
#define RM_RATE_WINDOW_SIZE (RM_OPTIONSBASE + 1)
#define RM_SET_MESSAGE_BOUNDARY (RM_OPTIONSBASE + 2)
#define RM_FLUSHCACHE (RM_OPTIONSBASE + 3)
#define RM_SENDER_WINDOW_ADVANCE_METHOD (RM_OPTIONSBASE + 4)
#define RM_SENDER_STATISTICS (RM_OPTIONSBASE + 5)
#define RM_LATEJOIN (RM_OPTIONSBASE + 6)
#define RM_SET_SEND_IF (RM_OPTIONSBASE + 7)
#define RM_ADD_RECEIVE_IF (RM_OPTIONSBASE + 8)
#define RM_DEL_RECEIVE_IF (RM_OPTIONSBASE + 9)
#define RM_SEND_WINDOW_ADV_RATE (RM_OPTIONSBASE + 10)
#define RM_USE_FEC (RM_OPTIONSBASE + 11)
#define RM_SET_MCAST_TTL (RM_OPTIONSBASE + 12)
#define RM_RECEIVER_STATISTICS (RM_OPTIONSBASE + 13)
#define RM_HIGH_SPEED_INTRANET_OPT (RM_OPTIONSBASE + 14)
#define SENDER_DEFAULT_RATE_KBITS_PER_SEC 56
#define SENDER_DEFAULT_WINDOW_SIZE_BYTES 10 *1000*1000
#define SENDER_DEFAULT_WINDOW_ADV_PERCENTAGE 15
#define MAX_WINDOW_INCREMENT_PERCENTAGE 25
#define SENDER_DEFAULT_LATE_JOINER_PERCENTAGE 0
#define SENDER_MAX_LATE_JOINER_PERCENTAGE 75
#define BITS_PER_BYTE 8
#define LOG2_BITS_PER_BYTE 3
enum eWINDOW_ADVANCE_METHOD {
E_WINDOW_ADVANCE_BY_TIME = 1,E_WINDOW_USE_AS_DATA_CACHE
};
typedef struct _RM_SEND_WINDOW {
ULONG RateKbitsPerSec;
ULONG WindowSizeInMSecs;
ULONG WindowSizeInBytes;
} RM_SEND_WINDOW;
typedef struct _RM_SENDER_STATS {
ULONGLONG DataBytesSent;
ULONGLONG TotalBytesSent;
ULONGLONG NaksReceived;
ULONGLONG NaksReceivedTooLate;
ULONGLONG NumOutstandingNaks;
ULONGLONG NumNaksAfterRData;
ULONGLONG RepairPacketsSent;
ULONGLONG BufferSpaceAvailable;
ULONGLONG TrailingEdgeSeqId;
ULONGLONG LeadingEdgeSeqId;
ULONGLONG RateKBitsPerSecOverall;
ULONGLONG RateKBitsPerSecLast;
ULONGLONG TotalODataPacketsSent;
} RM_SENDER_STATS;
typedef struct _RM_RECEIVER_STATS {
ULONGLONG NumODataPacketsReceived;
ULONGLONG NumRDataPacketsReceived;
ULONGLONG NumDuplicateDataPackets;
ULONGLONG DataBytesReceived;
ULONGLONG TotalBytesReceived;
ULONGLONG RateKBitsPerSecOverall;
ULONGLONG RateKBitsPerSecLast;
ULONGLONG TrailingEdgeSeqId;
ULONGLONG LeadingEdgeSeqId;
ULONGLONG AverageSequencesInWindow;
ULONGLONG MinSequencesInWindow;
ULONGLONG MaxSequencesInWindow;
ULONGLONG FirstNakSequenceNumber;
ULONGLONG NumPendingNaks;
ULONGLONG NumOutstandingNaks;
ULONGLONG NumDataPacketsBuffered;
ULONGLONG TotalSelectiveNaksSent;
ULONGLONG TotalParityNaksSent;
} RM_RECEIVER_STATS;
typedef struct _RM_FEC_INFO {
USHORT FECBlockSize;
USHORT FECProActivePackets;
UCHAR FECGroupSize;
BOOLEAN fFECOnDemandParityEnabled;
} RM_FEC_INFO;
#endif
| [
"[email protected]"
] | |
6366876632b474a7c9f20c8b54db71c9fa8bbd11 | 68da0b9b9ddd92537687a2adf218914221d2697a | /codeforces/business trip.c | 7a5f200773356ae485045eba9768ab2a117f4685 | [] | no_license | minhaz725/Contest-Programming | 71f298730fafba263a828d1b3182f465b2a51c43 | d15c546f36d59594bad787de88786cb57aac067c | refs/heads/master | 2023-04-05T20:41:26.996384 | 2021-04-16T16:19:31 | 2021-04-16T16:19:31 | 311,758,191 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 587 | c | #include <stdio.h>
int main()
{
int i,j,n,c,t;
scanf("%d",&n);
int a[12];
for(i=0;i<12;i++) scanf("%d",&a[i]);
if(n==0) {printf("0"); return 0;};
for(i=0;i<12-1;i++)
{
for(j=0;j<12-i-1;j++)
{
if(a[j]>a[j+1])
{
c=a[j];
a[j]=a[j+1];
a[j+1]=c;
}
}
}
c=0;
for(i=11,t=1;i>=0;i--,t++)
{
c=a[i]+c;
if(c>=n)
{
printf("%d",t);
return 0;
}
}
printf("-1");
return 0;
}
| [
"[email protected]"
] | |
28c4564e66992da1dde7d5a624f74ae9d57bf265 | b3a4cc8f037ebe8cd2fd338b220847d820b9ebcb | /libft/ft_strlcat.c | 1442d853aae8e684baaa220bca3ebdb326dea92b | [
"MIT"
] | permissive | SpenderJ/Corewar | 96ad25364a9cd00f1ff24cfa05c688e4fa48127a | 5ae6c9aab7057f0f6dc53ff7252eed9e703b5d5e | refs/heads/master | 2020-05-16T22:04:05.306013 | 2019-04-25T01:21:44 | 2019-04-25T01:21:44 | 183,324,940 | 1 | 0 | null | 2019-04-25T01:21:46 | 2019-04-25T00:18:47 | C | UTF-8 | C | false | false | 1,414 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jebossue <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/04 11:55:11 by jebossue #+# #+# */
/* Updated: 2016/11/25 14:28:53 by jebossue ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcat(char *dest, const char *src, size_t size)
{
unsigned int i;
unsigned int j;
unsigned int dest_length;
dest_length = ft_strlen(dest);
i = 0;
while (dest[i])
i++;
j = 0;
while (src[j] && i < size - 1)
{
dest[i] = src[j];
i++;
j++;
}
dest[i] = '\0';
if (size == dest_length + ft_strlen(src))
return (size);
if (size < dest_length)
return (ft_strlen(src) + size);
if (dest_length + ft_strlen(src) > size)
return (dest_length + ft_strlen(src));
return (i);
}
| [
"[email protected]"
] | |
88fdfed2e496c674bd8691cc8b0256b6624c7192 | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/net/sfm/afp/server/intrlckd.h | abb55f591e508c894f9a24af24fd851976194cd2 | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,839 | h | /*
Copyright (c) 1992 Microsoft Corporation
Module Name:
intrlckd.h
Abstract:
This module defines the routines that should have been in the EX package.
This manipulates inter-locked operations on flags and such.
Author:
Jameel Hyder (microsoft!jameelh)
Revision History:
5 Sep 1992 Initial Version
Notes: Tab stop: 4
--*/
#ifndef _INTRLCKD_
#define _INTRLCKD_
extern
VOID FASTCALL
AfpInterlockedSetDword(
IN PDWORD pSrc,
IN DWORD Mask,
IN PAFP_SPIN_LOCK pSpinLock
);
extern
VOID FASTCALL
AfpInterlockedClearDword(
IN PDWORD pSrc,
IN DWORD Mask,
IN PAFP_SPIN_LOCK pSpinLock
);
extern
VOID FASTCALL
AfpInterlockedSetNClearDword(
IN PDWORD pSrc,
IN DWORD SetMask,
IN DWORD ClrMask,
IN PAFP_SPIN_LOCK pSpinLock
);
// Macros for Interlocked/ExInterlocked calls
//
// For future reference, here is the difference between all the different
// kernel mode interlocked routines:
//
// InterlockedIncrement/Decrement - fastest on all platforms, inlined
// where appropriate to avoid call overhead. No spinlock required, usable
// on paged data. Operation is atomic ONLY with respect to other Interlocked
// calls.
//
// ExInterlockedIncrement/Decrement - not as efficient, requires a function
// call and a spinlock. Operation is atomic ONLY with respect to other
// ExInterlockedIncrement/Decrement calls. There is no reason to use this
// instead of InterlockedIncrement/Decrement. Does not actually acquire the
// spinlock. Required for backwards compatibility.
//
// ExInterlockedAddUlong - most inefficient, requires a function call and a
// spinlock. Spinlock is actually acquired, so the operation is atomic with
// respect to anything that acquires the same spinlock.
//
#define INTERLOCKED_INCREMENT_LONG(p) InterlockedIncrement(p)
#define INTERLOCKED_DECREMENT_LONG(p) InterlockedDecrement(p)
#define INTERLOCKED_ADD_STATISTICS(p, v, l) ExInterlockedAddLargeStatistic(p, v)
#define INTERLOCKED_INCREMENT_LONG_DPC(p,l) InterlockedIncrement(p)
#define INTERLOCKED_DECREMENT_LONG_DPC(p,l) InterlockedDecrement(p)
#ifdef NT40
#define INTERLOCKED_ADD_ULONG(p, v, l) ExInterlockedExchangeAdd(p, v)
#else
#define INTERLOCKED_ADD_ULONG(p, v, l) ExInterlockedAddUlong(p, v, &(l)->SpinLock)
#endif
#define INTERLOCKED_ADD_ULONG_DPC(p, v, l) ExInterlockedAddUlong(p, v, l)
#define INTERLOCKED_ADD_LARGE_INTGR(p, v, l) ExInterlockedAddLargeInteger(p, v, &(l)->SpinLock)
#define INTERLOCKED_ADD_LARGE_INTGR_DPC(p, v, l) ExInterlockedAddLargeInteger(p, v, &(l)->SpinLock)
#endif // _INTRLCKD_
| [
"[email protected]"
] | |
109c58bc4c8373d3d53691af3482bbf0a1fb3b8b | 0662c990d0266776369dcfcd77de53a4c0b960ad | /asst3/dumb/utils.c | e7bbf1092e924b8acb69c215a400c42c753f29cb | [] | no_license | galudino/sysprog_2019 | bce2e8da6df4dd9db2a39c4a9d948c013aa13a06 | 37b57b4e55669651fe97d09f958083ca62c0326c | refs/heads/master | 2021-06-24T18:26:29.126388 | 2021-02-17T04:45:22 | 2021-02-17T04:45:22 | 206,181,922 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,426 | c | /**
* @file utils.c
* @brief Source file utility functions, macros, etc.
*
* @author Gemuele Aludino
* @date 02 Dec 2019
* @copyright Copyright © 2019 Gemuele Aludino
*/
/**
* Copyright © 2019 Gemuele Aludino
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "utils.h"
#include <assert.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
void str_delete(void *arg) {
char **str = (char **)(arg);
free((*str));
(*str) = NULL;
}
int str_compare(const void *c1, const void *c2) {
char **s1 = (char **)(c1);
char **s2 = (char **)(c2);
return strcmp((*s1), (*s2));
}
void str_print(const void *arg, FILE *dest) {
char **str = (char **)(arg);
fprintf(dest, "%s", (*str));
}
char *str_trim_left(char *to_trim, const char *charset) {
size_t trim_length = 0;
if (strcmp(to_trim, "") == 0) {
return to_trim;
}
if (charset == NULL) {
charset = ESC_CHARS; /**< "\t\n\v\f\r\" */
}
trim_length = strspn(to_trim, charset);
if (trim_length > 0) {
size_t str_length = strlen(to_trim);
if (trim_length == str_length) {
to_trim[0] = NULL_TERMINATOR;
} else {
memmove(to_trim, to_trim + trim_length, str_length + 1 - trim_length);
}
}
return to_trim;
}
char *str_trim_right(char *to_trim, const char *charset) {
size_t i = 0;
if (strcmp(to_trim, "") == 0) {
return to_trim;
}
if (charset == NULL) {
charset = ESC_CHARS; /**< "\t\n\v\f\r\" */
}
i = strlen(to_trim) - 1;
while (strchr(charset, to_trim[i]) != NULL) {
to_trim[i] = NULL_TERMINATOR;
i--;
}
return to_trim;
}
char *str_trim(char *to_trim, const char *charset) {
if (strcmp(to_trim, "") == 0) {
return to_trim;
}
return str_trim_left(str_trim_right(to_trim, charset), charset);
}
bool ulog_attrs_disable[] = { false, false, false, false, false, false, false };
/**
* Utility function for debugging/error messages
*
* @param[in] dest stream destination
* @param[in] level literals "BUG", "ERROR", "WARNING", or "LOG"
* @param[in] file macro __FILE__ is to be used here (by client)
* @param[in] func macro __func__ is to be used here
* @param[in] line macro __LINE__ is to be used here
* @param[in] fmt formatting to be used
*
* @return character count of buffer (from fprintf)
*/
int ulog(FILE *dest,
const char *level,
const char *file,
const char *func,
long double line,
const char *fmt,
...) {
char buffer[MAXIMUM_STACK_BUFFER_SIZE];
char temp[256];
const char *color = KNRM;
const char *blink = "";
bool found = false;
bool is_integer = false;
bool is_currency = *file == '$';
int j = 0;
if (streql(level, "[BUG]")) {
color = KYEL_b;
found = true;
}
if (found == false) {
if (streql(level, "[LOG]")) {
color = KCYN_b;
found = true;
}
}
if (found == false) {
if (streql(level, "[ERROR]")) {
color = KRED_b;
blink = KBNK;
found = true;
}
}
if (found == false) {
if (streql(level, "[WARNING]")) {
color = KMAG_b;
blink = KBNK;
}
}
sprintf(temp, "%Lf", line);
/* char digit = strchr(temp, '.'); */
#if __STD_VERSION__ >= 199901L
is_integer = line / (long long int)(line) == 1.000000 || line == 0.00000;
#else
is_integer = line / (long int)(line) == 1.000000 || line == 0.00000;
#endif /* __STDC_VERSION__ >= 199901L */
is_integer = is_currency ? false : is_integer;
if (ulog_attrs_disable[DATE] == false) {
char date[1024];
sprintf(date, "%s%s%s ", KGRY, __DATE__, KNRM);
j += sprintf(buffer + j, "%s", date);
}
if (ulog_attrs_disable[TIME] == false) {
char time[1024];
sprintf(time, "%s%s%s ", KGRY, __TIME__, KNRM);
j += sprintf(buffer + j, "%s", time);
}
if (ulog_attrs_disable[LEVEL] == false) {
char leveltype[1024];
sprintf(leveltype, "%s%s%s%s ", blink, color, level, KNRM);
j += sprintf(buffer + j, "%s", leveltype);
}
if (ulog_attrs_disable[FILENAME] == false && ulog_attrs_disable[LINE]) {
char filename[1024];
sprintf(filename, "[%s] ", file);
j += sprintf(buffer + j, "%s", filename);
} else if (ulog_attrs_disable[FILENAME] && ulog_attrs_disable[LINE] == false) {
char linenumber[1024];
if (is_integer) {
#if __STD_VERSION__ >= 199901L
sprintf(linenumber, "[%lli] ", (long long int)(line));
#else
sprintf(linenumber, "[%li] ", (long int)(line));
#endif
} else {
if (is_currency) {
sprintf(linenumber, "[%0.2Lf] ", line);
} else {
sprintf(linenumber, "[%Lf] ", line);
}
}
j += sprintf(buffer + j, "%s", linenumber);
} else if (ulog_attrs_disable[FILENAME] == false && ulog_attrs_disable[LINE] == false) {
char fileline[1024];
if (is_integer) {
#if __STD_VERSION__ >= 199901L
sprintf(fileline, "[%s:%lli] ", file, (long long int)(line));
#else
sprintf(fileline, "[%s:%li] ", file, (long int)(line));
#endif
} else {
if (is_currency) {
sprintf(fileline, "[%s%0.2Lf] ", file, line);
} else {
sprintf(fileline, "[%s:%Lf] ", file, line);
}
}
j += sprintf(buffer + j, "%s", fileline);
}
if (ulog_attrs_disable[FUNCTION] == false) {
char function[1024];
sprintf(function, "%s%s", KCYN, func);
j += sprintf(buffer + j, "%s", function);
}
if (ulog_attrs_disable[FUNCTION] == false && ulog_attrs_disable[MESSAGE] == false) {
j += sprintf(buffer + j, "%s", " ");
}
if (ulog_attrs_disable[MESSAGE] == false) {
char message[4096];
va_list args;
va_start(args, fmt);
vsprintf(message, fmt, args);
va_end(args);
j += sprintf(buffer + j, "%s%s%s", KNRM_b, message, KNRM);
}
return fprintf(dest, "%s\n", buffer);
}
| [
"[email protected]"
] | |
627b6ff2079d400ba2915bf40059f0171085a32f | 19e7a8650e2a6814fd256e42d4cc9b09c447efb3 | /gadget/LUFA/Demos/Host/LowLevel/MouseHostWithParser/MouseHostWithParser.h | 92782cf750ae16bd7d747c0dd42afdf6daf90904 | [] | no_license | smartwanwan/teensy | ec7799d6993d1723fd57395c14c7eb7544b7c577 | 8b0f1e99afd09666bb435b8b2f54dbd42e727f5c | refs/heads/master | 2020-06-03T01:37:19.027859 | 2009-12-09T00:36:05 | 2009-12-09T00:36:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,957 | h | /*
LUFA Library
Copyright (C) Dean Camera, 2009.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
*
* Header file for MouseHostWithParser.c.
*/
#ifndef _MOUSE_HOST_H_
#define _MOUSE_HOST_H_
/* Includes: */
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/pgmspace.h>
#include <avr/power.h>
#include <stdio.h>
#include <LUFA/Version.h>
#include <LUFA/Drivers/Misc/TerminalCodes.h>
#include <LUFA/Drivers/Peripheral/SerialStream.h>
#include <LUFA/Drivers/Board/LEDs.h>
#include <LUFA/Drivers/USB/USB.h>
#include "ConfigDescriptor.h"
#include "HIDReport.h"
/* Macros: */
/** Pipe number for the mouse report data pipe */
#define MOUSE_DATAPIPE 1
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1
/** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
#define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)
/** LED mask for the library LED driver, to indicate that the USB interface is ready. */
#define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)
/** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
#define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
/* Function Prototypes: */
void Mouse_HID_Task(void);
void SetupHardware(void);
void EVENT_USB_Host_HostError(const uint8_t ErrorCode);
void EVENT_USB_Host_DeviceAttached(void);
void EVENT_USB_Host_DeviceUnattached(void);
void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);
void EVENT_USB_Host_DeviceEnumerationComplete(void);
void ProcessMouseReport(uint8_t* MouseReport);
#endif
| [
"[email protected]"
] | |
73492c4c104ab452755f369c18d96f70ec91937d | 8348f46c413b53c8f0ed88a2be6756cdb895f4ff | /src/wrapped/generated/wrappedgompundefs.h | cb0dd19134088b83ed6928bd3f233c2cf0f7aca0 | [
"MIT"
] | permissive | fengjixuchui/box86 | b3c3b1cf09b8beb4138bb96a6828f0bbbf4e9e6d | f0691e56fcb7c835cfcfd4dd76815d0517f8f4c4 | refs/heads/master | 2023-05-25T16:45:52.817195 | 2023-05-13T16:42:46 | 2023-05-13T16:42:46 | 208,695,258 | 0 | 0 | MIT | 2019-09-16T02:44:18 | 2019-09-16T02:44:18 | null | UTF-8 | C | false | false | 305 | h | /*******************************************************************
* File automatically generated by rebuild_wrappers.py (v2.0.0.10) *
*******************************************************************/
#ifndef __wrappedgompUNDEFS_H_
#define __wrappedgompUNDEFS_H_
#endif // __wrappedgompUNDEFS_H_
| [
"[email protected]"
] | |
ddb4c97adaeac3e7b8c1df58234b4214c2b7db85 | 664a14b0998a94c1c5f2695a66c6452aaf6c2c49 | /from_boomerang/stattest/ia32_elf_by_boomerang/by_retdec.c | abec38afc0b361893f4a467045347734ba18abe0 | [] | no_license | xiaobo996/decompiler-subjects | 2d8712a3ef0c031d2cf44b3e69ec8b03983cd366 | d8d55ee11f095405aeb420fa982f260dd85b5831 | refs/heads/master | 2023-03-15T10:26:13.249349 | 2021-03-14T16:47:33 | 2021-03-14T16:47:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,367 | c | //
// This file was generated by the Retargetable Decompiler
// Website: https://retdec.com
// Copyright (c) Retargetable Decompiler <[email protected]>
//
#include <stdint.h>
#include <stdio.h>
#include <sys/stat.h>
// ------------------------ Structures ------------------------
struct stat {
int32_t e0;
int32_t e1;
int32_t e2;
int32_t e3;
int32_t e4;
int32_t e5;
int32_t e6;
int32_t e7;
int32_t e8;
int32_t e9;
int32_t e10;
int32_t e11;
int32_t e12;
int32_t e13;
int32_t e14;
int32_t e15;
int32_t e16;
int32_t e17;
int32_t e18;
int32_t e19;
};
// ------------------------ Functions -------------------------
// Address range: 0x804835c - 0x8048391
int main(int argc, char ** argv) {
// 0x804835c
int32_t v1; // bp-108, 0x804835c
int32_t result = __xstat(3, "test/source/stattest.c", (struct stat *)&v1); // 0x8048372
struct stat * v2; // 0x804835c
printf("Stat returns %d; size of file is %d\n", result, (int32_t)v2);
return result;
}
// --------------- Dynamically Linked Functions ---------------
// int __xstat(int ver, const char * filename, struct stat * stat_buf);
// int printf(const char * restrict format, ...);
// --------------------- Meta-Information ---------------------
// Detected compiler/packer: gcc (3.2.2)
// Detected functions: 1
| [
"[email protected]"
] | |
b3d9a5bb5f0b6a80fb9d2ecee6f46d38e4d2771a | dee428ff6e4802a7a448cba79fa1f67af01942c0 | /Supplementary/c_language_test/main.c | 419f22a11dda838d8b263fd049772004b5d93528 | [
"MIT"
] | permissive | zweed4u/Real-Time-and-Embedded-Systems | 82956264f1d58fd089f5105a87ab834270b9534d | f0635bf051e805741ea9e0064bd645cc8c0f01e9 | refs/heads/master | 2021-05-01T01:56:19.644778 | 2017-05-16T22:40:39 | 2017-05-16T22:40:39 | 79,859,397 | 0 | 2 | null | null | null | null | UTF-8 | C | false | false | 479 | c | // C language self test
// SWEN-563
// Larry Kiser Jan. 30, 2017
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "c_language_test.h"
#include "unit_tests.h"
// Run the unit tests or as a "normal program".
int main( int argc, char *argv[] ) {
// Execute unit tests if program name contains "test".
if ( strstr( argv[0], "test" ) )
return test() ;
printf( "\nDoes nothing -- please run unit tests instead.\n\n" ) ;
return 0 ;
}
| [
"[email protected]"
] | |
ed09a176186b2c6a431dfa2ad19aa2bc0bf639c8 | e2053eada4623230c25f11128e49d7671e3978df | /frame/3/trsm/4m/bli_trsm4m.h | 06374c3c65a653a42f5e421d073afb2150b0ec1a | [
"BSD-3-Clause"
] | permissive | tkelman/blis | c59d210edad783dc76b733da31a7c71332218bac | ee2b679281ca45fb40b2198e293bc3bc3d446632 | refs/heads/master | 2020-12-24T10:11:47.895467 | 2014-06-06T17:41:55 | 2014-06-06T17:41:55 | 20,832,649 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,647 | h | /*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "bli_trsm4m_cntl.h"
#include "bli_gemmtrsm4m_l_ukr_ref.h"
#include "bli_gemmtrsm4m_u_ukr_ref.h"
#include "bli_trsm4m_l_ukr_ref.h"
#include "bli_trsm4m_u_ukr_ref.h"
//
// Prototype object-based interface.
//
void bli_trsm4m( side_t side,
obj_t* alpha,
obj_t* a,
obj_t* b );
//
// Prototype BLAS-like interfaces with homogeneous-typed operands.
//
#undef GENTPROT
#define GENTPROT( ctype, ch, opname ) \
\
void PASTEMAC(ch,opname)( \
side_t side, \
uplo_t uploa, \
trans_t transa, \
diag_t diaga, \
dim_t m, \
dim_t n, \
ctype* alpha, \
ctype* a, inc_t rs_a, inc_t cs_a, \
ctype* b, inc_t rs_b, inc_t cs_b \
);
INSERT_GENTPROT_BASIC( trsm4m )
| [
"[email protected]"
] | |
f5095378ceb137517c315fbd4eabd02fd359d04c | 5a91da3720296d30eef5ced0ff241d046ee782c8 | /blinky/main.c | d367888d1c122f66f60b6cf2def91d9a57aa40ca | [] | no_license | dennyem/pico-demos | 0aeb3d1cadaec20e52ffc1e8add5eeeadc213188 | a5adce447999a6207362db1681004accc2491624 | refs/heads/master | 2023-03-29T05:38:12.783476 | 2021-03-25T20:50:12 | 2021-03-25T20:50:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,234 | c | /*
* Copyright (c) 2016, Alex Taradov <[email protected]>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
//-----------------------------------------------------------------------------
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "rp2040.h"
#include "hal_gpio.h"
HAL_GPIO_PIN(LED, 25)
//-----------------------------------------------------------------------------
static void sys_init(void)
{
resets_hw->reset &= ~(RESETS_RESET_IO_BANK0_BITS | RESETS_RESET_PADS_BANK0_BITS);
}
//-----------------------------------------------------------------------------
int main(void)
{
sys_init();
HAL_GPIO_LED_out();
HAL_GPIO_LED_clr();
while (1)
{
volatile int wait = 1000000; while (wait--);
HAL_GPIO_LED_toggle();
}
return 0;
}
| [
"[email protected]"
] | |
029f7dfd9d33ed9b889a352d144161ada6b42e14 | 717bc5628f3c2fd8890893a23519f18d4ae7c17d | /prova1/3_2nd.c | e616716ef2fbe79acc68eb734207744efca6a4f6 | [] | no_license | amelco/ITP | e0c027259ea77b4dc5f5e8b741f0252d412e00df | 2d3b645b7540d841ad434070a22a900e290905c1 | refs/heads/master | 2020-06-23T18:45:07.591068 | 2019-11-01T22:25:08 | 2019-11-01T22:25:08 | 198,720,491 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 235 | c | #include <stdio.h>
int main() {
char txt1[50];
char txt2[50];
char res[100];
scanf("%s %s", txt1, txt2);
int i=0;
while(i<100) {
if (i%2==0) {
}
i++;
}
return 0;
} | [
"[email protected]"
] | |
c22aa24eda9efbc3cf9ae5608c00fe9107843aeb | 7d8f0cd831710fabf9a57c9c71cbed4c04b69707 | /tools/include/a_out.h | 72a055335919c34fdcfba022abc5ac42f1c21b0b | [] | no_license | sanderv32/milo-2.2 | 56367ffaec78a46bbc972d9c22145c508e0d34e3 | 05c0dd82aef21e6f72219fa7c8e1f10122cda5c1 | refs/heads/master | 2020-12-27T09:19:00.632644 | 2020-02-02T22:55:27 | 2020-02-02T22:55:27 | 237,849,269 | 1 | 1 | null | null | null | null | UTF-8 | C | false | false | 5,378 | h | /*
* HISTORY
* $Log: a_out.h,v $
* Revision 4.0 1993/10/18 15:37:42 rusling
* Include file.
*
*/
#ifndef _A_OUT_H_
#define _A_OUT_H_ 1
/* This file describes the a.out file format
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Alpha's a.out. . . */
#ifdef CROSS_COMPILE_32_TO_64_BITS
#include "c_32_64.h"
typedef int32 boolean_t;
#else
#include <mach/std_types.h>
#endif
#if __osf__
typedef long integer_t;
#endif
struct exec {
integer_t a_magic; /* Use macros N_MAGIC, etc for access */
vm_size_t a_text; /* bytes of text in file */
vm_size_t a_data; /* bytes of data in file */
vm_size_t a_bss; /* bytes of auto-zeroed data */
vm_size_t a_syms; /* bytes of symbol table data in file */
vm_offset_t a_entry; /* start PC */
vm_offset_t a_tstart; /* text start, in memory */
vm_offset_t a_dstart; /* data start, in memory */
vm_size_t a_trsize; /* bytes of text-relocation info in file */
vm_size_t a_drsize; /* bytes of data-relocation info in file */
};
#define __LDPGSZ 8192
#ifndef OMAGIC
#define OMAGIC 0407
#define NMAGIC 0410
#define ZMAGIC 0413
#endif
#ifdef CROSS_COMPILE_32_TO_64_BITS
#define N_BADMAG(x) \
(((x).a_magic.low)!=OMAGIC && ((x).a_magic.low)!=NMAGIC && ((x).a_magic.low)!=ZMAGIC)
/* Address of the bottom of the text segment. */
#define N_TXTADDR(x) \
((x).a_tstart.low)
/* Address of the bottom of the data segment. */
#define N_DATADDR(x) \
((x).a_dstart.low)
/* Text segment offset. */
#define N_TXTOFF(ex) \
((ex).a_magic.low == ZMAGIC ? 0 : sizeof(struct exec))
/* Data segment offset. */
#define N_DATOFF(ex) \
((N_TXTOFF(ex)) + ((ex).a_magic.low != ZMAGIC ? (ex).a_text.low : \
__LDPGSZ + ((ex).a_text.low - 1 & ~(__LDPGSZ - 1))))
/* Symbol table offset. */
#define N_SYMOFF(x) \
(N_TXTOFF(x) + (x).a_text.low + (x).a_data.low + (x).a_trsize.low + (x).a_drsize.low)
#define N_STROFF(x) \
(N_SYMOFF(x) + (x).a_syms.low)
/* text relocation offset */
#define N_TRELOFF(x) \
(N_TXTOFF(x) + (x).a_text.low + (x).a_data.low)
/* data relocation offset */
#define N_DRELOFF(x) \
(N_TXTOFF(x) + (x).a_text.low + (x).a_data.low + (x).a_trsize.low)
#else
#define N_BADMAG(x) \
(((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
/* Address of the bottom of the text segment. */
#define N_TXTADDR(x) \
((x).a_tstart)
/* Address of the bottom of the data segment. */
#define N_DATADDR(x) \
((x).a_dstart)
/* Text segment offset. */
#define N_TXTOFF(ex) \
((ex).a_magic == ZMAGIC ? 0 : sizeof(struct exec))
/* Data segment offset. */
#define N_DATOFF(ex) \
((N_TXTOFF(ex)) + ((ex).a_magic != ZMAGIC ? (ex).a_text : \
__LDPGSZ + ((ex).a_text - 1 & ~(__LDPGSZ - 1))))
/* Symbol table offset. */
#define N_SYMOFF(x) \
(N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize)
#define N_STROFF(x) \
(N_SYMOFF(x) + (x).a_syms)
/* text relocation offset */
#define N_TRELOFF(x) \
(N_TXTOFF(x) + (x).a_text + (x).a_data)
/* data relocation offset */
#define N_DRELOFF(x) \
(N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize)
#endif
struct nlist {
union {
char *n_name;
struct nlist *n_next;
long n_strx;
vm_offset_t n_pad_cross_compile;
} n_un;
char n_type;
char n_other;
short n_desc;
int n_pad;
vm_offset_t n_value;
};
#define N_UNDF 0x0
#define N_ABS 0x2
#define N_TEXT 0x4
#define N_DATA 0x6
#define N_BSS 0x8
#define N_COMM 0x12
#define N_FN 0x1f
#define N_EXT 0x1
#define N_TYPE 0x1e
#define N_STAB 0xe0
#define N_FORMAT "%016lx"
enum reloc_type
{
RELOC_0_7, RELOC_0_15, RELOC_0_31, RELOC_0_63,
RELOC_0_25, RELOC_16_31, RELOC_WDISP21, RELOC_BASE21,
RELOC_WDISP14, RELOC_BASE14, RELOC_32_47, RELOC_48_63,
RELOC_U_16_31, RELOC_U_32_47, RELOC_U_48_63, RELOC_0_12,
RELOC_0_8,
NO_RELOC,
BRELOC_0_15, BRELOC_0_31, BRELOC_16_31,
BRSET_0_15, BRSET_16_31
};
struct relocation_info {
vm_offset_t r_address;
unsigned int r_index;
unsigned char r_extern;
enum reloc_type r_type : 8;
#ifdef VMS_HOST
short pad;
#endif
integer_t r_addend;
};
/* The following constants are used for actually emitting relocation
* information on Alpha. The relocation_info structure can't be used
* directly because the NT compiler alligns structure members in strange
* ways (it appears to allign all members, including fields, on 4 byte
* boundries.).
*/
#define R_ADDRESS_OFFSET 0
#define R_ADDRESS_SIZE 8
#define R_INDEX_OFFSET 8
#define R_INDEX_SIZE 4
#define R_EXTERN_OFFSET 12
#define R_EXTERN_SIZE 1
#define R_TYPE_OFFSET 13
#define R_TYPE_SIZE 1
#define R_ADDEND_OFFSET 16
#define R_ADDEND_SIZE 8
#define RELOCATION_INFO_SIZE 24
#endif /* _A_OUT_H_ */
| [
"[email protected]"
] | |
09367542e0e47b981161c4ec27bd371d504594c8 | de68efe5f645b806ea61205f6c71a51439dda66a | /hvl_replay.h | e07732f2e0b84fdd4ad650fe3f61c03a14d858ad | [] | no_license | PSP-Archive/Planet-Hively | 09b07a0b423e32da13f47c0ca8a666e054e09fe6 | 01eacca314db8ba75ad460d14fbbc02641f14eb6 | refs/heads/main | 2023-07-02T13:40:24.939695 | 2021-08-08T01:58:10 | 2021-08-08T01:58:10 | 393,831,830 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 7,148 | h |
#include "types.h"
// Woohoo!
#define MAX_CHANNELS 16
#define Period2Freq(period) ((3546897.f * 65536.f) / (period))
struct hvl_envelope
{
int16 aFrames, aVolume;
int16 dFrames, dVolume;
int16 sFrames;
int16 rFrames, rVolume;
int16 pad;
};
struct hvl_plsentry
{
uint8 ple_Note;
uint8 ple_Waveform;
int16 ple_Fixed;
int8 ple_FX[2];
int8 ple_FXParam[2];
};
struct hvl_plist
{
int16 pls_Speed;
int16 pls_Length;
struct hvl_plsentry *pls_Entries;
};
struct hvl_instrument
{
TEXT ins_Name[128];
uint8 ins_Volume;
uint8 ins_WaveLength;
uint8 ins_FilterLowerLimit;
uint8 ins_FilterUpperLimit;
uint8 ins_FilterSpeed;
uint8 ins_SquareLowerLimit;
uint8 ins_SquareUpperLimit;
uint8 ins_SquareSpeed;
uint8 ins_VibratoDelay;
uint8 ins_VibratoSpeed;
uint8 ins_VibratoDepth;
uint8 ins_HardCutRelease;
uint8 ins_HardCutReleaseFrames;
struct hvl_envelope ins_Envelope;
struct hvl_plist ins_PList;
};
struct hvl_position
{
uint8 pos_Track[MAX_CHANNELS];
int8 pos_Transpose[MAX_CHANNELS];
};
struct hvl_step
{
uint8 stp_Note;
uint8 stp_Instrument;
uint8 stp_FX;
uint8 stp_FXParam;
uint8 stp_FXb;
uint8 stp_FXbParam;
};
struct hvl_voice
{
int16 vc_Track;
int16 vc_NextTrack;
int16 vc_Transpose;
int16 vc_NextTranspose;
int32 vc_ADSRVolume;
struct hvl_envelope vc_ADSR;
struct hvl_instrument *vc_Instrument;
uint32 vc_SamplePos;
uint32 vc_Delta;
uint16 vc_InstrPeriod;
uint16 vc_TrackPeriod;
uint16 vc_VibratoPeriod;
uint16 vc_WaveLength;
int16 vc_NoteMaxVolume;
uint16 vc_PerfSubVolume;
uint8 vc_NewWaveform;
uint8 vc_Waveform;
uint8 vc_PlantPeriod;
uint8 vc_VoiceVolume;
uint8 vc_PlantSquare;
uint8 vc_IgnoreSquare;
uint8 vc_FixedNote;
int16 vc_VolumeSlideUp;
int16 vc_VolumeSlideDown;
int16 vc_HardCut;
uint8 vc_HardCutRelease;
int16 vc_HardCutReleaseF;
uint8 vc_PeriodSlideOn;
int16 vc_PeriodSlideSpeed;
int16 vc_PeriodSlidePeriod;
int16 vc_PeriodSlideLimit;
int16 vc_PeriodSlideWithLimit;
int16 vc_PeriodPerfSlideSpeed;
int16 vc_PeriodPerfSlidePeriod;
uint8 vc_PeriodPerfSlideOn;
int16 vc_VibratoDelay;
int16 vc_VibratoSpeed;
int16 vc_VibratoCurrent;
int16 vc_VibratoDepth;
int16 vc_SquareOn;
int16 vc_SquareInit;
int16 vc_SquareWait;
int16 vc_SquareLowerLimit;
int16 vc_SquareUpperLimit;
int16 vc_SquarePos;
int16 vc_SquareSign;
int16 vc_SquareSlidingIn;
int16 vc_SquareReverse;
uint8 vc_FilterOn;
uint8 vc_FilterInit;
int16 vc_FilterWait;
int16 vc_FilterSpeed;
int16 vc_FilterUpperLimit;
int16 vc_FilterLowerLimit;
int16 vc_FilterPos;
int16 vc_FilterSign;
int16 vc_FilterSlidingIn;
int16 vc_IgnoreFilter;
int16 vc_PerfCurrent;
int16 vc_PerfSpeed;
int16 vc_PerfWait;
struct hvl_plist *vc_PerfList;
int8 *vc_AudioPointer;
int8 *vc_AudioSource;
uint8 vc_NoteDelayOn;
uint8 vc_NoteCutOn;
int16 vc_NoteDelayWait;
int16 vc_NoteCutWait;
int16 vc_AudioPeriod;
int16 vc_AudioVolume;
int32 vc_WNRandom;
int8 *vc_MixSource;
int8 vc_SquareTempBuffer[0x80];
int8 vc_VoiceBuffer[0x282*4];
uint8 vc_VoiceNum;
uint8 vc_TrackMasterVolume;
uint8 vc_TrackOn;
int16 vc_VoicePeriod;
uint32 vc_Pan;
uint32 vc_SetPan; // New for 1.4
uint32 vc_PanMultLeft;
uint32 vc_PanMultRight;
uint32 vc_RingSamplePos;
uint32 vc_RingDelta;
int8 *vc_RingMixSource;
uint8 vc_RingPlantPeriod;
int16 vc_RingInstrPeriod;
int16 vc_RingBasePeriod;
int16 vc_RingAudioPeriod;
int8 *vc_RingAudioSource;
uint8 vc_RingNewWaveform;
uint8 vc_RingWaveform;
uint8 vc_RingFixedPeriod;
int8 vc_RingVoiceBuffer[0x282*4];
};
struct hvl_tune
{
TEXT ht_Name[128];
uint16 ht_SongNum;
uint32 ht_Frequency;
float64 ht_FreqF;
int8 *ht_WaveformTab[MAX_CHANNELS];
uint16 ht_Restart;
uint16 ht_PositionNr;
uint8 ht_SpeedMultiplier;
uint8 ht_TrackLength;
uint8 ht_TrackNr;
uint8 ht_InstrumentNr;
uint8 ht_SubsongNr;
uint16 ht_PosJump;
uint32 ht_PlayingTime;
int16 ht_Tempo;
int16 ht_PosNr;
int16 ht_StepWaitFrames;
int16 ht_NoteNr;
uint16 ht_PosJumpNote;
uint8 ht_GetNewPosition;
uint8 ht_PatternBreak;
uint8 ht_SongEndReached;
uint8 ht_Stereo;
uint16 *ht_Subsongs;
uint16 ht_Channels;
struct hvl_position *ht_Positions;
struct hvl_step ht_Tracks[256][64];
struct hvl_instrument *ht_Instruments;
struct hvl_voice ht_Voices[MAX_CHANNELS];
int32 ht_defstereo;
int32 ht_defpanleft;
int32 ht_defpanright;
int32 ht_mixgain;
};
void hvl_DecodeFrame( struct hvl_tune *ht, int8 *buf1, int8 *buf2, int32 bufmod );
void hvl_InitReplayer( void );
BOOL hvl_InitSubsong( struct hvl_tune *ht, uint32 nr );
struct hvl_tune *hvl_LoadTune( TEXT *name, uint32 freq, uint32 defstereo );
void hvl_FreeTune( struct hvl_tune *ht );
struct hvl_tune *hvl_reset( uint8 *buf, uint32 buflen, uint32 defstereo, uint32 freq, BOOL freeit );
| [
"[email protected]"
] | |
507aaa9c971f7de2bc6cc8bbe4c4719a00cc59e0 | 307e775b650f60d658832f30137c059df02cdce9 | /Midterm/week3/quiz/q2/q2.c | b2061ccfc6e26d19b880a6e115edc0cdd7baa11e | [] | no_license | ZeroHX/Compro2018 | 822eefeb84d57455732f82322e28e075b4b7925e | be228585d03925daf3efd4ee85931d44432c083b | refs/heads/master | 2020-04-18T06:43:24.710655 | 2019-03-20T15:42:09 | 2019-03-20T15:42:09 | 167,334,261 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 202 | c | #include "stdio.h"
int main() {
int i=5, j=36;
float x = 0.001, y = 0.00, z = -81.753;
char c='z', d='M';
// Assignment Statements of each question
j*=(int)(x+z)/2;
return 0;
} | [
"[email protected]"
] | |
27b81367856ef7f8766f6680c94e8510c396891a | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/reactos/sdk/tools/hhpcomp/lzx_compress/extr_lz_nonslide.c_lz_reset.c | 95b60fddb17f805fc86a6664e251947772fffae5 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 834 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int chars_in_buf; int block_loc; int block_buf; scalar_t__ analysis_valid; } ;
typedef TYPE_1__ lz_info ;
/* Variables and functions */
int /*<<< orphan*/ memmove (int,int,int) ;
void lz_reset(lz_info *lzi)
{
int residual = lzi->chars_in_buf - lzi->block_loc;
memmove(lzi->block_buf, lzi->block_buf + lzi->block_loc, residual);
lzi->chars_in_buf = residual;
lzi->block_loc = 0;
lzi->analysis_valid = 0;
} | [
"[email protected]"
] | |
a9bbea93620774b1704048cc22789e4ffe5b9850 | 36a466a5192f3fa875a49c2e5da85f20920244a5 | /software/igor/apps/state_lib/fsw/src/state_lib.h | a6c9f98d8a749e56ae201e339677d74576874bcc | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | efeslab/igor-ae | 3bf440bd96df3ec05a0c67bde4a834e341376401 | 17e940d4d3ab009fdfc4934b3a7a8ca76e5b7829 | refs/heads/main | 2023-04-03T05:55:59.661521 | 2021-04-12T18:24:56 | 2021-04-12T18:24:56 | 336,148,837 | 2 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,205 | h | /*
** Andrew Loveless <[email protected]>
** License details in LICENSE.txt
*/
#ifndef _state_lib_
#define _state_lib_
#include "cfe.h"
#include "cfe_platform_cfg.h"
#include <stdbool.h>
/*
** Public Defines
*/
/* Maximum size of data to disperse in bytes. */
#define STATE_MAX_DATA_SIZE (1400)
/* Max instances of state dispersal. */
/* Must agree with the AFDX config table. */
#define STATE_MAX_INSTANCES (10)
/* Index in VL table where dispersal VLs start. */
/* See afdx_lib_vls.c in igor_defs/tables/ */
#define STATE_VL_OFFSET (630)
/*
** Public Structure Declarations
*/
/* Data for one instance of state dispersal. */
/* This is only public to facilitate testing. */
typedef struct {
bool is_config; /* True if instance of dispersal is configured. */
size_t num_replicas; /* Number of replicas <= MAX_REPLICA_COUNT. */
uint8* p_input; /* Pointer to state data to disperse to others. */
uint8* p_output; /* Pointer to where resulting state is stored. */
/* Only used if the replica does not start with p_input. */
size_t len; /* Size of state data to disperse in bytes. */
int vl_ids[MAX_REPLICA_COUNT]; /* VLs used for sending and receiving. */
/* Index REPLICA_INDEX is used for sending. */
/* Else, index k is used to receive from Replica k. */
/* Timeout in ms for the protocol. */
/* A timeout of 0 means no timeout is used. */
size_t timeout_ms;
/* Data added to accomodate STATE_DisperseMulti(). */
struct timespec stop; /* time when timeout is reached. */
bool got_data[MAX_REPLICA_COUNT]; /* true if got data from replica */
} STATE_Data_t;
/*
** Public Global Variables
*/
/* Internal data for each dispersal instance. */
/* This is only public to facilitate testing. */
extern STATE_Data_t STATE_Data[STATE_MAX_INSTANCES];
/*
** Public Function Declarations
*/
/* Used for initialization and cleanup. */
int32 STATE_LibEntry(void);
void STATE_LibInit(void);
void STATE_LibCleanup(void);
/**
** Configure an instance of the state dispersal protocol.
**
** \param[in] instance Instance of dispersal protocol to use.
** Must be < STATE_MAX_INSTANCES.
** \param[in] num_replicas Number of replicas in system.
** Must be <= MAX_REPLICA_COUNT.
** \param[in] p_input Pointer to location of state to disperse.
** \param[out] p_output Pointer where recovered state will be stored.
** \param[in] len Length of state to exchange in bytes.
** Must be <= STATE_MAX_DATA_SIZE.
** \param[in] timeout_ms Timeouts for the protocol in milliseconds.
**
** \return None
*/
void STATE_Config(size_t instance,
size_t num_replicas,
uint8* p_input,
uint8* p_output,
size_t len,
size_t timeout_ms);
/**
** Disperse your state data to other replicas.
**
** Note that the implementation of state dispersal is purposefully somewhat
** inefficient to make measuring worst-case latency easier. For example, even
** if a replica already has the state, they wait to read it from others. This
** would not be needed in a real implementation, since replicas who already
** have the state don't need to recover it.
**
** \param[in] instance Instance of dispersal protocol < STATE_MAX_INSTANCES.
** The instance must have already been configured
** with STATE_Config().
** \param[in] have_state True if replica has state to disperse, else false.
**
** \returns None
*/
void STATE_Disperse(size_t instance,
bool have_state);
/**
** Run multiple instances of state dispersal simultaneously.
**
** This is a convenience function that runs multiple instances of dispersal that
** have been configured until (num_instances) of them timeout or finish.
**
** \param[in] num_instances Number of instances of dispersal that must terminate
** in order for this function to return.
** \param[in] p_run_these Pointer to array of size STATE_MAX_INSTANCES
** indicating which instances to run.
** \param[in] p_have_data Pointer to array of size STATE_MAX_INSTANCES
** indicating which instances have state to disperse.
** \returns None
*/
void STATE_DisperseMulti(size_t num_instances,
bool* p_run_these,
bool* p_have_state);
/**
** Clear the receive VLs for the given dispersal instance.
**
** \param[in] instance Instance of exchange protocol < EXCHANGE_MAX_INSTANCES.
** The instance must have already been configured
** with EXCHANGE_Config().
** \returns None
*/
void STATE_ClearVLs(size_t instance);
/**
** Execute some functions to test the library.
** \return None
*/
void STATE_Test(void);
#endif
| [
"[email protected]"
] | |
c0e3f6451e7113a77f11bcbe81d89dff348ce830 | 6c5e39bf4b20e434a1fd2503b7438598e9b2ab24 | /lab_10_03_02/src/main.c | 0e94d36ab34ff26a63e4a5e6d3160771d0112281 | [] | no_license | RullDeef/c-lab | bcbf8eea497825aacf78caadb6ce100c0c820552 | 9856fb5cb92976863b667416a1534c6aa196cf13 | refs/heads/master | 2023-06-27T21:31:19.735178 | 2021-01-19T23:14:52 | 2021-01-19T23:14:52 | 387,733,033 | 2 | 0 | null | null | null | null | UTF-8 | C | false | false | 375 | c | #include <stdio.h>
#include <stdlib.h>
#include "num_dcmp.h"
#include "commander.h"
int main(void)
{
int status = EXIT_FAILURE;
char *line = NULL;
size_t line_len = 0;
if (getline(&line, &line_len, stdin) > 0)
{
cmd_type_t cmd = cmd_parse(line);
status = cmd_execute(cmd);
}
free(line);
return status;
}
| [
"[email protected]"
] | |
8b31d71701c0abd16a208be6a8ead1c7fea2addb | 1fabbdfd1ca9ea1b6808893e12bd907eb74de414 | /xcode/Classes/Native/mscorlib_System_Collections_Generic_Comparer_1_gen_246.h | 4ac33acc28ed2209ed3591d2d58b1b0d79e1d884 | [] | no_license | Klanly/TutorialPackageClient | 6f889e96c40ab13c97d107708ae8f3c71a484301 | b9d61ba2f287c491c9565b432f852980ec3fee28 | refs/heads/master | 2020-12-03T01:42:35.256114 | 2016-11-01T02:40:21 | 2016-11-01T02:40:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 523 | h | #pragma once
#include <stdint.h>
// System.Collections.Generic.Comparer`1<Games.ImpactModle.ClientImpactInfo>
struct Comparer_1_t18329;
// System.Object
#include "mscorlib_System_Object.h"
// System.Collections.Generic.Comparer`1<Games.ImpactModle.ClientImpactInfo>
struct Comparer_1_t18329 : public Object_t
{
};
struct Comparer_1_t18329_StaticFields{
// System.Collections.Generic.Comparer`1<T> System.Collections.Generic.Comparer`1<Games.ImpactModle.ClientImpactInfo>::_default
Comparer_1_t18329 * ____default;
};
| [
"[email protected]"
] | |
6eb05a473a7c7efb39650e44a96d0180c143e736 | 40de3da30239862f11a946166b50438174c2fd4e | /lib/wizards/gynter/v_map/virtual_map.c | bf38a8d0b78cf75cf869dd6c59bb0a99727b5941 | [
"MIT"
] | permissive | vlehtola/questmud | f53b7205351f30e846110300d60b639d52d113f8 | 8bc3099b5ad00a9e0261faeb6637c76b521b6dbe | refs/heads/master | 2020-12-23T19:59:44.886028 | 2020-01-30T15:52:16 | 2020-01-30T15:52:16 | 237,240,459 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,528 | c | inherit "/room/map_daemon";
check_rooms(string str) {
if (str == "f") return clone_object("/wizards/celtron/field/forest");
if (str == "p") return clone_object("/wizards/celtron/field/plains");
if (str == "v") return clone_object("/wizards/celtron/field/valley");
}
check_special_coords(x,y) {
if(x == 38 && y == 15) return "out: ";
return 0;
}
get_map() {
map = allocate(25);
/* 1234567890123456789012345678901234567890 (exit 38 ja 15)*/
map[0] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[1] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[2] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[3] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[4] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[5] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^pp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[6] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[7] = "^^^^^^vvv^^^v^^^^^^^^^^^^^^^^^pppppppppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[8] = "^^^^^^^vvvvv^^^^^^^^^^^^^^^^^^^^ppppfffpppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[9] = "^^^^^^^^^^v^^^^v^^^^^^^^^^^^^^^ppppffffffpppppppp^^^^^^^^^^^^^^^^^^^^^^^^";
map[10] = "^^^^^^^^^^vvvvv^^^^^^^^^^^^^^^^pppppfffpppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[11] = "^^^^^^^^^v^^^^pppp^ppp^^^^^^^^pppppppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[12] = "^^^^^^^^^^^^^pppppppppppppppppppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[13] = "^^^^^^^^^^^^^^^^^ppppppppfppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[14] = "^^^^^^^^^^^^^^^^^^pppppffffppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[15] = "^^^^^^^^^^^^^^^^^^^^ppffffppppppppppp?^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[16] = "^^^^^^^^^^^^^^^^^^^^^^^^fpppppppppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[17] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[18] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[19] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[20] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[21] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
map[22] = "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^";
return map;
}
| [
"[email protected]"
] | |
ee6feff0c0e6a96e8eb497cb8c06ea293914b7e5 | 5b0ef3e872f5aca8b430e34ebca9c1a4ae3d63fe | /older/Game_ofDivisors.c | 3a526d52029115d29918fb4317cd86b73e676e61 | [] | no_license | venkatesh551/CodeChef | 826d27989029770b8db77c235e0d5de001aaf83c | ae20d15dd35ae530d35732f113e9f7f0c7142542 | refs/heads/master | 2021-01-23T21:35:36.918692 | 2015-07-14T04:42:46 | 2015-07-14T04:42:46 | 34,179,633 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 201 | c | #include <stdio.h>
int main(void)
{
int T;
scanf("%d", &T);
while (T--)
{
int n;
scanf("%d", &n);
if (n & 1)
{
puts("Tom");
}
else
{
puts("Mike");
}
}
return 0;
}
| [
"[email protected]"
] | |
18ac5afd36f73f9477cd9c3a10eecbadf3ef8b50 | 51928337483095b12f046eda9ea17ba0b1a81fc0 | /3rdparty/mkl/compilers_and_libraries_2017.2.187/windows/mkl/interfaces/fftw2xf/wrappers/rfftw_fprint_plan.c | 054ff3f400e80234916c95f821684e12b834fc2c | [] | no_license | kingofthebongo2008/geometry_images | 8592aa99e53a16821725a2564313eeafb0462362 | 53109f9bc9ea19d0f119f0fe71762248d5038213 | refs/heads/master | 2021-01-19T03:02:56.996122 | 2017-07-06T13:25:47 | 2017-07-06T13:25:47 | 87,302,727 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,690 | c | /*******************************************************************************
* Copyright 2010-2017 Intel Corporation All Rights Reserved.
*
* The source code, information and material ("Material") contained herein is
* owned by Intel Corporation or its suppliers or licensors, and title to such
* Material remains with Intel Corporation or its suppliers or licensors. The
* Material contains proprietary information of Intel or its suppliers and
* licensors. The Material is protected by worldwide copyright laws and treaty
* provisions. No part of the Material may be used, copied, reproduced,
* modified, published, uploaded, posted, transmitted, distributed or disclosed
* in any way without Intel's prior express written permission. No license under
* any patent, copyright or other intellectual property rights in the Material
* is granted to or conferred upon you, either expressly, by implication,
* inducement, estoppel or otherwise. Any license under such intellectual
* property rights must be express and approved by Intel in writing.
*
* Unless otherwise agreed by Intel in writing, you may not remove or alter this
* notice or any other notice embedded in Materials by Intel or Intel's
* suppliers or licensors in any way.
*******************************************************************************/
/*
*
* rfftw_fprint_plan - FFTW2 wrapper to MKL.
*
******************************************************************************
*/
#include "fftw2_mkl.h"
/* FFTW2 documentation doesn't cover this function. */
void
rfftw_fprint_plan(FILE *f, rfftw_plan plan)
{
UNUSED(f);
UNUSED(plan);
}
| [
"[email protected]"
] | |
5ef841e077421f35a175412c5dc39e7f51dec310 | 8121b623f1dff002a7cc38ef4333f73cd6a7daf2 | /02/print_bits.c | 57845275ae5a7ee03675484668edab328db21541 | [] | no_license | moonlightcrystal/exam | 1120ff60ec9cd77b9b8339d6452280c9e1edc386 | 62d9a27d15d2f87f2bfbb26f50bfbfa350f29319 | refs/heads/master | 2020-07-03T05:23:18.717703 | 2019-08-22T20:06:18 | 2019-08-22T20:06:18 | 201,798,390 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,036 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_bits.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kcorie <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/12 17:58:00 by kcorie #+# #+# */
/* Updated: 2019/08/12 18:02:32 by kcorie ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
void print_bits(unsigned char octet)
{
int len;
len = 8;
while(len--)
write(1, (octet >> len) & 1 ? "1" : "0", 1);
}
| [
"[email protected]"
] | |
f744679eb73d6e83fb88ba97e8d0cc905cf0d844 | 4c4adeef3f2a8252fa9d1b6486df8813695faff9 | /src/InfineonRacer_TC23A/0_Src/AppSw/Tricore/Main/TestGtm/AppTaskFu.h | 2a5314f520b2902f6d3f084bafe7a072a83309b2 | [] | no_license | realsosy/InfineonRacer | 637fd1364e47f99cd0cb830f93b6e175b54e84d5 | 7fc847ba9eb1d3caa230baa7240fd332bcaa1d13 | refs/heads/master | 2021-04-26T03:05:31.202330 | 2019-04-04T15:15:02 | 2019-04-04T15:15:02 | 124,036,690 | 32 | 26 | null | 2019-02-11T08:08:28 | 2018-03-06T07:13:12 | C | UTF-8 | C | false | false | 476 | h | #ifndef APPTASKFU_H_
#define APPTASKFU_H_
#include <Ifx_Types.h>
#include "Basic.h"
#include "AsclinShellInterface.h"
IFX_EXTERN boolean task_flag_1m;
IFX_EXTERN boolean task_flag_10m;
IFX_EXTERN boolean task_flag_100m;
IFX_EXTERN boolean task_flag_1000m;
void appTaskfu_init(void);
void appTaskfu_1ms(void);
void appTaskfu_10ms(void);
void appTaskfu_100ms(void);
void appTaskfu_1000ms(void);
void appTaskfu_idle(void);
void appIsrCb_1ms(void);
#endif /* APPTASKFU_H_ */
| [
"[email protected]"
] | |
92b471ea7b3aaab0628b2d722beb21f930c63e78 | 74ee33613d5946ff56fcb0636cb8133a5bbcfb90 | /02 - Parciales/Parcial 1 - ABM/Funciones/estructuraDirector.c | 5ef5473d730f027d1f62bc94a66853a981db08d3 | [] | no_license | aeserein/Carpeta-C | 9bb54bb6592e6d2394cf5729232f18bcfebf471d | 3573a8dd141e005d87b140f769a0cbd68a888fe0 | refs/heads/master | 2020-03-27T18:45:23.105867 | 2019-08-18T04:42:28 | 2019-08-18T04:42:28 | 146,941,068 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 7,059 | c | #include "estructuraDirector.h"
int director_init( director listado[],int limite) {
int retorno = -1;
int i;
if(limite > 0 && listado != NULL)
{
retorno = 0;
for(i=0; i<limite; i++)
{
listado[i].estado= VACIO;
listado[i].id= 0;
}
}
return retorno;
}
void director_hardcode(director listado[]) {
int id[5] = {0,1,2,3,4};
char nombre[][TAM]= {"Director1","Director2","Director3","Director4","Director5"};
int diaNac[5] = {11,12,13,14,15};
int mesNac[5] = {1,2,3,4,5};
int anioNac[5] = {1901,1902,1903,1904,1905};
char nacionalidad[][TAM] = {"Argentina", "Paraguay", "Brasil", "Chile", "Bolivia"};
int i;
for(i=0; i<5; i++) {
listado[i].id = id[i];
strcpy(listado[i].nombre,nombre[i]);
listado[i].diaNacimiento = diaNac[i];
listado[i].mesNacimiento = mesNac[i];
listado[i].anioNacimiento = anioNac[i];
strcpy(listado[i].pais, nacionalidad[i]);
listado[i].estado = ALTA;
}
}
int director_estaVacioEsteArray(director lista[], int len) {
int estaVacio = -1;
int i;
if(len > 0 && lista != NULL) {
estaVacio = 1;
for(i=0; i<len; i++) {
if (lista[i].estado==ALTA) {
estaVacio = 0;
break;
}
}
}
return estaVacio;
}
//////////////////////////////////////////////////////////////////
int director_buscarPorId(director lista[] ,int limite, int id) {
int retorno = -1;
int i;
if(limite > 0 && lista != NULL) {
retorno = -2;
for(i=0;i<limite;i++) {
if(lista[i].estado == ALTA && lista[i].id == id) {
retorno = i;
break;
}
}
}
return retorno;
}
int director_siguienteId(director lista[],int limite) {
int retorno = 0;
int i;
if(limite > 0 && lista != NULL) {
retorno = -1;
for(i=0; i<limite; i++) {
if(lista[i].estado == ALTA && lista[i].id>retorno) {
retorno=lista[i].id;
}
}
}
return retorno+1;
}
int director_buscarLugarLibre(director lista[],int limite) {
int retorno = -1;
int i;
if(limite > 0 && lista != NULL) {
retorno = -2;
for(i=0;i<limite;i++) {
if(lista[i].estado == VACIO || lista[i].estado == BAJA) {
retorno = i;
break;
}
}
}
return retorno;
}
//////////////////////////////////////////////////////////////////
void director_ListaHeader() {
printf("\n");
printf(" __________________________________________________________________\n");
director_listaRenglon();
printf(" | %5s | %18s | %11s | %17s |\n" , "ID" , "Nombre" , "Fecha Nac.", "Pais");
director_cierreLista();
director_listaRenglon();
}
void director_listaRenglon() {
printf(" | | | | |\n");
}
void director_cierreLista() {
printf(" |________|_____________________|______________|____________________|\n");
}
void director_mostrarUno(director lista) {
printf(" | %5d |", lista.id);
printf(" %18s |", lista.nombre);
printf(" %.2hi/", lista.diaNacimiento);
printf("%.2hi/", lista.mesNacimiento);
printf("%hi |", lista.anioNacimiento);
printf(" %17s |\n" , lista.pais);
}
void director_mostrarUnoConHeader(director lista) {
director_ListaHeader();
printf(" | %5d |", lista.id);
printf(" %18s |", lista.nombre);
printf(" %.2hi/", lista.diaNacimiento);
printf("%.2hi/", lista.mesNacimiento);
printf("%hi |", lista.anioNacimiento);
printf(" %17s |\n" , lista.pais);
director_cierreLista();
}
void director_mostrarNombreDirector(director lista) {
printf(" %14.14s |\n", lista.nombre);
}
void director_mostrarListado(director lista[],int limite) {
int i;
director_ordenarPorID(lista, limite);
if(limite > 0 && lista != NULL) {
director_ListaHeader();
for(i=0; i<limite; i++) {
if(lista[i].estado==ALTA) {
director_mostrarUno(lista[i]);
}
}
director_cierreLista();
}
}
//////////////////////////////////////////////////////////////////
void director_alta(director lista[],int limite) {
int id;
int indice;
short f;
short encontro = 0;
int indiceDirectorEncontrado;
if(limite > 0 && lista != NULL) {
indice = director_buscarLugarLibre(lista,limite);
if(indice >= 0) {
id = director_siguienteId(lista,limite);
getString(lista[indice].nombre, "\nNombre:\t\t\t", TAM);
primerasLetrasMayusculas(lista[indice].nombre);
for (f=0 ; f<limite ; f++) {
if (f==indice) { continue; }
if ( stricmp(lista[indice].nombre , lista[f].nombre)==0) {
encontro = 1;
indiceDirectorEncontrado = f;
}
}
if (!encontro) {
lista[indice].diaNacimiento = getIntBetween(1,31, "Nacimiento - Dia:\t");
lista[indice].mesNacimiento = getIntBetween(1,12, "Nacimiento - Mes:\t");
lista[indice].anioNacimiento = getIntBetween(1900,2010, "Nacimiento - Anio:\t");
getString(lista[indice].pais, "Pais de origen:\t\t" , TAM);
primerasLetrasMayusculas(lista[indice].pais);
lista[indice].id = id;
lista[indice].estado = ALTA;
} else {
system("cls");
printf("\nEse director ya se encuentra en el sistema.\n");
director_mostrarUnoConHeader(lista[indiceDirectorEncontrado]);
}
}
}
}
int director_baja(director lista[] ,int limite, int id) {
short encontro = 0;
int idDelDirectorBorrado = -1;
limite--;
for ( ; limite>=0 ; limite--) {
if (lista[limite].estado==1 && id==lista[limite].id) {
encontro = 1;
break;
}
}
if (encontro) {
system("cls");
director_mostrarUnoConHeader(lista[limite]);
if (pregunta("Esta seguro? S/N\t")) {
idDelDirectorBorrado = lista[limite].id;
lista[limite].estado = VACIO;
strcpy(lista[limite].nombre,"");
printf("\n\nDirector borrado\n");
}
} else {
printf("\nNo se encontr%c el ID %d\n" , 162, id);
}
return idDelDirectorBorrado;
}
//////////////////////////////////////////////////////////////////
void director_ordenarPorID(director lista[], int len) {
short f, i;
director directorAux;
for (f=0 ; f<len-1 ; f++) {
for (i=f+1 ; i<len ; i++) {
if (lista[i].estado==ALTA && lista[f].id>lista[i].id) {
directorAux = lista[f];
lista[f] = lista[i];
lista[i] = directorAux;
}
}
}
}
| [
"[email protected]"
] | |
feb30864af2f57baad27af6434d11c3fb3305384 | 6d20ec7f0462613d9585647d348979858baa75e0 | /src/wave/wave_canal.c | 3c94690026e70485752f0052c38c801588f95a28 | [] | no_license | Seinic-Mihai/WAVE-audio_format_editor | 85d0d0fe58f8d41029ac9cfec6ee2a892d2777fd | d3129ecda2486f08ccadf56c452b2b9c7d57fc91 | refs/heads/master | 2021-01-17T14:20:20.561860 | 2017-03-06T14:59:38 | 2017-03-06T14:59:38 | 84,085,935 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 797 | c | #include "wave.h"
wave_t *wave_canal(wave_t *wave, uint16_t c)
{
wave_t *w;
uint32_t k = 0;
uint32_t i = 0;
uint16_t j = 0;
w = wave_new(W_SAMPLE_RATE(wave),W_BITS_PER_SAMPLE(wave),c,W_DATA_SIZE(wave)/W_BLOCK_ALIGN(wave));
if(W_CHANNELS(wave) > c)
{
while (i < W_DATA_SIZE(wave))
{
j = 0;
while (j < c * W_BITS_PER_SAMPLE(wave) / 8)
{
W_DATA(w)[k] = W_DATA(wave)[i + j];
k++;
j++;
}
i += W_BLOCK_ALIGN(wave);
}
}
else
{
while (i < W_DATA_SIZE(wave))
{
j = 0;
while (j < c * W_BITS_PER_SAMPLE(wave) / 8)
{
if (j < W_CHANNELS(wave))
W_DATA(w)[k] = W_DATA(wave)[i+j];
else
W_DATA(w)[k] = W_DATA(wave)[i + W_CHANNELS(wave) - 1];
k++;
j++;
}
i += W_BLOCK_ALIGN(wave);
}
}
wave_delete(&wave);
return (w);
}
| [
"[email protected]"
] | |
276250eb7aa48c4f5f3717caddeb8079d5d70980 | a48c619fa5c04e93a39262878e2b09720930c197 | /kernel/arch/x86/exn.c | 7d127d8041db53db8e197823660fd7f921b1d098 | [] | no_license | vn-os/moridin_simple_os | 61504775034b2efebac8851b31e9bcd6935df7ea | a02c5271607894373a92d0d43c04af60f481fd26 | refs/heads/master | 2023-03-16T09:53:34.770831 | 2015-05-05T02:26:05 | 2015-05-05T02:26:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,133 | c | /**
* @file x86/exn.c
*
*/
#include <arch/exn.h>
#include <arch/idt.h>
#include <arch/reg.h>
#include <arch/vm.h>
#include <assert.h>
#include <types.h>
void page_fault(int vector, int error, struct registers *regs);
/*
* x86 exception handling jump table
*/
void (*exn_table[])(int vector, int error, struct registers *regs) = {
[0 ... 13] = exn_panic,
[14] = page_fault,
[15 ... 20] = exn_panic
};
void exn_panic(int vector, int error, struct registers *regs)
{
struct x86_exn *exn = &x86_exceptions[vector];
ERROR("\n"
"-------------------------------------------------------------------\n"
"%d %s %s (cause: %s)\n"
"-------------------------------------------------------------------\n"
"eip: 0x%08x\n"
"ebp: 0x%08x\n"
"\n"
"edi: 0x%08x esi: 0x%08x\n"
"eax: 0x%08x ebx: 0x%08x\n"
"ecx: 0x%08x edx: 0x%08x\n"
"\n"
"cr0: 0x%08x\n"
"cr2: 0x%08x\n"
"cr3: 0x%08x\n"
"cr4: 0x%08x\n"
"\n"
"ds: 0x%08x\n"
"es: 0x%08x\n"
"fs: 0x%08x\n"
"gs: 0x%08x\n"
"\n"
"error: %d\n"
"-------------------------------------------------------------------",
exn->vector, exn->mnemonic, exn->description, exn->cause,
regs->eip,
regs->ebp,
regs->edi, regs->esi,
regs->eax, regs->ebx,
regs->ecx, regs->edx,
get_cr0(),
regs->cr2,
regs->cr3,
get_cr4(),
regs->ds,
regs->es,
regs->fs,
regs->gs,
error
);
panic("Exception %d during boot. Aborting.", exn->vector);
}
/**
* @brief These are all the exceptions that can be generated by an x86
* processor.
*/
struct x86_exn x86_exceptions[] = {
{ 0, "#DE", "Divide Error Fault",
X86_FAULT,
"DIV or IDIV instructions",
false,
EXN_HANDLER_NAME(0)
},
{ 1, "#DB", "Debug",
X86_FAULT | X86_TRAP,
"INT 1 instruction",
false,
EXN_HANDLER_NAME(1)
},
{ 2, "NMI", "Non-Maskable Interrupt",
0,
"Nonmaskable external interrupt",
false,
EXN_HANDLER_NAME(2)
},
{ 3, "#BP", "Breakpoint",
X86_TRAP,
"INT 3 instruction",
false,
EXN_HANDLER_NAME(3)
},
{ 4, "#OF", "Overflow",
X86_TRAP,
"INTO instruction",
false,
EXN_HANDLER_NAME(4)
},
{ 5, "#BR", "BOUND Range Exceeded",
X86_FAULT,
"BOUND instruction",
false,
EXN_HANDLER_NAME(5)
},
{ 6, "#UD", "Invalid Opcode",
X86_FAULT,
"UD2 instruction or reserved opcode",
false,
EXN_HANDLER_NAME(6)
},
{ 7, "#NM", "Device Not Available (No Math Coprocessor)",
X86_FAULT,
"Floating-point or WAIT/FWAIT instruction",
false,
EXN_HANDLER_NAME(7)
},
{ 8, "#DF", "Double Fault",
X86_ABORT,
"Any instruction that can generate an exception, an NMI, "
"or an INTR",
true,
EXN_HANDLER_NAME(8)
},
{ 9, "---", "Coprocessor Segment Overrun (reserved)",
X86_FAULT,
"Floating-point instruction",
false,
EXN_HANDLER_NAME(9)
},
{ 10, "#TS", "Invalid TSS",
X86_FAULT,
"Task switch or TSS access",
true,
EXN_HANDLER_NAME(10)
},
{ 11, "#NP", "Segment Not Present",
X86_FAULT,
"Loading segment registers or accessing system segments.",
true,
EXN_HANDLER_NAME(11)
},
{ 12, "#SS", "Stack-Segment Fault",
X86_FAULT,
"Stack operations and SS register",
true,
EXN_HANDLER_NAME(12)
},
{ 13, "#GP", "General Protection Fault",
X86_FAULT,
"Any memory reference and other protection checks",
true,
EXN_HANDLER_NAME(13)
},
{ 14, "#PF", "Page Fault",
X86_FAULT,
"Any memory reference",
true,
EXN_HANDLER_NAME(14)
},
{ 15, "---", "Intel reserved",
0,
"Do not use",
false,
EXN_HANDLER_NAME(15)
},
{ 16, "#MF", "x87 FPU Floating-Point Error (Math Fault)",
X86_FAULT,
"x87 FPU floating-point or WAIT/FWAIT instruction",
false,
EXN_HANDLER_NAME(16)
},
{ 17, "#AC", "Alignment Check",
X86_FAULT,
"Any data reference in memory",
true,
EXN_HANDLER_NAME(17)
},
{ 18, "#MC", "Machine Check",
X86_ABORT,
"Error codes (if any) and source are model dependent",
false,
EXN_HANDLER_NAME(18)
},
{ 19, "#XF", "SIMD Floating-Point Exception",
X86_FAULT,
"SSE and SSE2 floating-point instructions",
false,
EXN_HANDLER_NAME(19)
}
/*
* Intel reserves vectors 20-31
*/
/*
* User defined vectors 32-255
*/
};
| [
"[email protected]"
] | |
f1af247df1026c514d3ba3ab4f36ba5254287c68 | c158769f03e30af5ae26f883ae9d968c9543bab4 | /libunix/set-tty-8n1.c | 7b92047796b76dcb83817384c338ab3b3c4a0de9 | [] | no_license | PaulWendt96/cs240lx-20spr | 22d0e05e3ca142f33883c0d3e67e01a4fa9fe2c8 | ac8a2602dd5d5ba14c99afd88b36f033cc9e407a | refs/heads/master | 2023-01-09T20:26:35.385661 | 2020-11-06T02:20:15 | 2020-11-06T02:20:15 | 382,043,692 | 1 | 0 | null | 2021-07-01T13:32:59 | 2021-07-01T13:32:58 | null | UTF-8 | C | false | false | 2,234 | c | #include <assert.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <termios.h>
#include "demand.h"
#include "libunix.h"
// XXX: if anyone figures out a cleaner way to do this, lmk. I don't
// have a mac, so stopped as soon as we had something that worked on
// linux & macos.
// params:
// - <timeout> is in seconds (< 1 ok)
// - <speed> is baud rate.
int set_tty_to_8n1(int fd, unsigned speed, double timeout) {
struct termios tty;
memset(&tty, 0, sizeof tty);
if (tcgetattr (fd, &tty) != 0)
panic("tcgetattr failed\n");
memset (&tty, 0, sizeof tty);
// https://github.com/rlcheng/raspberry_pi_workshop
cfsetspeed(&tty, speed);
// disable IGNBRK for mismatched speed tests; otherwise receive break
// as \000 chars
// XXX: wait, does this disable break or ignore-ignore break??
tty.c_iflag &= ~IGNBRK; // disable break processing
tty.c_lflag = 0; // no signaling chars, no echo,
// no canonical processing
tty.c_oflag = 0; // no remapping, no delays
tty.c_cc[VMIN] = 0; // read doesn't block
assert(timeout < 100 && timeout > 0);
// 0.1 seconds read timeout
tty.c_cc[VTIME] = (int)timeout *80; // this seems to cause issues?
/*
* Setup TTY for 8n1 mode, used by the pi UART.
*/
// Disables the Parity Enable bit(PARENB),So No Parity
tty.c_cflag &= ~PARENB;
// CSTOPB = 2 Stop bits,here it is cleared so 1 Stop bit
tty.c_cflag &= ~CSTOPB;
// Clears the mask for setting the data size
tty.c_cflag &= ~CSIZE;
// Set the data bits = 8
tty.c_cflag |= CS8;
// No Hardware flow Control
tty.c_cflag &= ~CRTSCTS;
// Enable receiver,Ignore Modem Control lines
tty.c_cflag |= CREAD | CLOCAL;
// Disable XON/XOFF flow control both i/p and o/p
tty.c_iflag &= ~(IXON | IXOFF | IXANY);
// Non Cannonical mode
tty.c_iflag &= ~(ICANON | ECHO | ECHOE | ISIG);
// No Output Processing
tty.c_oflag &= ~OPOST;
if(tcsetattr (fd, TCSANOW, &tty) != 0)
panic("tcsetattr failed\n");
return fd;
}
| [
"[email protected]"
] | |
606f9e9e844902a770b9dfe4580edfda3c599ea5 | af7977991477325ddc604b6d3e2ac3cb4aa29337 | /FlappyBirdGame3D2.0/Temp/il2cppOutput/il2cppOutput/mscorlib_System_Array_InternalEnumerator_1_gen426083020.h | 8067001074116e329895de8afcee691f12a9bcb4 | [] | no_license | jpf2141/FlappyBird3D | b824cf5fac6ca3c5739afc342b659af1f2836ab9 | fe4e9c421ec8dc26a7befd620f9deaf3c6361de5 | refs/heads/master | 2021-01-21T13:53:25.062470 | 2016-05-06T02:39:28 | 2016-05-06T02:39:28 | 55,712,365 | 3 | 1 | null | null | null | null | UTF-8 | C | false | false | 504 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.Array
struct Array_t;
#include "mscorlib_System_ValueType_103494864.h"
// System.Array/InternalEnumerator`1<Vuforia.HideExcessAreaAbstractBehaviour>
struct InternalEnumerator_1_t426083020_0
{
// System.Array System.Array/InternalEnumerator`1::array
Array_t * ___array_0;
// System.Int32 System.Array/InternalEnumerator`1::idx
int32_t ___idx_1;
};
| [
"[email protected]"
] | |
a1add91b4f261db1425139b25345c476ef071f04 | 807e340c4640c2bd0a071c6d238d6f6ac83e0be9 | /src/mpi/coll/ireduce/ireduce_tsp_ring_algos_prototypes.h | 3ccd92dc65e9fc791e7855dbd1f7f20a6957df8a | [
"mpich2"
] | permissive | shefty/mpich | 0980b53a19b9de10c95a4b68e223b616d66e4217 | c832b01ff0030ead33ee52472a2f7f325760141d | refs/heads/master | 2020-03-23T20:59:04.265296 | 2018-07-17T14:21:23 | 2018-07-23T21:01:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,434 | h | /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2006 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*
* Portions of this code were written by Intel Corporation.
* Copyright (C) 2011-2017 Intel Corporation. Intel provides this material
* to Argonne National Laboratory subject to Software Grant and Corporate
* Contributor License Agreement dated February 8, 2012.
*/
/* Header protection (i.e., IREDUCE_TSP_RING_ALGOS_PROTOTYPES_H_INCLUDED) is
* intentionally omitted since this header might get included multiple
* times within the same .c file. */
#include "tsp_namespace_def.h"
#undef MPIR_TSP_Ireduce_intra_ring
#define MPIR_TSP_Ireduce_intra_ring MPIR_TSP_NAMESPACE(Ireduce_intra_ring)
#undef MPIR_TSP_Ireduce_sched_intra_ring
#define MPIR_TSP_Ireduce_sched_intra_ring MPIR_TSP_NAMESPACE(Ireduce_sched_intra_ring)
int MPIR_TSP_Ireduce_sched_intra_ring(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root,
MPIR_Comm * comm, int segsize, MPIR_TSP_sched_t * sched);
int MPIR_TSP_Ireduce_intra_ring(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root, MPIR_Comm * comm,
MPIR_Request ** req, int segsize);
| [
"[email protected]"
] | |
95ff07228ffffea7def1c7e0ae1318a177ce9afe | e53ae9c98f54650697d829dcef711132e2a659e3 | /include/HL_reg_htu.h | 37c294c79e427527974df7bd26e4c77e7c8b4dd4 | [] | no_license | piense/rm57-i2c-repeated-start | 049dfd98339678245176e9cd47fdc8f8cdcf09a1 | d7f68c0394fb35011feaf4778631a7ddfb61b4e7 | refs/heads/master | 2021-01-19T17:41:18.910342 | 2017-08-22T16:22:42 | 2017-08-22T16:22:42 | 101,083,730 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,133 | h | /** @file HL_reg_htu.h
* @brief HTU Register Layer Header File
* @date 02-Mar-2016
* @version 04.05.02
*
* This file contains:
* - Definitions
* - Types
* - Interface Prototypes
* .
* which are relevant for the HTU driver.
*/
/*
* Copyright (C) 2009-2016 Texas Instruments Incorporated - www.ti.com
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef __REG_HTU_H__
#define __REG_HTU_H__
#include "HL_sys_common.h"
/* USER CODE BEGIN (0) */
/* USER CODE END */
/* htu Register Frame Definition */
/** @struct htuBase
* @brief HTU Base Register Definition
*
* This structure is used to access the HTU module registers.
*/
/** @typedef htuBASE_t
* @brief HTU Register Frame Type Definition
*
* This type is used to access the HTU Registers.
*/
typedef volatile struct htuBase
{
uint32 GC; /** 0x00 */
uint32 CPENA; /** 0x04 */
uint32 BUSY0; /** 0x08 */
uint32 BUSY1; /** 0x0C */
uint32 BUSY2; /** 0x10 */
uint32 BUSY3; /** 0x14 */
uint32 ACPE; /** 0x18 */
uint32 rsvd1; /** 0x1C */
uint32 RLBECTRL; /** 0x20 */
uint32 BFINTS; /** 0x24 */
uint32 BFINTC; /** 0x28 */
uint32 INTMAP; /** 0x2C */
uint32 rsvd2; /** 0x30 */
uint32 INTOFF0; /** 0x34 */
uint32 INTOFF1; /** 0x38 */
uint32 BIM; /** 0x3C */
uint32 RLOSTFL; /** 0x40 */
uint32 BFINTFL; /** 0x44 */
uint32 BERINTFL; /** 0x48 */
uint32 MP1S; /** 0x4C */
uint32 MP1E; /** 0x50 */
uint32 DCTRL; /** 0x54 */
uint32 WPR; /** 0x58 */
uint32 WMR; /** 0x5C */
uint32 ID; /** 0x60 */
uint32 PCR; /** 0x64 */
uint32 PAR; /** 0x68 */
uint32 rsvd3; /** 0x6C */
uint32 MPCS; /** 0x70 */
uint32 MP0S; /** 0x74 */
uint32 MP0E; /** 0x78 */
} htuBASE_t;
typedef volatile struct htudcp
{
uint32 IFADDRA;
uint32 IFADDRB;
uint32 IHADDRCT;
uint32 ITCOUNT;
} htudcp_t;
typedef volatile struct htucdcp
{
uint32 CFADDRA;
uint32 CFADDRB;
uint32 CFCOUNT;
uint32 rsvd4;
} htucdcp_t;
#define htuREG1 ((htuBASE_t *)0xFFF7A400U)
#define htuREG2 ((htuBASE_t *)0xFFF7A500U)
#define htuDCP1 ((htudcp_t *)0xFF4E0000U)
#define htuDCP2 ((htudcp_t *)0xFF4C0000U)
#define htuCDCP1 ((htucdcp_t *)0xFF4E0100U)
#define htuCDCP2 ((htucdcp_t *)0xFF4C0100U)
/* USER CODE BEGIN (1) */
/* USER CODE END */
#endif
| [
"[email protected]"
] | |
21a1c1dff3c703e4bb12e102ab73d45f989b912e | 6a2096c97357b1d66e0c5838cbbdb8cfefb19c27 | /up1.01/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pcd_ex.h | ce80f14b823c77009df720e009646309548a18e6 | [] | no_license | NovarLo/upprj | 184fc319113adeaa93a2683f9a168c6c17735138 | d1fdebe19476f3d94adba2e9e1c5b11d536a9143 | refs/heads/master | 2020-03-31T11:09:58.408942 | 2018-10-09T01:26:25 | 2018-10-09T01:26:25 | 152,165,929 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,975 | h | /* *
******************************************************************************
* @file stm32f4xx_hal_pcd_ex.h
* @author MCD Application Team
* @version V1.1.0
* @date 19-June-2014
* @brief Header file of PCD HAL module.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_HAL_PCD_EX_H
#define __STM32F4xx_HAL_PCD_EX_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal_def.h"
/* * @addtogroup STM32F4xx_HAL_Driver
* @{
*/
/* * @addtogroup PCDEx
* @{
*/
/* Exported functions --------------------------------------------------------*/
/* Peripheral Extended functions *********************************************/
HAL_StatusTypeDef HAL_PCDEx_SetTxFiFo(PCD_HandleTypeDef *hpcd, uint8_t fifo, uint16_t size);
HAL_StatusTypeDef HAL_PCDEx_SetRxFiFo(PCD_HandleTypeDef *hpcd, uint16_t size);
/* *
* @}
*/
/* *
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_HAL_PCD_EX_H */
/* *********************** (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| [
"[email protected]"
] | |
422eb73957425f561d27ce186db9a140dda405ca | 24d856d98c85a319d53be2768ccc176a50873fa3 | /eglibc-2.15/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h | a0da019c5f3a667b40e96c0b63c8145909b558db | [
"LGPL-2.1-only",
"GPL-2.0-only",
"LicenseRef-scancode-inner-net-2.0",
"BSD-3-Clause",
"LGPL-2.1-or-later",
"HPND",
"LicenseRef-scancode-other-copyleft",
"CMU-Mach",
"LicenseRef-scancode-other-permissive",
"BSD-2-Clause"
] | permissive | dozenow/shortcut | a4803b59c95e72a01d73bb30acaae45cf76b0367 | b140082a44c58f05af3495259c1beaaa9a63560b | refs/heads/jumpstart-php | 2020-06-29T11:41:05.842760 | 2019-03-28T17:28:56 | 2019-03-28T17:28:56 | 200,405,626 | 2 | 2 | BSD-2-Clause | 2019-08-03T19:45:44 | 2019-08-03T17:57:58 | C | UTF-8 | C | false | false | 816 | h | /* Definition of `struct stat' used in the kernel */
struct kernel_stat
{
unsigned short int st_dev;
unsigned long int st_ino;
unsigned short int st_mode;
short int st_nlink;
unsigned short int st_uid;
unsigned short int st_gid;
unsigned short int st_rdev;
long int st_size;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
long int st_blksize;
long int st_blocks;
unsigned long int __unused4;
unsigned long int __unused5;
};
#define _HAVE___UNUSED4
#define _HAVE___UNUSED5
#define _HAVE_STAT___UNUSED4
#define _HAVE_STAT___UNUSED5
#define _HAVE_STAT___PAD1
#define _HAVE_STAT___PAD2
#define _HAVE_STAT64___UNUSED4
#define _HAVE_STAT64___UNUSED5
#define _HAVE_STAT64___PAD2
#define _HAVE_STAT_NSEC
#define _HAVE_STAT64_NSEC
| [
"jflinn"
] | jflinn |
0ca8add7f4d494bcdeda613a9794131dc01634d6 | a40eeb616f62673ecb279df805d0836f28d9b6c2 | /shell/sh_ringbell.c | e14098a4c8831cfa38c1bf510c26fc4e5429f63c | [] | no_license | waxife/nezha | d729a52559b4c019d8942d54775fa58a47943103 | 24e9370066517a8c74b85a2cf5c1470ebcc407a4 | refs/heads/master | 2021-01-19T21:08:24.883242 | 2017-04-21T11:51:44 | 2017-04-21T11:51:44 | 88,610,691 | 1 | 1 | null | null | null | null | UTF-8 | C | false | false | 2,313 | c | /**
* @file sh_audio.c
* @brief audio test command
* $Id: sh_ringbell.c,v 1.3 2014/03/07 03:36:03 lym Exp $
* $Author: lym $
* $Revision: 1.3 $
*
* Copyright (c) 2012 Terawins Inc. All rights reserved.
*
* @date 2013/09/03 hugo New file.
*
*/
#include <config.h>
#include <stdio.h>
#include <shell.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <serial.h>
#include <ctype.h>
#include <audio.h>
#include <debug.h>
#include "irq.h"
#include "interrupt.h"
#include <codec_eng/ringbell.h>
#include "volume.h"
command_init (sh_ringbell, "ringbell", "ringbell <idx> [<count>]");
command_init (sh_stopbell, "stopbell", "stopbell");
command_init (sh_vol_ctrl, "volumectr", "volumectr [<volume>]");
static int sh_ringbell (int argc, char **argv, void **result, void *sys_ctx)
{
int idx;
int count = 0;
int rc = 0;
if(argc < 2)
goto EXIT;
idx = atoi(argv[1]);
count = (argc > 2) ? atoi(argv[2]) : 1;
printf("ringbell idx = %d, repeat count = %d\n",idx,count);
rc = ringbell(idx,count);
return 0;
EXIT:
print_usage(sh_ringbell);
return rc;
}
static int sh_stopbell (int argc, char **argv, void **result, void *sys_ctx)
{
stopbell();
return 0;
}
static int sh_vol_ctrl(int argc, char **argv, void **result, void *sys_ctx)
{
int rc = 0;
int vol = 16;
int ch;
if (argc >= 1)) {
vol = atoi(argv[1]);
}
vol_init(vol);
while(1){
ch = getb2 ();
if (ch > 0) {
printf ("'%c'\n", ch);
switch (toupper (ch)) {
case 'U':
vol = vol_up();
printf ("Volume UP %d\n", vol);
break;
case 'D':
vol = vol_down();
printf ("Volume DOWN %d\n", vol);
break;
case 'S':
printf ("Set volume to 16.\n");
vol = vol_set(16);
break;
case 'Q':
printf ("Exit Volume control.\n");
goto EXIT;
break;
}
}
}
EXIT:
print_usage(sh_vol_ctrl);
return rc;
}
| [
"[email protected]"
] | |
4e84ff1df245d2f5873296d106cff351e863f92a | 64ff1ed19376504536817f3d5034b6757f03c537 | /clicks/eink290inch/example/main.c | 2e7cf12d90d25a7563d98106625dcb40da64e4e4 | [] | no_license | KWest-WRD/mikrosdk_click_v2 | 69efc8eaa8de5990a5aad78ebae5bfd3b9c0d20f | 9c97d8ed79fc6ddf690e4b911de149aea3d5eebf | refs/heads/master | 2022-12-23T07:30:26.894879 | 2020-10-02T14:08:52 | 2020-10-02T14:08:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,195 | c | /*!
* \file
* \brief Eink290Inch Click example
*
* # Description
* This application write a text and draw an image on eINK display.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Driver initialization - basic procedure for starting e-ink display.
* Start the display settings and select communication, write LUT table.
* Print text to the display by changing font size
*
* ## Application Task
* Drawing an image to the display every 1 second.
*
* *note:*
* - Create Image:
* Save the image in resolution of 128x296 px with the extension (monochrome bmp) ...
* Upload the image to Image2Lcd program
* Set parameters to:
* 1. Output file type : C array
* 2. Scan Mode : Horisontal scan
* 3. Bits Pixel : monochrome
* 4. Max width and height : 128x296
* 5. Check only MSB first
* 6. Check Reverse color and adjust Normal type
* The image to be generated should contain about 5000 bytes ...
* Insert the image into the file eINK_290_display_image.h
*
* - Create Font:
* Close existing project, open a new VTFT project
* Add label and adjust text font
* Generate source code
* Copy the font from resource.c file to this project in file eINK_290_display_font.h
*
* - Create new functions:
* At the beginning of your new function, set eink290_setMemoryArea and eink290_setMemoryPointer
* Create new pixels and create a new image buffer
* Send command to write to RAM ( EINK290_CMD_WRITE_RAM )
* Forward 4736 data bytes ..
* 1. By using the eink290_sendData function (sending one by one byte)
* Finally call the eink290_updateDisplay function to see the image on the display
*
* *** Changing the LUT table can lead to loss of display performance ....
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "eink_290inch.h"
#include "eINK_290_display_image.h"
#include "eINK_290_display_font.h"
// ------------------------------------------------------------------ VARIABLES
static eink_290inch_t eink_290inch;
static log_t logger;
char demo_text[ 5 ] = { 'e', 'I', 'N', 'K' , 0 };
char demo_text1[ 8 ] = { 'D', 'i', 's', 'p', 'l', 'a', 'y', 0 };
char demo_text2[ 10 ] = { '2', '.', '9', '0', 'i', 'n', 'c', 'h', 0 };
// ------------------------------------------------------- ADDITIONAL FUNCTIONS
const uint8_t EINK290_LUT_TABLE_1[70]=
{
0xA0,0x90,0x50,0x00,0x00,0x00,0x00,
0x50,0x90,0xA0,0x00,0x00,0x00,0x00,
0xA0,0x90,0x50,0x00,0x00,0x00,0x00,
0x50,0x90,0xA0,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x0F,0x0F,0x0F,0x0F,0x02,0x10,0x10,
0x0A,0x0A,0x03,0x08,0x08,0x09,0x43,
0x07,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
eink_290inch_cfg_t cfg;
eink_290inch_font_t cfg_font;
eink_290inch_set_text_t text_set;
// Logger initialization.
LOG_MAP_USB_UART( log_cfg );
log_cfg.level = LOG_LEVEL_DEBUG;
log_cfg.baud = 9600;
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
eink_290inch_cfg_setup( &cfg );
EINK290INCH_MAP_MIKROBUS( cfg, MIKROBUS_1 );
eink_290inch_init( &eink_290inch, &cfg );
eink_290_start_config( &eink_290inch );
eink_290_set_lut( &eink_290inch, EINK290_LUT_TABLE_1, 70 );
cfg_font.p_font = &guiFont_Tahoma_18_Regular[ 0 ];
cfg_font.color = EINK290_SCREEN_COLOR_WHITE;
cfg_font.orientation = EINK290_FO_HORIZONTAL;
eink_290_set_font( &eink_290inch, &cfg_font );
text_set.n_char = 4;
text_set.text_x = 7;
text_set.text_y = 50;
eink_290_text( &eink_290inch, &demo_text[ 0 ], &text_set );
Delay_ms( 1000 );
cfg_font.p_font = &guiFont_Tahoma_10_Regular[ 0 ];
cfg_font.color = EINK290_SCREEN_COLOR_WHITE;
cfg_font.orientation = EINK290_FO_HORIZONTAL;
eink_290_set_font( &eink_290inch, &cfg_font );
text_set.n_char = 7;
text_set.text_x = 12;
text_set.text_y = 90;
eink_290_text( &eink_290inch, &demo_text1[ 0 ], &text_set );
Delay_ms( 1000 );
cfg_font.p_font = &guiFont_Tahoma_8_Regular[ 0 ];
cfg_font.color = EINK290_SCREEN_COLOR_WHITE;
cfg_font.orientation = EINK290_FO_HORIZONTAL;
eink_290_set_font( &eink_290inch, &cfg_font );
text_set.n_char = 9;
text_set.text_x = 12;
text_set.text_y = 120;
eink_290_text( &eink_290inch, &demo_text2[ 0 ], &text_set );
Delay_ms( 1000 );
}
void application_task ( void )
{
eink_290_display_image( &eink_290inch, &demoImage_light[ 0 ] );
Delay_1sec( );
eink_290_display_image( &eink_290inch, &demoImage_dark[ 0 ] );
Delay_1sec( );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END
| [
"[email protected]"
] | |
6603cc6ad9777b87c88a307f713c2cff9c164ce7 | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/3ef7f59f-c1f8-4512-a102-129b3b0fe279.c | 3533ec17429d0a26dde6e6f957dd0c59d56b37e0 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 588 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=0;
int j=14;
int k;
int l;
k = 53;
l = 64;
k = i-j;
l = i-j;
l = l/j;
l = l%j;
l = i+j;
k = l-k*i;
//variables
/* START VULNERABILITY */
int a;
char b[60];
char c[67];
a = 0;
do {
//random
/* START BUFFER SET */
*((char *)c + a) = *((char *)b + a);
/* END BUFFER SET */
//random
a++;
} while(b[a] != 0);
/* END VULNERABILITY */
//random
printf("%d%d\n",k,l);
return 0;
}
| [
"[email protected]"
] | |
c5c513f1d2d934443d2a77d1b90404dadf9292ec | 2e1200fcec94ea57ffb925ee7f35d21bc4a6443e | /trunk-nxt/src/rdpartyrobotcdr-3.2.1/lego-temp-test2.c | be61dc1de6e19f8ed4fdbb216e42a26ad41221a9 | [] | no_license | cho934/pm-robotix | acc1eaa80069cce297ee52e08961bfdc04110f5a | e88fcfc3d636b428d88797ed612c2461bce58f1b | refs/heads/master | 2021-01-20T04:32:23.610337 | 2015-06-05T20:28:08 | 2015-06-05T20:28:08 | 39,189,107 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,316 | c | #pragma config(Sensor, S1, LEGOTMP, sensorI2CCustom)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/**
* lego-temp.h provides an API for the Lego Temperature Sensor. This program
* demonstrates how to use that API to use the sensor in single-shot mode.
*
* Changelog:
* - 0.1: Initial release
*
* Credits:
* - Big thanks to Sylvain Cacheux for writing the initial drivers.
*
* License: You may use this code as you wish, provided you give credit where it's due.
*
* THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.55 beta 2 AND HIGHER.
* Xander Soldaat (xander_at_botbench.com)
* 16 february 2010
* version 0.1
*/
#include "drivers/lego-temp.h"
// Small function to convert the accuracy level into something humans can read
void accuracyToString(tLEGOTMPAccuracy _accuracy, string &text) {
strcpy(text, "");
switch (_accuracy) {
case A_MIN:
text = "A_MIN";
break;
case A_MEAN1:
text = "A_MEAN1";
break;
case A_MEAN2:
text = "A_MEAN2";
break;
case A_MAX:
text = "A_MAX";
break;
}
}
task main() {
float temp;
tLEGOTMPAccuracy accuracy;
string strAcc;
nxtDisplayCenteredTextLine(0, "LEGO");
nxtDisplayCenteredBigTextLine(1, "Temp");
nxtDisplayCenteredTextLine(3, "Test 1");
nxtDisplayCenteredTextLine(5, "Connect sensor");
nxtDisplayCenteredTextLine(6, "to S1");
wait1Msec(2000);
eraseDisplay();
// Setup the sensor for Single shot mode
LEGOTMPsetSingleShot(LEGOTMP);
//setting minimum accuracy
accuracy = A_MIN;
if (!LEGOTMPsetAccuracy(LEGOTMP, accuracy)) {
nxtDisplayTextLine(0, "Error setAccuracy");
wait1Msec(5000);
StopAllTasks();
}
//reads the current accuracy of the sensor
if (!LEGOTMPreadAccuracy(LEGOTMP, accuracy)) {
nxtDisplayTextLine(0, "Error readAccuracy");
wait1Msec(5000);
StopAllTasks();
}
accuracyToString(accuracy, strAcc);
nxtDisplayTextLine(0, "Accuracy: %s", strAcc);
//loop to read temp
while (true) {
switch(nNxtButtonPressed) {
// If the left button is pressed, decrease the accuracy
case kLeftButton:
switch(accuracy) {
case A_MIN: accuracy = A_MAX; break;
case A_MEAN1: accuracy = A_MIN; break;
case A_MEAN2: accuracy = A_MEAN1; break;
case A_MAX: accuracy = A_MEAN2; break;
}
if (!LEGOTMPsetAccuracy(LEGOTMP, accuracy)) {
nxtDisplayTextLine(0, "Error setAccuracy");
wait1Msec(5000);
StopAllTasks();
}
accuracyToString(accuracy, strAcc);
nxtDisplayTextLine(0, "Accuracy: %s", strAcc);
// debounce the button
while (nNxtButtonPressed != kNoButton) EndTimeSlice();
break;
// If the right button is pressed, increase the accuracy
case kRightButton:
switch(accuracy) {
case A_MIN: accuracy = A_MEAN1; break;
case A_MEAN1: accuracy = A_MEAN2; break;
case A_MEAN2: accuracy = A_MAX; break;
case A_MAX: accuracy = A_MIN; break;
}
if (!LEGOTMPsetAccuracy(LEGOTMP, accuracy)) {
nxtDisplayTextLine(0, "Error setAccuracy");
wait1Msec(5000);
StopAllTasks();
}
accuracyToString(accuracy, strAcc);
nxtDisplayTextLine(0, "Accuracy: %s", strAcc);
// debounce the button
while (nNxtButtonPressed != kNoButton) EndTimeSlice();
break;
}
if (!LEGOTMPreadTemp(LEGOTMP, temp)) {
eraseDisplay();
nxtDisplayTextLine(0, "Temp reading pb");
wait10Msec(100);
StopAllTasks();
}
nxtDisplayCenteredBigTextLine(2, "Temp:");
// Depending on the level of accuracy, you need to change the
// the formatting of the float, makes it look nicer.
switch(accuracy) {
case A_MIN: nxtDisplayCenteredBigTextLine(4, "%4.1f", temp); break;
case A_MEAN1: nxtDisplayCenteredBigTextLine(4, "%5.2f", temp); break;
case A_MEAN2: nxtDisplayCenteredBigTextLine(4, "%6.3f", temp); break;
case A_MAX: nxtDisplayCenteredBigTextLine(4, "%7.4f", temp); break;
}
}
}
| [
"[email protected]"
] | |
124311b3a3fece5af95d2045a40e23a5a511f705 | db244954c9b3affb6f6f7218e0a0e0a6e19a485f | /linux/C/day11/06str.c | 0b301b8fe9b0830b3def0e201083831f97c51f5d | [] | no_license | chlinwei/linwei | ef4a2030867dc32e96fb4b132da40b4c314ca5e2 | 6f177e9328bf716bd82942dc8d6ba79e512e312d | refs/heads/master | 2022-03-02T22:28:37.714458 | 2022-02-17T02:07:52 | 2022-02-17T02:07:52 | 77,869,869 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 386 | c | /*
字符串练习
*/
#include <stdio.h>
#include <string.h>
int main() {
int rank = 0;
char ranks[50] = {0};
char tmp[10] = {0};
do {
printf("请输入一个考试成绩:");
scanf("%d", &rank);
if (rank < 0) {
break;
}
sprintf(tmp, "%d,", rank);
strcat(ranks, tmp);
} while (1);
ranks[strlen(ranks) - 1] = 0;
printf("%s\n", ranks);
return 0;
}
| [
"[email protected]"
] | |
53a838c24a9a3f22e5f7a567ef931dd550cadc1b | de8c0ea84980b6d9bb6e3e23b87e6066a65f4995 | /3pp/linux/arch/parisc/math-emu/hppa.h | b25b266c998694d6b7e17fc46700adb448d715cd | [
"LicenseRef-scancode-free-unknown",
"MIT",
"Linux-syscall-note",
"GPL-2.0-only"
] | permissive | eerimoq/monolinux-example-project | 7cc19c6fc179a6d1fd3ec60f383f906b727e6715 | 57c4c2928b11cc04db59fb5ced962762099a9895 | refs/heads/master | 2021-02-08T10:57:58.215466 | 2020-07-02T08:04:25 | 2020-07-02T08:04:25 | 244,144,570 | 6 | 0 | MIT | 2020-07-02T08:15:50 | 2020-03-01T12:24:47 | C | UTF-8 | C | false | false | 1,098 | h | /* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Linux/PA-RISC Project (http://www.parisc-linux.org/)
*
* Floating-point emulation code
* Copyright (C) 2001 Hewlett-Packard (Paul Bame) <[email protected]>
*/
#ifdef __NO_PA_HDRS
PA header file -- do not include this header file for non-PA builds.
#endif
/* amount is assumed to be a constant between 0 and 32 (non-inclusive) */
#define Shiftdouble(left,right,amount,dest) \
/* int left, right, amount, dest; */ \
dest = ((left) << (32-(amount))) | ((unsigned int)(right) >> (amount))
/* amount must be less than 32 */
#define Variableshiftdouble(left,right,amount,dest) \
/* unsigned int left, right; int amount, dest; */ \
if (amount == 0) dest = right; \
else dest = ((((unsigned) left)&0x7fffffff) << (32-(amount))) | \
((unsigned) right >> (amount))
/* amount must be between 0 and 32 (non-inclusive) */
#define Variable_shift_double(left,right,amount,dest) \
/* unsigned int left, right; int amount, dest; */ \
dest = (left << (32-(amount))) | ((unsigned) right >> (amount))
| [
"[email protected]"
] | |
075dd95ee6914a04f431a01380bcf1412ba7d7b8 | 5eba39fa53189f3c334df06cc6487ec01eae679b | /Programas C/SEQUEN1.C | 2cec763c0862671452ab08f10cd30d32f00a93a5 | [] | no_license | marcosinocencio/C | df938c268b954f6aca58fb64912ca521df3a4701 | 3d984929fca92e8d1348103fe2cbf7e1b2abde96 | refs/heads/main | 2023-01-10T01:09:47.486097 | 2020-11-03T19:02:53 | 2020-11-03T19:02:53 | 309,781,568 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,483 | c | #include <stdio.h>
#include <stdlib.h>
#define MSG1 "Introduza o numero de termos da sequencia : "
#define MSG2 "Introduza o %d-esimo termo da sequencia : "
#define MSG4 "\n\nPor favor, introduza um numero MAIOR OU IGUAL a 1"
#define MSG5 "\nPressione uma tecla para continuar!!!! "
#define MSG6 "\n\n\n Pressione a tecla 's' ou 'S' para executar o programa novamente ou "
#define MSG7 "\nqualquer outra tecla para finalizar. "
int sp = 0, sn = 0, qp = 0, qn = 0, i = 1, n, num;
int continua = 1;
char ch;
int main(void) {
do
{
do {
system("cls");
printf(MSG1);
scanf("%d", &n);
if ( n < 1 ) {
printf(MSG4);
printf("\n\n");
system("Pause");
}
} while (n < 1);
sp = sn = qp = qn = 0; i = 1;
for ( ;i <= n; i++) {
printf("\n");
printf(MSG2, i);
scanf("%d", &num);
if ( num >= 0 ) { sp += num; qp++;}
else { sn += num; qn++; }
} // for
printf("\nA soma dos numeros positivos e igual a %d",sp);
printf("\nA quantidade de termos positivos e igual a %d",qp);
printf("\n\nA soma dos numeros negativos e igual a %d",sn);
printf("\nA quantidade de termos negativos e igual a %d",qn);
printf(MSG6); printf(MSG7);
fflush(stdin); // esvaziando o buffer de entrada associado ao teclado
ch = getchar();
if ( (ch == 's') || (ch == 'S') ) continua = 1;
else continua = 0;
}
while ( continua ); // do-while mais externo
printf("\n\n\n");
system("Pause");
return(0);
}
| [
"[email protected]"
] | |
68af7a6f1a41a67acbf4dbcc1d9d8c5c4545567c | 8548ed308e5022fa7b602f87a342746e675d485a | /Code/Drivers/Motors.h | fdb813e0945a976ddd1fbe827e01155aa21d9eff | [] | no_license | fnafnio/explorerbot | 5acffdaace887691066cfcc13de293aca0d68e52 | 4fe161157c8d7aa56fba8ddd804f4fb3ec0fdade | refs/heads/master | 2021-05-29T03:51:21.567595 | 2013-06-27T17:51:03 | 2013-06-27T17:51:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,776 | h | /*
Bluetooth Robot
Copyright (C) Dean Camera, 2011.
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
*
* Header file for Motors.c.
*/
#ifndef _MOTORS_H_
#define _MOTORS_H_
/* Includes: */
#include <avr/io.h>
#include <avr/interrupt.h>
#include <stdbool.h>
#include <stdlib.h>
#include <LUFA/Common/Common.h>
/* Macros: */
/** Sets the maximum motor PWM value which may be set. Motor power values above this absolute value will
* be clamped to this value instead.
*/
#define MAX_MOTOR_POWER 0x0EEE
/* Function Prototypes: */
void Motors_Init(void);
void Motors_SetChannelSpeed(const int16_t LeftPower, const int16_t RightPower);
#endif
| [
"[email protected]"
] | |
77b2eb637cb5ea8fcc90340254f314c2b2045b00 | 1456438321efcb4e8998a373ea0ded11740c9fdb | /formattedInput.c | 1df0c80d7d25e751687aada8a4477b29c5039f48 | [] | no_license | cathyatseneca/ipc144mm-f15 | 30007919fc80e46da4723f011e8519da26251af7 | 9db76ceefcc8a59232c695b688eb1f5f022234b0 | refs/heads/master | 2021-01-19T11:09:55.245892 | 2015-12-01T16:26:52 | 2015-12-01T16:26:52 | 42,190,001 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 399 | c | #include <stdio.h>
/*this function validates user input*/
int validateInput(const char* prompt){
int input;
int rc;
//print prompt:
printf("%s", prompt);
rc=scanf("%d",&input);
if(rc == 1){
printf("input was an integer!\n");
}
else{
printf("input was bad\n");
}
return input;
}
int main(void){
int input = validateInput("Enter total sought: ");
printf("input is: %d\n",input);
} | [
"[email protected]"
] | |
20196cbda40929b071527275958a4ac750fd4d35 | 216f5252a8df73f8547d6a6c831409c916bae3e5 | /windows_embedded_compact_2013_2015M09/WINCE800/private/winceos/COREOS/core/corelibc/crtw32/stdcpp/xstoul.c | c4b96c88e9a711856f6811ebd5643313db3a86c6 | [] | no_license | fanzcsoft/windows_embedded_compact_2013_2015M09 | 845fe834d84d3f0021047bc73d6cf9a75fabb74d | d04b71c517428ed2c73e94caf21a1582b34b18e3 | refs/heads/master | 2022-12-19T02:52:16.222712 | 2020-09-28T20:13:09 | 2020-09-28T20:13:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,688 | c | //
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft shared
// source or premium shared source license agreement under which you licensed
// this source code. If you did not accept the terms of the license agreement,
// you are not authorized to use this source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the SOURCE.RTF on your install media or the root of your tools installation.
// THE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/* _Stoul function */
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include "xmath.h"
#pragma warning(disable: 4701)
#if (ULONG_MAX >> 16) >> 16 != 0xffffffff && ULONG_MAX != 0xffffffff
#error LONGS TOO LARGE FOR _Stoul
#endif /* longs too large */
_C_STD_BEGIN
/* macros */
#define BASE_MAX 36 /* largest valid base */
/* static data */
static const char digits[] = /* valid digits */
"0123456789abcdefghijklmnopqrstuvwxyz";
#if (ULONG_MAX >> 16) >> 16 == 0xffffffff
static const char ndigs[BASE_MAX + 1] = { /* 64-bits! */
0, 0, 65, 41, 33, 28, 25, 23, 22, 21,
20, 19, 18, 18, 17, 17, 17, 16, 16, 16,
15, 15, 15, 15, 14, 14, 14, 14, 14, 14,
14, 13, 13, 13, 13, 13, 13,};
#else /* (ULONG_MAX >> 16) >> 16 == 0xffffffff */
static const char ndigs[BASE_MAX+1] = { /* 32-bits! */
0, 0, 33, 21, 17, 14, 13, 12, 11, 11,
10, 10, 9, 9, 9, 9, 9, 8, 8, 8,
8, 8, 8, 8, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7,};
#endif /* (ULONG_MAX >> 16) >> 16 == 0xffffffff */
#if defined(__cplusplus) && !defined(MRTDLL)
extern "C"
#endif
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char *s, char **endptr,
int base, int *perr)
{ /* convert string to unsigned long, with checking */
const char *sc, *sd;
const char *s1, *s2;
char dig, sign;
ptrdiff_t n;
unsigned long x, y;
if (perr != 0)
*perr = 0;
for (sc = s; isspace((unsigned char)*sc); ++sc)
;
sign = *sc == '-' || *sc == '+' ? *sc++ : '+';
if (base < 0 || base == 1 || BASE_MAX < base)
{ /* silly base */
if (endptr != 0)
*endptr = (char *)s;
return (0);
}
else if (0 < base)
{ /* strip 0x or 0X */
if (base == 16 && *sc == '0'
&& (sc[1] == 'x' || sc[1] == 'X'))
sc += 2;
}
else if (*sc != '0')
base = 10;
else if (sc[1] == 'x' || sc[1] == 'X')
base = 16, sc += 2;
else
base = 8;
for (s1 = sc; *sc == '0'; ++sc)
; /* skip leading zeros */
x = 0;
for (s2 = sc, y = 0; (sd = (char *)memchr(&digits[0],
tolower(*sc), base)) != 0; ++sc)
{ /* accumulate digits */
y = x;
dig = (char)(sd - digits); /* for overflow checking */
x = x * base + dig;
}
if (s1 == sc)
{ /* check string validity */
if (endptr != 0)
*endptr = (char *)s;
return (0);
}
n = sc - s2 - ndigs[base];
if (n < 0)
;
else if (0 < n || x < x - dig || (x - dig) / base != y)
{ /* overflow */
errno = ERANGE;
if (perr != 0)
*perr = 1;
x = ULONG_MAX, sign = '+';
}
if (sign == '-') /* get final value */
x = 0 - x;
if (endptr != 0)
*endptr = (char *)sc;
return (x);
}
_CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoul(const char *s, char **endptr, int base)
{ /* convert string, discard error code */
return (_Stoulx(s, endptr, base, 0));
}
_C_STD_END
/*
* Copyright (c) 1992-2006 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
V5.02:0009 */
| [
"[email protected]"
] | |
12b1e23680b91fe0e3fff422a403c65ac2682969 | 07db481e38bb48a7f9323ae5dcdb8e4d82397a93 | /LAB 4/Laborator4/Laborator4/P5_modificat_P1.c | 4e92dfc1d9ebde32114d11928dcb0045dd6bbc2b | [] | no_license | stefana-matei/TP | 0b2618dbbb43fd1232843babab30b464384b6dd2 | 3552f5273bfad81745772b38a8626178344ead1e | refs/heads/master | 2022-04-18T21:26:24.944862 | 2020-04-14T19:08:12 | 2020-04-14T19:08:12 | 255,645,824 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,430 | c | /*Sa se modifice P1 astfel incat la adaugarea unui produs, daca numele respectiv exista deja in baza de date,
acesta sa nu mai fie adaugat ci sa fie schimbat pretul vechi cu cel nou introdus.*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
typedef struct {
char nume[50];
float pret;
} produse;
int produs_deja_existent(char produs[50], produse *stock, int n)
{
int i;
for (i = 0; i < n; i++) {
if (strcmp(stock[i].nume, produs) == 0) {
return i;
}
}
return -1;
}
int main()
{
produse prds[100];
int i,optiune, n = 0,index;
char nume_produs[50];
while (1) {
printf("1.Adaugare ");
printf("\n2.Afisare ");
printf("\n0.Iesire \n\n");
printf(" Optiunea dvs : ");
scanf("%d", &optiune);
printf("\n");
switch (optiune) {
case 1:
getchar();
printf("Nume : ");
gets(nume_produs);
index = produs_deja_existent(nume_produs, prds, n);
if (index >= 0) {
printf("Produsul este deja in baza de date!\n");
printf("Noul pret: ");
scanf("%g", &prds[index].pret);
n--;
}
else {
strcpy(prds[n].nume, nume_produs);
printf("Pret: ");
scanf("%g", &prds[n].pret);
}
n++;
printf("\n");
break;
case 2:
for (i = 0; i < n; i++) {
printf("%s %g\n", prds[i].nume, prds[i].pret);
}
break;
case 0: exit(0);
break;
default:
printf("\Optiunea nu exista!\n");
break;
}
}
system("pause");
return 0;
} | [
"[email protected]"
] | |
2c0652f3ad983f6f030945850765bba198221d8b | 080e032c83647b35804b8db9149330fc5ff8c733 | /0x07-pointers_arrays_strings/5-strstr.c | cb83ec7b1e660606ad7ae733865677e71656dfb6 | [] | no_license | JSalmen13/holbertonschool-low_level_programming | 505fca556b2ff34780b584405e0e718d1d62723a | d9a52883c84fa78dab2def82affbc1a2995a11b6 | refs/heads/master | 2023-06-02T02:27:28.050291 | 2021-06-22T11:58:20 | 2021-06-22T11:58:20 | 271,232,949 | 0 | 2 | null | null | null | null | UTF-8 | C | false | false | 515 | c | #include "holberton.h"
#include <stdio.h>
/**
* _strstr - find occurence
* @haystack: str 1
* @needle: str 2
* Return: occurance
*/
char *_strstr(char *haystack, char *needle)
{
int i, j, k;
j = 0;
if (needle[0] == '\0')
return (haystack);
for (k = 0; needle[k]; k++)
;
for (i = 0; haystack[i]; i++)
{
if (needle[0] == haystack[i])
{
for (j = 0; needle[j]; j++)
{
if (needle[j] != haystack[i + j])
{
break;
}
}
}
if (j == k)
return (&haystack[i]);
}
return (0);
}
| [
"[email protected]"
] | |
a49fb32d2aa5c80c41d8d8400291f07eae0ac4e5 | 54fad01b6a7bcd03ae081f9127b34399fb2d21bd | /Microchip/TCPIP-BSD/netpkt.h | 5fa6c18efc64ded992fe232c7dbff4962e52aeae | [] | no_license | douglaskatz/PIC32-Mass-Storage | 442a227469945f83d55bd9fc65fede2046b9d1b4 | fdcf4dfefae66f0b9ce41e792419c90bb4f1d833 | refs/heads/master | 2020-12-07T10:45:41.028028 | 2016-12-14T19:18:25 | 2016-12-14T19:18:25 | 73,502,321 | 2 | 0 | null | null | null | null | WINDOWS-1252 | C | false | false | 5,027 | h | /*********************************************************************
*
* Packet Buffer Header File
*
*********************************************************************
* FileName: NetPkt.h
* Description: internal packet buffer definition
* Company: Microchip Technology, Inc.
*
* Software License Agreement
*
* The software supplied herewith by Microchip Technology Incorporated
* (the “Company”) for its PICmicro® Microcontroller is intended and
* supplied to you, the Company’s customer, for use solely and
* exclusively on Microchip PICmicro Microcontroller products. The
* software is owned by the Company and/or its supplier, and is
* protected under applicable copyright laws. All rights are reserved.
* Any use in violation of the foregoing restrictions may subject the
* user to criminal sanctions under applicable laws, as well as to
* civil liability for the breach of the terms and conditions of this
* license.
*
* THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
* WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
* TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
*
* $Id: NetPkt.h,v 1.4 2006/10/24 16:39:06 C12923 Exp $
*
*/
#ifndef __NET_PKT_H__
#define __NET_PKT_H__
typedef enum
{
// packet queueing masks
ARP_QUE_MASK = 0x01, // packet part of the ARP queue
MACTX_QUE_MASK = 0x02, // part of MAC TX queue
CNXN_QUE_MASK = 0x04, // part of Conexion queue
RXMSG_QUE_MASK = 0x08, // part of RX message queue
//
PKT_QUEUES_MASK = (ARP_QUE_MASK|MACTX_QUE_MASK|CNXN_QUE_MASK|RXMSG_QUE_MASK), // any queue mask
// rx/tx packet flags
PKT_FLAG_RX = 0x10, // it's an Rx packet
PKT_FLAG_TX = 0x20, // it's an TX packet
PKT_TX_AUTO_DEALLOC = 0x40, // TX packet can perform auto de-allocate after transfer
PKT_FLAG_ZC_ALLOC = 0x80 // zero copy allocation needed
// flags that are not stored in the buffer
// used for allocation type
}NET_PKT_FLAGS; // net packet flags
typedef enum
{
BUFF_MGR_ALLOC = 0x01, // packet/buffer allocated by the stack manager, not by the user
BUFF_ZC_ALLOC = 0x02, // buffer part of a zero copy operation:
// for TX: a user supplied buffer
// for RX: a buffer that was supplied to the Eth Controller and is sticky
BUFF_ZC_WACK = 0x04, // ZC buffer waitig for the RX acknowledge
//
}NET_PKT_BUFF_FLAGS; // packet/buffer flags
typedef struct
{
sBuffDcpt bDcpt;
short int bFlags; // NET_PKT_BUFF_FLAGS value
} __attribute__ ((__packed__)) pktMgrDcpt; // a packet manager descriptor
typedef struct NetPacket
{
struct NetPacket *pNext;
BYTE* pTransportLayer;
BYTE* pNetworkLayer;
#ifdef _STACK_USE_ZC
pktMgrDcpt PktDcpt[2]; // - for TX:
// if ZC is not supported/requested
// NET_PKT is allocated to contain the whole packet
// the 1st buffer descriptor pBuff=NET_PKT.pPktLoad, nBytes=PktLen;
// the 2nd buffer descriptor pBuff=0, nBytes=0;
// else (ZC)
// NET_PKT is allocated to contain the headers (ETH, IP, UDP/TCP)
// the 1st buffer descriptor pBuff=NET_PKT.pPktLoad, nBytes=headerLen;
// the 2nd buffer descriptor pBuff=pUsrBuffer, nBytes=loadLen;
// - for RX:
// if ZC is not supported/requested or the received packet is split across
// multiple buffers (depending on size of RX buffers)
// NET_PKT is allocated to contain the whole packet
// the 1st buffer descriptor pBuff=NET_PKT.pPktLoad, nBytes=PktLen;
// the 2nd buffer descriptor pBuff=0, nBytes=0;
// else (ZC && contiguous buffer)
// NET_PKT is allocated to contain just the NET_PKT itself, with no data
// the 1st buffer descriptor pBuff=0 and nBytes=0
// the 2nd buffer descriptor pBuff=the pointer to the Ethernet RX buffer, nBytes=pkt size
pzSendAckF buffXmitAck; // the TX acknowledge call back function
#else
pktMgrDcpt PktDcpt[1]; // - for TX: everything in one large buffer. User buffer is copied here
// - for RX: one large buffer. Whole packet copied here
#endif // _STACK_USE_ZC
struct NetPacket *pTcpNext;
struct MCSocket * pOwnerSocket;
DWORD TCPACKNum;
TICK TimeStamp; //Time when rcvd or queued for xmit
TICK ARPTickStart;
WORD PktLen;
BYTE PktType; // valid only for Rx Packets
BYTE PktFlags; // a NET_PKT_FLAGS value
//real packet data
//DO NOT ADD FIELDS BELOW THIS LINE
#ifdef _STACK_USE_ZC
struct NetPacket *pOwner; // owner of the RX buffer
#endif
DWORD pPktLoad[0];
}NET_PKT;
#endif
| [
"[email protected]"
] | |
25f48baa4f6700c962728c7e99bbc4e7912e22b4 | 8924feaa69b4820078352044d860a94960b93e32 | /src/04_FILE_DIR/ftw8.c | 0c136b8f91a5fd34da7072ddd11b26e27785909f | [] | no_license | JmyTest/apue | e8fc92724a28fa9a82eaf8941f598acb68cdc860 | 93986e68449b831b48d55749871a75997ef3ab6a | refs/heads/master | 2022-04-19T02:02:18.127018 | 2020-04-15T16:28:10 | 2020-04-15T16:28:10 | 259,927,599 | 1 | 0 | null | 2020-04-29T13:06:37 | 2020-04-29T13:06:36 | null | UTF-8 | C | false | false | 4,530 | c | /**
* @file 测试DIR相关
*
* apue示例程序 - ftw8.c
*
* @author Steve & r00tk1t
*
*/
#include "apue.h"
#include <dirent.h>
#include <limits.h>
#include <sys/stat.h>
/* function type that is called for each filename */
typedef int Myfunc(const char *, const struct stat *, int);
static Myfunc myfunc;
static int myftw(char *, Myfunc *);
static int dopath(Myfunc *);
static long nreg, ndir, nblk, nchr, nfifo, nslink, nsock, ntot;
int main(int argc, char *argv[])
{
int ret;
if (argc != 2)
err_quit("usage: ftw <starting-pathname>");
ret = myftw(argv[1], myfunc); /* does it all */
ntot = nreg + ndir + nblk + nchr + nfifo + nslink + nsock;
if (ntot == 0)
ntot = 1; /* avoid divide by 0; print 0 for all counts */
printf("regular files = %7ld, %5.2f %%\n", nreg,
nreg*100.0/ntot);
printf("directories = %7ld, %5.2f %%\n", ndir,
ndir*100.0/ntot);
printf("block special = %7ld, %5.2f %%\n", nblk,
nblk*100.0/ntot);
printf("char special = %7ld, %5.2f %%\n", nchr,
nchr*100.0/ntot);
printf("FIFOs = %7ld, %5.2f %%\n", nfifo,
nfifo*100.0/ntot);
printf("symbolic links = %7ld, %5.2f %%\n", nslink,
nslink*100.0/ntot);
printf("sockets = %7ld, %5.2f %%\n", nsock,
nsock*100.0/ntot);
exit(ret);
}
/*
* Descend through the hierarchy, starting at "pathname".
* The caller's func() is called for every file.
*/
#define FTW_F 1 /* file other than directory */
#define FTW_D 2 /* directory */
#define FTW_DNR 3 /* directory that can't be read */
#define FTW_NS 4 /* file that we can't stat */
static char *fullpath; /* contains full pathname for every file */
static size_t pathlen;
static int /* we return whatever func() returns */
myftw(char *pathname, Myfunc *func)
{
fullpath = path_alloc(&pathlen); /* malloc PATH_MAX+1 bytes */
/* ({Prog pathalloc}) */
if (pathlen <= strlen(pathname)) {
pathlen = strlen(pathname) * 2;
if ((fullpath = realloc(fullpath, pathlen)) == NULL)
err_sys("realloc failed");
}
strcpy(fullpath, pathname);
return dopath(func);
}
/*
* Descend through the hierarchy, starting at "fullpath".
* If "fullpath" is anything other than a directory, we lstat() it,
* call func(), and return. For a directory, we call ourself
* recursively for each name in the directory.
*/
static int /* we return whatever func() returns */
dopath(Myfunc* func)
{
struct stat statbuf;
struct dirent *dirp;
DIR *dp;
int ret, n;
if (lstat(fullpath, &statbuf) < 0) /* stat error */
return(func(fullpath, &statbuf, FTW_NS));
if (S_ISDIR(statbuf.st_mode) == 0) /* not a directory */
return(func(fullpath, &statbuf, FTW_F));
/*
* It's a directory. First call func() for the directory,
* then process each filename in the directory.
*/
if ((ret = func(fullpath, &statbuf, FTW_D)) != 0)
return(ret);
n = strlen(fullpath);
if (n + NAME_MAX + 2 > pathlen) { /* expand path buffer */
pathlen *= 2;
if ((fullpath = realloc(fullpath, pathlen)) == NULL)
err_sys("realloc failed");
}
fullpath[n++] = '/';
fullpath[n] = 0;
if ((dp = opendir(fullpath)) == NULL) /* can't read directory */
return(func(fullpath, &statbuf, FTW_DNR));
while ((dirp = readdir(dp)) != NULL) {
if (strcmp(dirp->d_name, ".") == 0 ||
strcmp(dirp->d_name, "..") == 0)
continue; /* ignore dot and dot-dot */
strcpy(&fullpath[n], dirp->d_name); /* append name after "/" */
if ((ret = dopath(func)) != 0) /* recursive */
break; /* time to leave */
}
fullpath[n-1] = 0; /* erase everything from slash onward */
if (closedir(dp) < 0)
err_ret("can't close directory %s", fullpath);
return(ret);
}
static int
myfunc(const char *pathname, const struct stat *statptr, int type)
{
switch (type) {
case FTW_F:
switch (statptr->st_mode & S_IFMT) {
case S_IFREG: nreg++; break;
case S_IFBLK: nblk++; break;
case S_IFCHR: nchr++; break;
case S_IFIFO: nfifo++; break;
case S_IFLNK: nslink++; break;
case S_IFSOCK: nsock++; break;
case S_IFDIR: /* directories should have type = FTW_D */
err_dump("for S_IFDIR for %s", pathname);
}
break;
case FTW_D:
ndir++;
break;
case FTW_DNR:
err_ret("can't read directory %s", pathname);
break;
case FTW_NS:
err_ret("stat error for %s", pathname);
break;
default:
err_dump("unknown type %d for pathname %s", type, pathname);
}
return(0);
} | [
"[email protected]"
] | |
93f84bf7ae6981cb4d87eb0b68cc9fee1818b8af | 976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f | /source/SoftEtherVPN/src/vpntest/extr_vpntest.c_memory_leak_test.c | 05a944d2042c20c26f69b27e3621754702f08c15 | [] | no_license | isabella232/AnghaBench | 7ba90823cf8c0dd25a803d1688500eec91d1cf4e | 9a5f60cdc907a0475090eef45e5be43392c25132 | refs/heads/master | 2023-04-20T09:05:33.024569 | 2021-05-07T18:36:26 | 2021-05-07T18:36:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 688 | c | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ UINT ;
/* Variables and functions */
char* Malloc (int) ;
int /*<<< orphan*/ Print (char*) ;
void memory_leak_test(UINT num, char **arg)
{
char *a = Malloc(1);
Print("Hello, I am the great dictator of this kingdom!\n");
Print("Just now I called Malloc(1) and never free! Ha ha ha !!\n");
} | [
"[email protected]"
] | |
e6ceee7822b4ea942c012426116623d019157c9e | de6604045fb627b86b6bb03c9f99fc69ed01a954 | /pg/MATHEMATICAL/pg_degrees.c | fd55b409563c3304736a7cd124771bc09578673e | [
"MIT"
] | permissive | sfaroult/sqlite_libs | a522433a39c6352c2fcc11f6d7369face2f600f8 | c9d3937ce1756eab4c8d9dab5aede889393830e8 | refs/heads/master | 2016-09-14T08:26:24.877481 | 2016-05-18T19:42:46 | 2016-05-18T19:42:46 | 59,128,508 | 7 | 3 | null | null | null | null | UTF-8 | C | false | false | 643 | c | /*
* pg_degrees.c
*
* This program is used in SQLite and will convert a number from radians to
* degrees
*
* Input - A number in radians Output - The number in degrees
*
*/
#include <stdio.h>
#include <math.h>
#include <ksu_common.h>
/*
* Converts a number from radians to degrees.
*/
extern void pg_degrees(sqlite3_context * context,
int argc,
sqlite3_value ** argv) {
double x;
if (ksu_prm_ok(context, argc, argv, "degrees", KSU_PRM_NUMERIC)) {
x = sqlite3_value_double(argv[0]);
sqlite3_result_double(context, ((x * 180) / M_PI));
}
}
| [
"[email protected]"
] | |
b2c299747eef1171a1ab0705ed6270f945780b0d | c95a83e1a741b8c0eb810dd018d91060e5872dd8 | /libs/STLPort-4.0/stlport/stl/_threads.c | e930726c3dda0c694229c36795e9e783106aca9d | [
"LicenseRef-scancode-stlport-4.5"
] | permissive | rickyharis39/nolf2 | ba0b56e2abb076e60d97fc7a2a8ee7be4394266c | 0da0603dc961e73ac734ff365bfbfb8abb9b9b04 | refs/heads/master | 2021-01-01T17:21:00.678517 | 2011-07-23T12:11:19 | 2011-07-23T12:11:19 | 38,495,312 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,019 | c | /*
*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Copyright (c) 1997
* Moscow Center for SPARC Technology
*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
#ifndef __STL_THREADS_C
#define __STL_THREADS_C
# if defined (__BUILDING_STLPORT) || ! defined (__SGI_STL_OWN_IOSTREAMS)
__STL_BEGIN_NAMESPACE
# if ( __STL_STATIC_TEMPLATE_DATA > 0 )
# if defined (__STL_PTHREADS) || defined (__STL_UITHREADS)
template<int __dummy>
_STL_STATIC_MUTEX
_Swap_lock_struct<__dummy>::_S_swap_lock __STL_MUTEX_INITIALIZER;
# endif
template <int __inst>
unsigned _STL_mutex_spin<__inst>::__max = _STL_mutex_spin<__inst>::__low_max;
template <int __inst>
unsigned _STL_mutex_spin<__inst>::__last = 0;
# else /* ( __STL_STATIC_TEMPLATE_DATA > 0 ) */
# if defined (__STL_PTHREADS) || defined (__STL_UITHREADS)
__DECLARE_INSTANCE(_STL_STATIC_MUTEX, _Swap_lock_struct<0>::_S_swap_lock,
__STL_MUTEX_INITIALIZER );
# endif /* __STL_PTHREADS */
__DECLARE_INSTANCE(unsigned, _STL_mutex_spin<0>::__max, =30);
__DECLARE_INSTANCE(unsigned, _STL_mutex_spin<0>::__last, =0);
# endif /* ( __STL_STATIC_TEMPLATE_DATA > 0 ) */
#if defined(__STL_SGI_THREADS) || defined(__STL_WIN32THREADS)
template <int __inst>
void __STL_CALL
_STL_mutex_spin<__inst>::_S_nsec_sleep(int __log_nsec) {
# ifdef __STL_SGI_THREADS
struct timespec __ts;
/* Max sleep is 2**27nsec ~ 60msec */
__ts.tv_sec = 0;
__ts.tv_nsec = 1 << __log_nsec;
nanosleep(&__ts, 0);
# elif defined(__STL_WIN32THREADS)
if (__log_nsec <= 20) {
Sleep(0);
} else {
Sleep(1 << (__log_nsec - 20));
}
# else
# error unimplemented
# endif
}
template <int __inst>
void __STL_CALL
_STL_mutex_spin<__inst>::_M_do_lock(volatile unsigned long* __lock)
{
#if defined(__STL_SGI_THREADS) || defined(__STL_WIN32THREADS)
if (_Atomic_swap((unsigned long*)__lock, 1)) {
unsigned __my_spin_max = _STL_mutex_spin<0>::__max;
unsigned __my_last_spins = _STL_mutex_spin<0>::__last;
volatile unsigned __junk = 17; // Value doesn't matter.
unsigned __i;
for (__i = 0; __i < __my_spin_max; ++__i) {
if (__i < __my_last_spins/2 || *__lock) {
__junk *= __junk; __junk *= __junk;
__junk *= __junk; __junk *= __junk;
} else {
if (!_Atomic_swap((unsigned long*)__lock, 1)) {
// got it!
// Spinning worked. Thus we're probably not being scheduled
// against the other process with which we were contending.
// Thus it makes sense to spin longer the next time.
_STL_mutex_spin<0>::__last = __i;
_STL_mutex_spin<0>::__max = _STL_mutex_spin<0>::__high_max;
return;
}
}
}
// We are probably being scheduled against the other process. Sleep.
_STL_mutex_spin<0>::__max = _STL_mutex_spin<0>::__low_max;
for (__i = 0 ;; ++__i) {
int __log_nsec = __i + 6;
if (__log_nsec > 27) __log_nsec = 27;
if (!_Atomic_swap((unsigned long *)__lock, 1)) {
break;
}
_S_nsec_sleep(__log_nsec);
}
} /* first _Atomic_swap */
# endif
}
# endif /* if SGI or WIN */
__STL_END_NAMESPACE
# endif /* BUILDING_STLPORT */
#endif /* __STL_THREADS_C */
// Local Variables:
// mode:C++
// End:
| [
"[email protected]"
] | |
1206ab3f7db33a292315f31fc8cfaf33ff065518 | 43369807c33c0643b07033d9d4e200debe302862 | /eve_server/sample/EIFGENs/sample/W_code/C12/ty389d.c | 44b0c766c38058382973463ff44435bb385e484a | [] | no_license | jvelilla/Eiffel_Web_Server | 8ebcc06b3d81ea1bf4bba9a557ad5b753db6d0c6 | d194d75ff2322a0e195a2d23aa063943660bce75 | refs/heads/master | 2020-06-01T20:16:17.066391 | 2014-06-27T11:41:14 | 2014-06-27T11:41:14 | 21,387,371 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,116 | c | /*
* Class reference TYPED_POINTER [POINTER]
*/
#include "eif_macros.h"
#ifdef __cplusplus
extern "C" {
#endif
static EIF_TYPE_INDEX gen_type0_389 [] = {0xFF11,170,0xFFFF};
static EIF_TYPE_INDEX gen_type1_389 [] = {0xFF11,180,388,160,0xFFFF};
static EIF_TYPE_INDEX gen_type2_389 [] = {0xFF11,388,160,0xFFFF};
static EIF_TYPE_INDEX gen_type3_389 [] = {0,0xFFFF};
static EIF_TYPE_INDEX gen_type4_389 [] = {0,0xFFFF};
static EIF_TYPE_INDEX gen_type5_389 [] = {0xFF11,388,160,0xFFFF};
static EIF_TYPE_INDEX gen_type6_389 [] = {0xFF11,388,160,0xFFFF};
static EIF_TYPE_INDEX gen_type7_389 [] = {0,0xFFFF};
static EIF_TYPE_INDEX gen_type8_389 [] = {0xFF11,11,0xFFFF};
static EIF_TYPE_INDEX gen_type9_389 [] = {0xFF11,170,0xFFFF};
static EIF_TYPE_INDEX gen_type10_389 [] = {0xFF11,170,0xFFFF};
static EIF_TYPE_INDEX gen_type11_389 [] = {0xFF11,10,0xFFFF};
static EIF_TYPE_INDEX gen_type12_389 [] = {0xFF11,388,160,0xFFFF};
static EIF_TYPE_INDEX gen_type13_389 [] = {0xFF11,388,160,0xFFFF};
static EIF_TYPE_INDEX gen_type14_389 [] = {0xFF11,159,0xFFFF};
static EIF_TYPE_INDEX gen_type15_389 [] = {0xFFF8,1,0xFFFF};
static struct desc_info desc_389[] = {
{(BODY_INDEX) -1, (BODY_INDEX) -1, INVALID_DTYPE, NULL},
{0, (BODY_INDEX)-1, 170, gen_type0_389},
{1, (BODY_INDEX)-1, 180, gen_type1_389},
{2, (BODY_INDEX)-1, 154, NULL},
{3, (BODY_INDEX)-1, 154, NULL},
{8767, (BODY_INDEX)-1, 154, NULL},
{5, (BODY_INDEX)-1, 154, NULL},
{6, (BODY_INDEX)-1, 154, NULL},
{7, (BODY_INDEX)-1, 154, NULL},
{8, (BODY_INDEX)-1, 154, NULL},
{9, (BODY_INDEX)-1, 154, NULL},
{10, (BODY_INDEX)-1, 388, gen_type2_389},
{11, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{12, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{13, (BODY_INDEX)-1, 0, gen_type3_389},
{14, (BODY_INDEX)-1, 0, gen_type4_389},
{15, (BODY_INDEX)-1, 388, gen_type5_389},
{16, (BODY_INDEX)-1, 388, gen_type6_389},
{17, (BODY_INDEX)-1, 0, gen_type7_389},
{18, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{19, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{20, (BODY_INDEX)-1, 11, gen_type8_389},
{8782, (BODY_INDEX)-1, 170, gen_type9_389},
{22, (BODY_INDEX)-1, 170, gen_type10_389},
{23, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{24, (BODY_INDEX)-1, 10, gen_type11_389},
{25, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{26, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{27, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{28, (BODY_INDEX)-1, 388, gen_type12_389},
{29, (BODY_INDEX)-1, 160, NULL},
{30, (BODY_INDEX)-1, 388, gen_type13_389},
{31, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{32, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{549, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{550, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{551, (BODY_INDEX)-1, 154, NULL},
{8765, (BODY_INDEX)-1, 121, NULL},
{8768, (BODY_INDEX)-1, 154, NULL},
{8764, 0, 160, NULL},
{8766, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8769, (BODY_INDEX)-1, 154, NULL},
{8770, (BODY_INDEX)-1, 160, NULL},
{8771, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8772, (BODY_INDEX)-1, 159, gen_type14_389},
{8773, (BODY_INDEX)-1, 121, NULL},
{8774, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8775, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8776, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8777, (BODY_INDEX)-1, 160, NULL},
{8778, (BODY_INDEX)-1, 160, NULL},
{8779, (BODY_INDEX)-1, 160, NULL},
{8780, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8781, (BODY_INDEX)-1, 154, NULL},
{8783, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8784, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8758, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{8759, (BODY_INDEX)-1, 121, NULL},
{8760, (BODY_INDEX)-1, 160, NULL},
{8761, (BODY_INDEX)-1, 160, NULL},
{8762, (BODY_INDEX)-1, 160, NULL},
{8763, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, NULL},
{(BODY_INDEX)-1, (BODY_INDEX)-1, (EIF_TYPE_INDEX)-1, gen_type15_389},
};
extern void Init389(void);
void Init389(void)
{
IDSC(desc_389, 0, 388);
IDSC(desc_389 + 1, 2, 388);
IDSC(desc_389 + 34, 123, 388);
IDSC(desc_389 + 37, 49, 388);
IDSC(desc_389 + 39, 43, 388);
IDSC(desc_389 + 62, 11, 388);
}
#ifdef __cplusplus
}
#endif
| [
"[email protected]"
] | |
0b36e1ef822ad5aac2b4bcab41a6148bfffa0ab9 | 3286f38f37da2b40eaeb3664d5d55e27b0c31bf3 | /training_data/s12nn_16384_2_2_sa_out1.c | ff759c123b5a8df2b979bd1f7b5559a36004ab67 | [
"BSD-3-Clause"
] | permissive | intel/neuro-vectorizer | e20e207c2fbd934bbe3bd8c6182a762c4733343c | 28b65ab7cdcbae81b7e379e628bbf3bf85211000 | refs/heads/master | 2023-06-02T16:54:02.487191 | 2023-01-07T00:10:24 | 2023-01-07T00:10:24 | 219,954,590 | 79 | 35 | BSD-3-Clause | 2020-05-23T01:52:24 | 2019-11-06T09:04:15 | C | UTF-8 | C | false | false | 2,559 | c | /*
Copyright (c) 2019, Ameer Haj Ali (UC Berkeley), and Intel Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "header.h"
short sa[16384];
short sb[16384];
short sc[16384];
int out1[16384] ALIGNED16;
int out2[16384] ALIGNED16;
int out3[16384] ALIGNED16;
__attribute__((noinline))
void example10b(short *__restrict__ sa, short *__restrict__ sb, short *__restrict__ sc, int* __restrict__ out1, int* __restrict__ out2, int* __restrict__ out3) {
int i;
for (i = 0; i < 16384-1; i+=2) {
out1[i] = (int) sa[i];
out1[i+1] = (int) sa[i+1];
out2[i] = (int) sb[i];
out2[i+1] = (int) sb[i+1];
out3[i] = (int) sc[i];
out3[i+1] = (int) sc[i+1];
}
}
int main(int argc,char* argv[]){
init_memory(&out1[0], &out1[16384]);
init_memory(&out2[0], &out2[16384]);
init_memory(&out3[0], &out3[16384]);
init_memory(&sa[0], &sa[16384]);
init_memory(&sb[0], &sb[16384]);
init_memory(&sc[0], &sc[16384]);
BENCH("Example10b", example10b(sa,sb,sc,out1,out2,out3), Mi*4/16384*512, digest_memory(&out1[0], &out1[16384])+digest_memory(&out2[0], &out2[16384])+digest_memory(&out3[0], &out3[16384]));
return 0;
}
| [
"[email protected]"
] | |
dfe0c491e76eb8c17f48f0e80084dc54e6c46098 | ac362bb8969d647cd219430bc71c831d894e531c | /sys/arch/hp700/hp700/softintr.c | 107510be07c93495cd3b245256cd29564933d21d | [] | no_license | noud/mouse-bsd-4.0.1 | efb3b16fcc872ab227e6bb651cf1e836796a0804 | 4c0a1e08df407a759afac2d6a98507df94f5f814 | refs/heads/master | 2023-02-24T23:42:54.060718 | 2020-08-16T20:10:53 | 2020-08-16T20:10:53 | 334,536,412 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,754 | c | /* $NetBSD: softintr.c,v 1.6 2005/12/24 20:07:04 perry Exp $ */
/*-
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe, and by Matthew Fredette.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Generic soft interrupt implementation for NetBSD/hp700.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: softintr.c,v 1.6 2005/12/24 20:07:04 perry Exp $");
#include <sys/param.h>
#include <sys/malloc.h>
#include <machine/intr.h>
#include <net/netisr.h>
#include <uvm/uvm_extern.h>
#include <hp700/hp700/intr.h>
static struct hp700_int_reg int_reg_soft;
static struct hp700_soft_intr hp700_soft_intrs[HP700_NSOFTINTR];
int softnetmask;
const struct {
int ipl;
const char *name;
} hp700_soft_intr_info[HP700_NSOFTINTR] = {
{ IPL_SOFTCLOCK, "softclock" },
{ IPL_SOFTNET, "softnet" },
{ IPL_SOFTSERIAL, "softserial" },
};
/*
* softintr_bootstrap:
*
* Bootstrap the software interrupt system.
*/
void
softintr_bootstrap(void)
{
/* We don't know softnetmask yet. */
softnetmask = 0;
}
/*
* softintr_init:
*
* Initialize the software interrupt system.
*/
void
softintr_init(void)
{
struct hp700_soft_intr *si;
struct device *dv;
void *ih;
int i;
/* Initialize the soft interrupt "register". */
hp700_intr_reg_establish(&int_reg_soft);
int_reg_soft.int_reg_dev = "soft";
/* Initialize the soft interrupt "bits". */
for (i = 0; i < HP700_NSOFTINTR; i++) {
/* Register our interrupt handler for this bit. */
dv = malloc(sizeof (struct device), M_SOFTINTR, M_WAITOK);
strcpy(dv->dv_xname, hp700_soft_intr_info[i].name);
ih = hp700_intr_establish(dv, hp700_soft_intr_info[i].ipl,
softintr_dispatch, (void *) (i + 1), &int_reg_soft, i);
si = &hp700_soft_intrs[i];
TAILQ_INIT(&si->softintr_q);
si->softintr_ssir = _hp700_intr_spl_mask(ih);
}
softnetmask = hp700_soft_intrs[HP700_SOFTINTR_SOFTNET].softintr_ssir;
}
/*
* softintr_dispatch:
*
* Process pending software interrupts.
*/
int
softintr_dispatch(void *arg)
{
int which = ((int) arg) - 1;
struct hp700_soft_intr *si = &hp700_soft_intrs[which];
struct hp700_soft_intrhand *sih;
int s;
int ni;
/* Special handling for softnet. */
if (which == HP700_SOFTINTR_SOFTNET) {
__asm volatile(
" mfctl %%eiem, %%r22 \n"
" mtctl %%r0, %%eiem \n"
" ldw 0(%1), %0 \n"
" stw %%r0, 0(%1) \n"
" mtctl %%r22, %%eiem \n"
: "=&r" (ni) : "r" (&netisr) : "r22");
#define DONETISR(m,c) if (ni & (1 << (m))) c()
#include <net/netisr_dispatch.h>
}
for (;;) {
hp700_softintr_lock(si, s);
sih = TAILQ_FIRST(&si->softintr_q);
if (sih == NULL) {
hp700_softintr_unlock(si, s);
break;
}
TAILQ_REMOVE(&si->softintr_q, sih, sih_q);
sih->sih_pending = 0;
hp700_softintr_unlock(si, s);
uvmexp.softs++;
(*sih->sih_fn)(sih->sih_arg);
}
return 1;
}
/*
* softintr_establish: [interface]
*
* Register a software interrupt handler.
*/
void *
softintr_establish(int ipl, void (*func)(void *), void *arg)
{
struct hp700_soft_intr *si;
struct hp700_soft_intrhand *sih;
int which;
switch (ipl) {
case IPL_SOFTCLOCK:
which = HP700_SOFTINTR_SOFTCLOCK;
break;
case IPL_SOFTNET:
which = HP700_SOFTINTR_SOFTNET;
break;
case IPL_SOFTSERIAL:
which = HP700_SOFTINTR_SOFTSERIAL;
break;
default:
panic("softintr_establish");
}
si = &hp700_soft_intrs[which];
sih = malloc(sizeof(*sih), M_DEVBUF, M_NOWAIT);
if (__predict_true(sih != NULL)) {
sih->sih_intrhead = si;
sih->sih_fn = func;
sih->sih_arg = arg;
sih->sih_pending = 0;
}
return (sih);
}
/*
* softintr_disestablish: [interface]
*
* Unregister a software interrupt handler.
*/
void
softintr_disestablish(void *arg)
{
struct hp700_soft_intrhand *sih = arg;
struct hp700_soft_intr *si = sih->sih_intrhead;
int s;
hp700_softintr_lock(si, s);
if (sih->sih_pending) {
TAILQ_REMOVE(&si->softintr_q, sih, sih_q);
sih->sih_pending = 0;
}
hp700_softintr_unlock(si, s);
free(sih, M_DEVBUF);
}
| [
"[email protected]"
] | |
7e7cabd5630ce8b6277c2b1b05dc0303ce2cc1a1 | d49b8536d996a81fd2a356f2ccd850abd4447217 | /VirusPack/hdbotv0.2-ciscoscan/includes.h | ae8f7dfe309ed50f6c75f4284b4477a3cd360359 | [] | no_license | JonnyBanana/botnets | 28a90ab80f973478d54579f3d3eadc5feb33ff77 | 995b9c20aca5de0ae585ae17780a31e8bdfd9844 | refs/heads/master | 2021-07-01T01:51:01.211451 | 2020-10-22T23:14:57 | 2020-10-22T23:14:57 | 148,392,362 | 9 | 5 | null | null | null | null | UTF-8 | C | false | false | 1,667 | h | #ifdef WIN32
#define _WIN32_WINNT 0x0403 // Very important for critical sections.
#define WIN32_LEAN_AND_MEAN // Good to use.
#pragma optimize("gsy", on) // Global optimization, Short sequences, Frame pointers.
#pragma comment(linker,"/RELEASE") // Release code
#pragma comment(linker, "/ALIGN:4096") // This will save you some size on the executable.
#pragma comment(linker, "/IGNORE:4108 ") // This is only here for when you use /ALIGN:4096.
//#pragma pack(1) // Force packing on byte boundaries.
#endif // WIN32
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <malloc.h>
#include <winsock2.h>
#include <windows.h>
#include <wininet.h>
#include <windns.h>
#include <iphlpapi.h>
#include <lm.h>
#include <lmat.h>
#include <io.h>
#include <fcntl.h>
#include <tchar.h>
#include <tlhelp32.h>
#include <assert.h>
#include <sqlext.h>
#include <vfw.h>
#include <shlobj.h>
#include <ntsecapi.h>
#include "defines.h"
#include "ehandler.h"
#include "processes.h"
#include "loaddlls.h"
#include "tcpip.h"
#include "threads.h"
#include "hdbot.h"
#include "irc_send.h"
#include "crc32.h"
#include "random.h"
#include "netutils.h"
#include "sysinfo.h"
#include "advscan.h"
#include "rndnick.h"
#include "download.h"
#include "scan.h"
#include "ddos.h"
#include "wildcard.h"
#include "redirect.h"
#include "misc.h"
#include "driveinfo.h"
#include "visit.h"
#include "tftpd.h"
#include "aliaslog.h"
#include "psniff.h"
#include "secure.h"
#include "autostart.h"
#include "fphost.h"
#include "shellcode.h"
#include "cisco.h"
#include "asn.h"
#include "ftpd.h"
#include "net.h"
| [
"[email protected]"
] | |
2953e856bd2f8339aba3aeb51f5f45754d866b62 | fdbc4290dd724a093cb74626ea3c3063b45fa2c7 | /osprey1.0/be/purple2/prp_driver.h | b418a4e73051e1b01f8621ae06f32993651c364d | [] | no_license | sriharikrishna/Open64 | fe764dd267f5c0cb040b3eceb2efbda71f8be9be | f9b081e5b22023fafb257694b91a2296fb44c179 | refs/heads/master | 2020-06-06T05:31:33.901374 | 2008-06-26T15:48:25 | 2008-06-26T15:48:25 | 192,648,234 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,249 | h | /*
Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU General Public License along
with this program; if not, write the Free Software Foundation, Inc., 59
Temple Place - Suite 330, Boston MA 02111-1307, USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#ifndef prp_driver_INCLUDED
#define prp_driver_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
/* ==============================================================
* ==============================================================
*
* Module: prp_driver.h
* $Revision: 1.1.1.1 $
* $Date: 2002-05-22 20:06:53 $
* $Author: dsystem $
* $Source: /m_home/m_utkej/Argonne/cvs2svn/cvs/Open64/osprey1.0/be/purple2/prp_driver.h,v $
*
* Description:
*
* Defines utilities exported by purple_instr.so
*
* ==============================================================
* ==============================================================
*/
void Prp_Process_Command_Line (INT phase_argc, char *phase_argv[],
INT argc, char *argv[]);
BOOL Prp_Needs_Whirl2c(void);
BOOL Prp_Needs_Whirl2f(void);
void Prp_Init(void);
void Prp_Instrument_And_EmitSrc(WN *pu);
void Prp_Fini(void);
#ifdef __cplusplus
}
#endif
#endif /* prp_driver_INCLUDED */
| [
"dsystem@856677d4-e204-44a3-822c-5496da239ec1"
] | dsystem@856677d4-e204-44a3-822c-5496da239ec1 |
00ecc60a3f8a0e54950321a3bf9437b654e8ca59 | 04ad1e5adbf9c8011629cce5251ac6e2f6b657e4 | /kungfu/class/shaolin/xuan-ci.c | 5311a2321355841f3e94b82f1669bd78e6c5a4e3 | [] | no_license | cao777/mudwllz2-utf8 | 7398dd2dc702e8ab9a3c98895d2afc3392c07232 | 19ae1d998a871b9ad7f29c467481015143ffb7a8 | refs/heads/master | 2023-03-16T08:34:07.707561 | 2020-05-09T00:04:07 | 2020-05-09T00:04:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,657 | c | // Npc: /kungfu/class/shaolin/xuan-ci.c
inherit NPC;
inherit F_MASTER;
void create()
{
set_name("玄慈大师", ({"xuanci dashi","xuanci","dashi",}));
set("long",@LONG
他是一位白须白眉的老僧,身穿一袭金丝绣红袈裟。他身材略显佝偻,但
却满面红光,目蕴慈笑,显得神完气足。
LONG
);
set("nickname", "少林寺方丈");
set("gender", "男性");
set("attitude", "friendly");
set("class", "bonze");
set("age", 70);
set("shen_type", 1);
set("str", 30);
set("int", 30);
set("con", 30);
set("dex", 30);
set("max_jing", 1000);
set("neili",6000);
set("max_neili",6000);
set("jiali",300);
set("combat_exp",6400000);
set("score", 500000);
set_skill("force", 400);
set_skill("hunyuan-yiqi", 400);
set_skill("dodge", 400);
set_skill("shaolin-shenfa", 400);
set_skill("finger", 400);
set_skill("strike", 400);
set_skill("hand", 400);
set_skill("claw", 400);
set_skill("parry", 400);
set_skill("nianhua-zhi", 400);
set_skill("sanhua-zhang", 400);
set_skill("fengyun-shou", 400);
set_skill("longzhua-gong", 400);
set_skill("buddhism", 400);
set_skill("literate", 400);
map_skill("force", "hunyuan-yiqi");
map_skill("dodge", "shaolin-shenfa");
map_skill("finger", "nianhua-zhi");
map_skill("strike", "sanhua-zhang");
map_skill("hand", "fengyun-shou");
map_skill("claw", "longzhua-gong");
map_skill("parry", "nianhua-zhi");
prepare_skill("finger", "nianhua-zhi");
prepare_skill("strike", "sanhua-zhang");
create_family("少林派", 36, "弟子");
setup();
carry_object("/d/shaolin/obj/xuan-cloth")->wear();
}
void attempt_apprentice(object ob)
{
object me;
mapping ob_fam, my_fam;
string name;
me = this_object();
my_fam = me->query("family");
name = ob->query("name");
if (!(ob_fam = ob->query("family")) || ob_fam["family_name"] != "少林派")
{
command("say " + RANK_D->query_respect(ob) + "与本派素无来往,不知此话从何谈起?");
return;
}
if ( (string)ob->query("class")!="bonze" && ob_fam["family_name"] == "少林派")
{
command("say " + RANK_D->query_respect(ob) + "是俗家弟子,不能在寺内学艺。");
return;
}
if ( ob_fam["generation"] <= my_fam["generation"] )
{
command("say " + RANK_D->query_respect(ob) + ",贫僧哪里敢当 !");
return;
}
if ( ob_fam["generation"] == (my_fam["generation"] + 1) && name[0..1] == "澄")
{
command("say " + ob_fam["master_name"] + "的徒弟怎麽跑到我这儿来了,哈哈哈 !");
command("recruit " + ob->query("id"));
}
else
{
command("say " + RANK_D->query_respect(ob) + ",你辈份不合,不能越级拜师。");
return;
}
return;
}
| [
"[email protected]"
] | |
ca0fa7dd089c84525a489c8aed0f24230c156e14 | c2a07bbbebad8cdaa600ccd4a41363f7dd9912ad | /libft/ft_isdigit.c | 9cbc73b31cf42305cc4942421065e4f21c60c0a8 | [] | no_license | adagiox/Fdf | 794294dbedadeaddc9834d4b17df8dd6e0ddd82d | 520d4200cc4428f8566f6a018330576bb48c898c | refs/heads/master | 2020-06-16T11:22:29.156815 | 2017-11-05T04:27:19 | 2017-11-05T04:27:19 | 94,144,187 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,001 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isdigit.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erintala <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/01 14:52:49 by erintala #+# #+# */
/* Updated: 2017/03/01 14:52:51 by erintala ### ########.fr */
/* */
/* ************************************************************************** */
#include "./includes/libft.h"
int ft_isdigit(int c)
{
if (c >= 48 && c <= 57)
return (1);
return (0);
}
| [
"[email protected]"
] | |
1336b543eee27b4e3fd724e9c0b74fce72f39eec | b56f491a18843d11f1bbfa6197e8aea14bd648ad | /apache/mod_flvx/mod_flvx.c | 91b07608327989f0bcbb0ffc31435885e7cfeb9c | [] | no_license | rsenn/ports | 864504c7246b2a9f18b25edea3161e3538acf067 | bc61551eeb2b4021e9af2d92abe2d0c8534b4378 | refs/heads/master | 2022-05-07T21:34:20.960932 | 2022-03-08T02:09:35 | 2022-03-08T02:09:35 | 105,105,794 | 2 | 2 | null | null | null | null | UTF-8 | C | false | false | 3,229 | c | /**
* Copyright 2006 Paul Querna
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "httpd.h"
#include "http_core.h"
#include "http_config.h"
#include "http_protocol.h"
#include "http_log.h"
#include "apr_buckets.h"
#define FLVX_HANDLER "flv-stream"
#define FLVX_HEADER "FLV\x1\x1\0\0\0\x9\0\0\0\x9"
#define FLVX_HEADER_LEN (sizeof(FLVX_HEADER)-1)
static apr_off_t get_start(request_rec *r)
{
apr_off_t start = 0;
char *p = NULL;
if (!r->args) {
return start;
}
p = strstr(r->args, "start=");
if (p) {
p = p + 6;
apr_strtoff(&start, p, NULL, 10);
}
return start;
}
static int drive_flvx(request_rec *r)
{
apr_finfo_t fi;
apr_bucket_brigade *bb;
apr_off_t offset = 0;
apr_off_t length = 0;
apr_file_t *fp = NULL;
apr_status_t rv = APR_SUCCESS;
rv = apr_stat(&fi, r->filename, APR_FINFO_SIZE, r->pool);
if (rv) {
/* Let the core handle it. */
return DECLINED;
}
/* Open the file */
rv = apr_file_open(&fp, r->filename, APR_READ,
APR_OS_DEFAULT, r->pool);
if (rv) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"file permissions deny server access: %s", r->filename);
return HTTP_FORBIDDEN;
}
offset = get_start(r);
if (offset != 0 && offset < fi.size) {
length = fi.size - offset;
}
else {
length = fi.size;
}
bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
if (offset != 0) {
rv = apr_brigade_write(bb, NULL, NULL, FLVX_HEADER, FLVX_HEADER_LEN);
if (rv) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"unable to write flv header in brigade");
return HTTP_INTERNAL_SERVER_ERROR;
}
}
apr_brigade_insert_file(bb, fp, offset, length, r->pool);
ap_set_content_type(r, "video/x-flv");
ap_set_content_length(r, length);
return ap_pass_brigade(r->output_filters, bb);
}
static int flvx_handler(request_rec *r)
{
if ((!r->handler) ||
(strcmp(r->handler, FLVX_HANDLER))) {
return DECLINED;
}
r->allowed |= (AP_METHOD_BIT << M_GET);
if (r->method_number != M_GET) {
return HTTP_METHOD_NOT_ALLOWED;
}
return drive_flvx(r);
}
static const command_rec flvx_cmds[] =
{
{NULL}
};
static void register_hooks(apr_pool_t *p)
{
ap_hook_handler(flvx_handler, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA flvx_module =
{
STANDARD20_MODULE_STUFF,
NULL,
NULL,
NULL,
NULL,
flvx_cmds,
register_hooks
};
| [
"[email protected]"
] | |
42f4584d7c7413786cb3faf300ae24d2d73e7dbc | f3e94f6c6aa95ed4dd591ca34ea1f53a699840b1 | /GBOX_EXAMPLE/device_driver.h | 6a53ad194027417a88c72bf804cc03d1138f9355 | [] | no_license | sngn-libby/MiniGameProj | 71067834ac139093b2396faa6f06a02bab5030d9 | a73025d22288647ac2bc478cc65ac3d974674d05 | refs/heads/master | 2020-06-25T15:06:33.221546 | 2019-08-06T12:25:00 | 2019-08-06T12:25:00 | 199,346,544 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,679 | h | typedef unsigned int U32;
typedef signed int S32;
typedef unsigned short U16;
typedef short int S16;
typedef unsigned char U8;
typedef signed char S8;
typedef unsigned long long ULL;
// Heap.c
extern void * Get_Heap_Limit(void);
extern void * Get_Heap_Base(void);
extern unsigned int Get_Heap_Size(void);
// Led.c
extern void Led_Init(void);
extern void Led_Display(int disp);
// Uart.c
extern void Uart_Init(int baud);
extern void Uart_Fifo_Init(void);
extern int Uart_Printf(char *fmt,...);
extern char Uart_Get_Char(void);
extern char Uart_Get_Pressed(void);
extern int Uart_GetIntNum(void);
extern void Uart_GetString(char *string);
// MMU.c
extern void MMU_Init(void);
// Key.c
extern void Key_Poll_Init(void);
extern int Key_Get_Pressed(void);
extern void Key_Wait_Key_Released(void);
extern int Key_Wait_Key_Pressed(void);
extern int Key_Get_Pressed_Multi(void);
extern void Key_Wait_Key_Released_Multi(void);
extern int Key_Wait_Key_Pressed_Multi(void);
// Timer.c
extern void Timer0_Init(void);
extern void Timer0_Repeat(int time);
extern int Timer0_Check_Expired(void);
extern void Timer0_Stop(void);
extern void Timer0_Change_Delay(int msec);
extern void Timer1_Stopwatch_Run(void);
extern int Timer1_Stopwatch_Stop(void);
extern void Timer4_Init(void);
extern void Timer4_Delay(unsigned int msec);
// Buzzer.c
extern void Timer3_Buzzer_Beep(int tone, int duration);
extern void Timer3_Buzzer_Init(void);
// ADC.c
extern unsigned int ADC_Start(int ch);
extern void ADC_ISR_Init(int en, int ch);
extern unsigned int Touch_Get_Data(void);
extern void Touch_ISR_Enable(int enable);
extern void Touch_Get_Position(void);
extern void Touch_Set_Wait_For_Release(void);
// Graphics.c
#define LCD_XSIZE (960)
#define LCD_YSIZE (240)
#define LCD_SIZE (LCD_YSIZE*LCD_XSIZE*4)
#define LAYER_MODE 0
#define VIRTUAL_MODE 1
extern unsigned int Virtual_X;
extern unsigned int Virtual_Y;
#define BPP_16 0
#define BPP_24 1
extern unsigned int Bit_per_pixel;
extern unsigned int Selected_frame;
extern unsigned int Display_frame;
extern unsigned int Trans_mode;
extern unsigned int Shape_mode;
extern unsigned int Shape_mode_color;
extern void Lcd_Control_Brightness(int bright);
extern void Lcd_Set_Trans_Mode(int mode);
extern void Lcd_Set_Shape_Mode(int mode, int color);
extern void Lcd_Wait_Blank(void);
extern void Lcd_Select_Buffer_Mode(unsigned int mode);
extern void Lcd_Set_Virtual_Display_Start(int x, int y);
extern void Lcd_Select_Draw_Frame_Buffer(unsigned int id);
extern void Lcd_Select_Display_Frame_Buffer(unsigned int id);
extern void Lcd_Graphic_Init(void);
extern void Lcd_Put_Pixel(int x,int y,int color);
extern void Lcd_Clr_Screen(int color);
extern void Lcd_Draw_BMP(int x, int y, const unsigned short int *fp);
extern void Lcd_Draw_Image(int x, int y, const unsigned short int *fp, int width, int height);
extern void Lcd_Get_Info_BMP(int * x, int * y, const unsigned short int *fp);
extern void Lcd_Draw_Cam_Image(int x, int y, const unsigned short *fp, int width, int height);
extern void Lcd_Draw_Line(int x1,int y1,int x2,int y2,int color);
extern void Lcd_Draw_Hline(int y, int x1, int x2, int color);
extern void Lcd_Draw_Vline(int x, int y1, int y2, int color);
extern void Lcd_Draw_Rect(int x1, int y1, int x2, int y2, int color);
extern void Lcd_Draw_Bar(int x1, int y1, int x2, int y2, int color);
extern void Lcd_Draw_Bar_2(int x1, int y1, int w, int h, int color);
extern void Lcd_Draw_BMP_File_24bpp(int x, int y, void *fp);
extern void Lcd_Puts(int x, int y, int color, int bkcolor, char *str, int zx, int zy);
extern void Lcd_Printf(int x, int y, int color, int bkcolor, int zx, int zy, char *fmt,...);
| [
"[email protected]"
] | |
0123c359e2c754a37385f90907b802b69cefafa7 | ed199e53fc491397c4e0de25dc68c8af05322b59 | /Generated_Source/PSoC4/GLCD_SPIM_SCB_ss3_m.c | 0db54b3a79eb9f726cdd72f62b91d6c72ce83bad | [] | no_license | sanderzinc/Starblasters | 3f51ca048518623c8e5f602d3d4ba23e6a4e8d11 | 86d0fdb015a677537830cab754e0719289702f79 | refs/heads/master | 2020-07-05T03:51:14.621140 | 2015-06-26T21:52:34 | 2015-06-26T21:52:34 | 38,135,666 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,855 | c | /*******************************************************************************
* File Name: GLCD_SPIM_SCB_ss3_m.c
* Version 1.90
*
* Description:
* This file contains API to enable firmware control of a Pins component.
*
* Note:
*
********************************************************************************
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#include "cytypes.h"
#include "GLCD_SPIM_SCB_ss3_m.h"
#define SetP4PinDriveMode(shift, mode) \
do { \
GLCD_SPIM_SCB_ss3_m_PC = (GLCD_SPIM_SCB_ss3_m_PC & \
(uint32)(~(uint32)(GLCD_SPIM_SCB_ss3_m_DRIVE_MODE_IND_MASK << (GLCD_SPIM_SCB_ss3_m_DRIVE_MODE_BITS * (shift))))) | \
(uint32)((uint32)(mode) << (GLCD_SPIM_SCB_ss3_m_DRIVE_MODE_BITS * (shift))); \
} while (0)
/*******************************************************************************
* Function Name: GLCD_SPIM_SCB_ss3_m_Write
********************************************************************************
*
* Summary:
* Assign a new value to the digital port's data output register.
*
* Parameters:
* prtValue: The value to be assigned to the Digital Port.
*
* Return:
* None
*
*******************************************************************************/
void GLCD_SPIM_SCB_ss3_m_Write(uint8 value)
{
uint8 drVal = (uint8)(GLCD_SPIM_SCB_ss3_m_DR & (uint8)(~GLCD_SPIM_SCB_ss3_m_MASK));
drVal = (drVal | ((uint8)(value << GLCD_SPIM_SCB_ss3_m_SHIFT) & GLCD_SPIM_SCB_ss3_m_MASK));
GLCD_SPIM_SCB_ss3_m_DR = (uint32)drVal;
}
/*******************************************************************************
* Function Name: GLCD_SPIM_SCB_ss3_m_SetDriveMode
********************************************************************************
*
* Summary:
* Change the drive mode on the pins of the port.
*
* Parameters:
* mode: Change the pins to this drive mode.
*
* Return:
* None
*
*******************************************************************************/
void GLCD_SPIM_SCB_ss3_m_SetDriveMode(uint8 mode)
{
SetP4PinDriveMode(GLCD_SPIM_SCB_ss3_m__0__SHIFT, mode);
}
/*******************************************************************************
* Function Name: GLCD_SPIM_SCB_ss3_m_Read
********************************************************************************
*
* Summary:
* Read the current value on the pins of the Digital Port in right justified
* form.
*
* Parameters:
* None
*
* Return:
* Returns the current value of the Digital Port as a right justified number
*
* Note:
* Macro GLCD_SPIM_SCB_ss3_m_ReadPS calls this function.
*
*******************************************************************************/
uint8 GLCD_SPIM_SCB_ss3_m_Read(void)
{
return (uint8)((GLCD_SPIM_SCB_ss3_m_PS & GLCD_SPIM_SCB_ss3_m_MASK) >> GLCD_SPIM_SCB_ss3_m_SHIFT);
}
/*******************************************************************************
* Function Name: GLCD_SPIM_SCB_ss3_m_ReadDataReg
********************************************************************************
*
* Summary:
* Read the current value assigned to a Digital Port's data output register
*
* Parameters:
* None
*
* Return:
* Returns the current value assigned to the Digital Port's data output register
*
*******************************************************************************/
uint8 GLCD_SPIM_SCB_ss3_m_ReadDataReg(void)
{
return (uint8)((GLCD_SPIM_SCB_ss3_m_DR & GLCD_SPIM_SCB_ss3_m_MASK) >> GLCD_SPIM_SCB_ss3_m_SHIFT);
}
/* If Interrupts Are Enabled for this Pins component */
#if defined(GLCD_SPIM_SCB_ss3_m_INTSTAT)
/*******************************************************************************
* Function Name: GLCD_SPIM_SCB_ss3_m_ClearInterrupt
********************************************************************************
*
* Summary:
* Clears any active interrupts attached to port and returns the value of the
* interrupt status register.
*
* Parameters:
* None
*
* Return:
* Returns the value of the interrupt status register
*
*******************************************************************************/
uint8 GLCD_SPIM_SCB_ss3_m_ClearInterrupt(void)
{
uint8 maskedStatus = (uint8)(GLCD_SPIM_SCB_ss3_m_INTSTAT & GLCD_SPIM_SCB_ss3_m_MASK);
GLCD_SPIM_SCB_ss3_m_INTSTAT = maskedStatus;
return maskedStatus >> GLCD_SPIM_SCB_ss3_m_SHIFT;
}
#endif /* If Interrupts Are Enabled for this Pins component */
/* [] END OF FILE */
| [
"[email protected]"
] | |
31c1040f113c9ba62a08040939bc54ab8708c6a8 | 3ab88d661ce0d8687cef9bae4fb80811b8409125 | /Bootloader/Firmware/EFM8LB1_SLSTK2030A/Bootloader/UART/inc/efm8_device.h | 45e67d1fa103722e00904ed78571be8d90f8108d | [] | no_license | HashDefineElectronics/BC_Touchy_Firmware | 60fda1ea89539f8125d1d2e2721900f0ba6b0dba | 5e7857fa23c8cd7c02a895909056b467b73bd9c2 | refs/heads/master | 2020-12-25T14:08:50.365188 | 2016-09-28T06:27:17 | 2016-09-28T06:27:17 | 68,091,099 | 6 | 1 | null | 2016-09-28T06:27:17 | 2016-09-13T08:46:20 | C | UTF-8 | C | false | false | 1,967 | h | /******************************************************************************
* Copyright (c) 2015 by Silicon Laboratories Inc. All rights reserved.
*
* http://developer.silabs.com/legal/version/v11/Silicon_Labs_Software_License_Agreement.txt
*****************************************************************************/
#ifndef __EFM8_DEVICE_H__
#define __EFM8_DEVICE_H__
#ifdef __C51__
#include "SI_EFM8LB1_Register_Enums.h"
#else
#include "SI_EFM8LB1_Defs.inc"
#endif
// Select the STK device if one has not been specified by the project
#ifndef EFM8LB1_DEVICE
#define EFM8LB1_DEVICE EFM8LB12F64E_QFN32
#endif
#include "SI_EFM8LB1_Devices.h"
// Bootloader firmware revision number
#define BL_REVISION 0x90
// Device specific ID is checked by the prefix command
#define BL_DERIVATIVE_ID (0x3400 | DEVICE_DERIVID)
// Holding the boot pin low at reset will start the bootloader
#if defined(DEVICE_PKG_QFN32) || defined(DEVICE_PKG_QFP32)
#define BL_START_PIN P3_B7
#elif defined(DEVICE_PKG_QFN24) || defined(DEVICE_PKG_QSOP24)
#define BL_START_PIN P3_B0
#else
#error Unknown or unsupported device package!
#endif
// Number of cycles (at reset system clock) boot pin must be held low
#define BL_PIN_LOW_CYCLES (50 * 25 / 8)
// Parameters that describe the flash memory geometry
#define BL_FLASH1_START 0xFA00
#define BL_FLASH1_LIMIT 0xFC00
#define BL_FLASH1_PSIZE 512
// Define range bootloader is allowed to write
#if DEVICE_FLASH_SIZE < BL_FLASH1_START
#define BL_FLASH0_LIMIT DEVICE_FLASH_SIZE
#else
#define BL_FLASH0_LIMIT BL_FLASH1_START
#endif
// Define the starting address for the bootloader's code segments
#define BL_LIMIT_ADDRESS (BL_FLASH1_START)
#define BL_START_ADDRESS (BL_FLASH1_START)
#define BL_LOCK_ADDRESS (BL_FLASH1_LIMIT - 1)
// Defines for managing SFR pages (used for porting between devices)
#define SET_SFRPAGE(p) SFRPAGE = (p)
#endif // __EFM8_DEVICE_H__
| [
"[email protected]"
] | |
3e7497cc6d15f5f610a6544b5901420cb81726e1 | 6d5b9b85d7ebee5899166a776a49597a520133cb | /STM32Cube_FW_F7_V1.8.0/Projects/STM32F769I_EVAL/Examples/TIM/TIM_ExtTriggerSynchro/Src/stm32f7xx_hal_msp.c | 9979b191903dc7735ae2bc9d8b08cfd1928d2558 | [
"BSD-2-Clause"
] | permissive | koson/STM32-Tests-Project | 291531c504b256fc70b484467fc285ef2349fed9 | 25fb44d23362e89df3ae489285dae1a4be3d0414 | refs/heads/master | 2022-04-12T17:33:56.763263 | 2020-04-04T23:02:45 | 2020-04-04T23:02:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,936 | c | /**
******************************************************************************
* @file TIM/TIM_ExtTriggerSynchro/Src/stm32f7xx_hal_msp.c
* @author MCD Application Team
* @brief HAL MSP module.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/** @addtogroup STM32F7xx_HAL_Examples
* @{
*/
/** @defgroup HAL_MSP
* @brief HAL MSP module.
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/** @defgroup HAL_MSP_Private_Functions
* @{
*/
/**
* @brief TIM MSP Initialization
* This function configures the hardware resources used in this example:
* - Peripheral's clock enable
* - Peripheral's GPIO Configuration
* @param htim: TIM handle pointer
* @retval None
*/
void HAL_TIM_OC_MspInit(TIM_HandleTypeDef* htim)
{
GPIO_InitTypeDef GPIO_InitStruct;
/*##-1- Enable peripherals and GPIO Clocks #################################*/
/* TIMs Peripheral clock enable */
__HAL_RCC_TIM1_CLK_ENABLE();
__HAL_RCC_TIM4_CLK_ENABLE();
__HAL_RCC_TIM5_CLK_ENABLE();
/* Enable GPIO Channels Clock */
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
/*##-2- Configure I/Os #####################################################*/
/* Configure PA.08 (TIM1_Channel1), PA.09 (TIM1_Channel2), PB.06 (TIM4_Channel1),
PA.00 (TIM5_Channel1) in output, pull-down, alternate function mode
*/
/* Common configuration for all channels */
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
GPIO_InitStruct.Pin = GPIO_PIN_8;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
GPIO_InitStruct.Pin = GPIO_PIN_9;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Alternate = GPIO_AF2_TIM4;
GPIO_InitStruct.Pin = GPIO_PIN_6;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
GPIO_InitStruct.Alternate = GPIO_AF2_TIM5;
GPIO_InitStruct.Pin = GPIO_PIN_0;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}
/**
* @brief Initializes the Global MSP.
* @param None
* @retval None
*/
void HAL_MspInit(void)
{
/* NOTE : This function is generated automatically by STM32CubeMX and eventually
modified by the user
*/
}
/**
* @brief DeInitializes the Global MSP.
* @param None
* @retval None
*/
void HAL_MspDeInit(void)
{
/* NOTE : This function is generated automatically by STM32CubeMX and eventually
modified by the user
*/
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
| [
"[email protected]"
] | |
956d1581507b1269432dc513049777c68aa06461 | 45d1881440cd736dc3624e69026d95922f9e1289 | /Silicon/TigerlakePchPkg/Include/Register/PchRegsUsb.h | db797ea0a5605dbb1a997135c77b8dfebf67ab48 | [
"BSD-2-Clause-Patent",
"BSD-3-Clause"
] | permissive | sagraw2/slimbootloader | cf794d9cf593f4c9ee99b958ac17480e4ccbec10 | c62c995e496368a4c426da478b054120ebbc8eca | refs/heads/master | 2021-06-19T18:16:08.746301 | 2021-01-07T21:34:59 | 2021-01-08T04:22:54 | 160,243,111 | 0 | 0 | BSD-2-Clause | 2018-12-03T19:31:52 | 2018-12-03T19:31:52 | null | UTF-8 | C | false | false | 1,674 | h | /** @file
Register names for PCH USB devices
Conventions:
- Prefixes:
Definitions beginning with "R_" are registers
Definitions beginning with "B_" are bits within registers
Definitions beginning with "V_" are meaningful values within the bits
Definitions beginning with "S_" are register sizes
Definitions beginning with "N_" are the bit position
- In general, PCH registers are denoted by "_PCH_" in register names
- Registers / bits that are different between PCH generations are denoted by
"_PCH_[generation_name]_" in register/bit names.
- Registers / bits that are specific to PCH-H denoted by "_H_" in register/bit names.
Registers / bits that are specific to PCH-LP denoted by "_LP_" in register/bit names.
e.g., "_PCH_H_", "_PCH_LP_"
Registers / bits names without _H_ or _LP_ apply for both H and LP.
- Registers / bits that are different between SKUs are denoted by "_[SKU_name]"
at the end of the register/bit names
- Registers / bits of new devices introduced in a PCH generation will be just named
as "_PCH_" without [generation_name] inserted.
Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _PCH_REGS_USB_H_
#define _PCH_REGS_USB_H_
//
// USB3 (XHCI) related definitions
//
#define PCI_BUS_NUMBER_PCH_XHCI 0
#define PCI_DEVICE_NUMBER_PCH_XHCI 20
#define PCI_FUNCTION_NUMBER_PCH_XHCI 0
//
// xDCI (OTG) USB Device Controller
//
#define PCI_DEVICE_NUMBER_PCH_XDCI 20
#define PCI_FUNCTION_NUMBER_PCH_XDCI 1
#endif
| [
"[email protected]"
] | |
767b6cb94fa5e12e5b9458ca914dcb9b2ae94cec | 9101d46054429ae36c884368d1acf97632f25bf0 | /libft/ft_strnew.c | 4439413a98f2f8065548d5d0f103f8a0d447a602 | [] | no_license | Kndrf/Fillit | 1900d43ad99c0106265aa9b7469bf169bacfc98e | 0d5fbbbee547155ffd7c0bae14ebfc669369fe3a | refs/heads/master | 2021-08-30T14:55:34.086609 | 2017-12-18T10:37:35 | 2017-12-18T10:37:35 | 114,628,087 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,086 | c | /* ************************************************************************** */
/* LE - / */
/* / */
/* ft_strnew.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: ghazette <[email protected]> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2017/11/23 14:11:53 by ghazette #+# ## ## #+# */
/* Updated: 2017/11/23 14:11:54 by ghazette ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
char *ft_strnew(size_t size)
{
return ((char*)ft_memalloc(size + 1));
}
| [
"[email protected]"
] | |
0d4af2074ef737068ecc61f42ed8ee88c609c28b | 19e356aa308d3adef259a912b29950a3af37a2e2 | /Temp/il2cppOutput/il2cppOutput/System_Core_System_Linq_Enumerable_U3CCreateSelectIteratorU3_135.h | 52ea249699de61cec1737769d96cb04f982843cc | [] | no_license | minuJeong/AcocGame | 87314d914b72290fff347cc590ae03669d10d6ba | 24eeaba66393890998d55a633fcbd17d984549b4 | refs/heads/master | 2021-03-12T23:51:57.818655 | 2015-03-29T12:44:58 | 2015-03-29T12:44:58 | 32,936,460 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,760 | h | #pragma once
#include <stdint.h>
// System.Collections.Generic.IEnumerable`1<System.Char>
struct IEnumerable_1_t3812;
// System.Collections.Generic.IEnumerator`1<System.Char>
struct IEnumerator_1_t3169;
// System.Func`2<System.Char,System.Int64>
struct Func_2_t7473;
// System.Object
#include "mscorlib_System_Object.h"
// System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>
struct U3CCreateSelectIteratorU3Ec__Iterator10_2_t7474 : public Object_t
{
// System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::source
Object_t* ___source;
// System.Collections.Generic.IEnumerator`1<TSource> System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::<$s_70>__0
Object_t* ___U3C$s_70U3E__0;
// TSource System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::<element>__1
uint16_t ___U3CelementU3E__1;
// System.Func`2<TSource,TResult> System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::selector
Func_2_t7473 * ___selector;
// System.Int32 System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::$PC
int32_t ___$PC;
// TResult System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::$current
int64_t ___$current;
// System.Collections.Generic.IEnumerable`1<TSource> System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::<$>source
Object_t* ___U3C$U3Esource;
// System.Func`2<TSource,TResult> System.Linq.Enumerable/<CreateSelectIterator>c__Iterator10`2<System.Char,System.Int64>::<$>selector
Func_2_t7473 * ___U3C$U3Eselector;
};
| [
"[email protected]"
] | |
22dd6233df47f513f6151e5be1e1f2e09c5f0ab1 | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/5989c95d-b361-46b6-af61-fd81334243bc.c | be4a87762de70e0eccc34266b20669554ca90855 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 607 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=4;
int j=124;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i/j;
l = l/j;
l = l/j;
l = i/j;
l = j-j;
l = k-k*i;
//variables
//random
/* START VULNERABILITY */
int a;
int b[84];
int c[29];
a = 0;
while (( a - 1 ) > -1) {
a--;
//random
/* START BUFFER SET */
*((int *)c + ( a - 1 )) = *((int *)b + ( a - 1 ));
/* END BUFFER SET */
}
/* END VULNERABILITY */
//random
printf("%d%d\n",k,l);
return 0;
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.