file
stringlengths 18
26
| data
stringlengths 2
1.05M
|
---|---|
the_stack_data/90764664.c | /* Taxonomy Classification: 0002200000000000000200 */
/*
* WRITE/READ 0 write
* WHICH BOUND 0 upper
* DATA TYPE 0 char
* MEMORY LOCATION 2 data segment
* SCOPE 2 global
* CONTAINER 0 no
* POINTER 0 no
* INDEX COMPLEXITY 0 constant
* ADDRESS COMPLEXITY 0 constant
* LENGTH COMPLEXITY 0 N/A
* ADDRESS ALIAS 0 none
* INDEX ALIAS 0 none
* LOCAL CONTROL FLOW 0 none
* SECONDARY CONTROL FLOW 0 none
* LOOP STRUCTURE 0 no
* LOOP COMPLEXITY 0 N/A
* ASYNCHRONY 0 no
* TAINT 0 no
* RUNTIME ENV. DEPENDENCE 0 no
* MAGNITUDE 2 8 bytes
* CONTINUOUS/DISCRETE 0 discrete
* SIGNEDNESS 0 no
*/
/*
Copyright 2005 Massachusetts Institute of Technology
All rights reserved.
Redistribution and use of software 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 set of conditions and the disclaimer below.
- Redistributions in binary form must reproduce the copyright notice, this
set of conditions, and the disclaimer below in the documentation and/or
other materials provided with the distribution.
- Neither the name of the Massachusetts Institute of Technology 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".
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.
*/
static char buf[10] = "";
int main(int argc, char *argv[])
{
/* BAD */
buf[17] = 'A';
return 0;
}
|
the_stack_data/65847.c | #include <sys/time.h>
#include <sys/select.h>
#include <poll.h>
#include <sys/stat.h>
#include <sys/ipc.h>
#include <fcntl.h>
#include <sys/msg.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define maxlen 4096
char buf[maxlen];
#define msgfile "/etc/shells"
// 消息结构
struct msg_form
{
long mtype;
char mtext[256];
};
int main()
{
int msqid;
key_t key;
struct msg_form msg;
// get IPC key
if((key = ftok(msgfile,'z')) < 0)
{
perror("ftok error");
exit(1);
}
printf("Message Queue - Server key is: %d.\n", key);
if ((msqid = msgget(key, IPC_CREAT|0777)) == -1)
{
perror("msgget error");
exit(1);
}
printf("My msqid is: %d.\n", msqid);
printf("My pid is: %d.\n", getpid());
for(;;)
{
msgrcv(msqid, &msg, 256, 888, 0);// 返回类型为888的第一个消息
printf("Server: receive msg.mtext is: %s.\n", msg.mtext);
printf("Server: receive msg.mtype is: %d.\n", msg.mtype);
msg.mtype = 777; // 客户端接收的消息类型
sprintf(msg.mtext, "hello, I'm server %d", getpid());
msgsnd(msqid, &msg, sizeof(msg.mtext), 0);
}
return 0;
}
|
the_stack_data/14200350.c | /*
Project 59 -
Description:
Make an algorithm in C language that receives as input a matrix
of characters. Each position in the array must store a character;
The matrix dimension should be MxN, where M and N are chosen input data
by the user. Declare the matrix as having a maximum size of 10x10, and validate the values
M and N, which must be between 1 and 10, including 1 and 10. For validation, the user must
get stuck in the program until you enter a valid number for M and N;
After choosing the dimension of the matrix and populating it with characters:
1) Count the number of occurrences of each character that appears in the matrix.
After counting, list each character entered and the number of occurrences;
2) Create a function that receives the first registered character as a parameter
in the matrix. The function must return a numeric data. If the character is
uppercase, return the result of this character divided by 10 in the function.
Otherwise, return the result of the character multiplied by 2;
Here is the output test:
***************************************************************
Output:
Please, enter the matrix dimension (number): 2
Thanks! Your matrix wil be mtx[2][2]:
Now populate the mtx[2][2].
Enter letter for index:
mtx[0][0]: G
mtx[0][1]: i
mtx[1][0]: l
mtx[1][1]: l
Printing the matrix in the screen:
G i
l l
The frequencies of characters in a matrix are:
G/g occurs 1 times.
I/i occurs 1 times.
L/l occurs 2 times.
Math Operation:
G is the First Character entered in the matrix and its numeric value is 71;
if we take 71 and divide by 10 we get 7.
***************************************************************
Based: Projects 49, 51 & 58 :)
Edited by J3
Date: Jul, 20/2020
*/
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
int ROW;
int COLUMN;
int b, c;
int i, j;
char mtx[10][10];
int size = 0;
int c = 0, count[26] = {0}, x, sum;
/* prototype function */
int getFirstChar(int c);
int main()
{
/* Ask for the Matrix dimension - Entering a number between 1 & 10 */
printf("Please, enter the matrix dimension (number): ");
scanf("%d", &size);
while(size > 10 || size == 0 )
{
while((c = getchar()) != '\n' && c != EOF){};
printf("Please, the matrix size must be in the range of 1-10\n:");
scanf("%d", &size);
}
ROW = size;
COLUMN = size;
printf("Thanks! Your matrix wil be mtx[%d][%d]:\n", size, size);
printf("Now populate the mtx[%d][%d].\nEnter letter for index:\n", size, size);
for(i = 0; i < ROW; i ++)
{
for(j = 0; j < COLUMN; j++)
{
mtx[size][size];
while((c = getchar()) != '\n' && c != EOF){};
printf("mtx[%d][%d]: ", i, j);
scanf_s("%c", &mtx[i][j]);
}
}
// Displaying the Matrix in the screen
printf("\nPrinting the matrix in the screen:\n");
for (i = 0; i < ROW; i++)
{
for (j = 0; j < COLUMN; j++)
{
printf("%c\t", mtx[i][j]);
}
printf("\n");
}
for (i = 0; i < ROW; i++)
{
for (j = 0; j < COLUMN; j++)
{
/* Considering characters from 'a' to 'z' and 'A' to 'Z' */
if (mtx[i][j] >= 'a' && mtx[i][j] <= 'z')
{
x = mtx[i][j] - 'a';
count[x]++;
} else
if (mtx[i][j] >= 'A' && mtx[i][j] <= 'Z')
{
x = mtx[i][j] - 'A';
count[x]++;
}
}
}
/** Calculating the frequency table */
printf("\nThe frequencies of characters in a matrix are:\n");
for (c = 0; c < 26; c++)
if(count[c] != 0)
{
printf("%c/%c occurs %d times.\n", c + 'A',c + 'a', count[c]);
}
/* Testing requirement 2 above */
printf("\nMath Operation:\n");
printf("%c is the First Character entered in the matrix and its numeric value is %d;\n", mtx[0][0], mtx[0][0]);
getFirstChar(mtx[0][0]);
return 0;
}
/* Function to addressing requirement 2 above */
int getFirstChar(int c)
{
if( isupper(c))
{
int r = c / 10;
printf("if we take %d and divide by 10 we get %d.", c, r);
return r;
}
else
{
int r = c * 2;
printf("if we take %d and multiply by 2 we get %d.", c, r);
return r;
}
}
|
the_stack_data/28263084.c | int *cmpval (const void *a, const void *b) {
return *(int *)b - *(int *)a;
}
int findKthLargest(int* nums, int numsSize, int k){
qsort(nums, numsSize, sizeof(int), cmpval);
return nums[k-1];
}
|
the_stack_data/179845.c | /*
* Copyright 2013 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* Stub routine for `tcsendbreak' for porting support.
*/
#include <errno.h>
int tcsendbreak(int fd, int duration) {
errno = ENOSYS;
return -1;
}
|
the_stack_data/717579.c | // portable uri, relative, absolute path handling
// - rlyeh, public domain.
// assumes:
// /----------path---------\
// /--addr--\/-----base----\/--file--\
// spec://host:port/folder1/folder2/name.type
// example:
// http://192.168.1.1:1234/dev/home/name.ext1.ext2
//
// spec: http://
// addr: 192.168.1.1:1234
// host: 192.168.1.1
// port: 1234
// path: /dev/home/name.ext1.ext2
// base: /dev/home/
// file: name.ext1.ext2
// name: file
// type: .ext1.ext2
//
#ifndef URI_H
#define URI_H
// api
#ifndef URI_MAXPATH
#define URI_MAXPATH 4096
#endif
char *uri_spec( char output[URI_MAXPATH], const char *uri );
char *uri_addr( char output[URI_MAXPATH], const char *uri );
char *uri_host( char output[URI_MAXPATH], const char *uri );
char *uri_port( char output[URI_MAXPATH], const char *uri );
char *uri_full( char output[URI_MAXPATH], const char *uri );
char *uri_path( char output[URI_MAXPATH], const char *uri );
char *uri_file( char output[URI_MAXPATH], const char *uri );
char *uri_name( char output[URI_MAXPATH], const char *uri );
char *uri_type( char output[URI_MAXPATH], const char *uri );
// query
int uri_isdir( const char *uri );
int uri_isbin( const char *uri );
int uri_isabs( const char *uri );
int uri_isrel( const char *uri );
int uri_isnorm( const char *uri );
// util
char *uri_norm( char output[URI_MAXPATH], const char *uri );
#endif
// ----------------------------------------------------------------------------
#ifdef URI_C
#pragma once
//#include "engine.h"
#include <string.h>
#include <stdio.h>
#if defined(_MSC_VER) && !defined(snprintf)
#define snprintf _snprintf
#endif
char *uri_spec( char output[URI_MAXPATH], const char *uri ) {
const char *found = strstr( uri, "://" );
snprintf( output, URI_MAXPATH, "%.*s", (int)(found ? found - uri + 3 : 0), uri );
return output;
}
char *uri_addr( char output[URI_MAXPATH], const char *uri ) {
const char *addr = &uri[strlen(uri_spec(output, uri))];
const char *colon = strchr( addr, ':'), *slash = strchr( addr, '/');
if( colon ) {
snprintf( output, URI_MAXPATH, "%.*s", (int)(slash ? slash - addr : strlen(addr)), addr );
} else {
output[ 0 ] = 0;
}
return output;
}
char *uri_host( char output[URI_MAXPATH], const char *uri ) {
const char *addr = &uri[strlen(uri_spec(output, uri))];
const char *colon = strchr( addr, ':' ), *slash = strchr( addr, '/' );
if( colon ) {
colon = colon && slash ? ( colon < slash ? colon : slash ) : (colon < slash ? slash : colon);
snprintf( output, URI_MAXPATH, "%.*s", (int)(colon ? colon - addr : 0), colon ? addr : "" );
} else {
output[0] = 0;
}
return output;
}
char *uri_port( char output[URI_MAXPATH], const char *uri ) {
const char *addr = &uri[strlen(uri_spec(output, uri))];
const char *colon = strchr( addr, ':' ), *colon2 = colon ? colon+1 : "";
const char *slash = strchr( addr, '/' );
snprintf( output, URI_MAXPATH, "%.*s", (int)(slash && colon ? slash-1 - colon : strlen(colon2)), colon2 );
return output;
}
char *uri_full( char output[URI_MAXPATH], const char *uri ) {
const char *addr = &uri[strlen(uri_spec(output, uri))];
const char *colon = strchr( addr, ':'), *slash = strchr( addr, '/' );
if( colon ) {
snprintf( output, URI_MAXPATH, "%.*s", (int)(slash ? strlen(slash) : strlen(addr)), slash ? slash : addr );
if( strchr(output, ':') ) output[0] = 0;
} else {
snprintf( output, URI_MAXPATH, "%s", addr );
}
return output;
}
char *uri_path( char output[URI_MAXPATH], const char *uri ) {
char *s = strrchr( uri_full(output, uri), '/' );
return s ? (s[1] = '\0', output) : (output[0] = '\0', output);
}
char *uri_file( char output[URI_MAXPATH], const char *uri ) {
char *s = strrchr( uri_full(output, uri), '/' );
const char *alt = !s && strrchr(uri, ':') ? "" : uri;
return strcpy( output, s ? s+1 : alt );
}
char *uri_name( char output[URI_MAXPATH], const char *uri ) {
char *t = strchr( uri_file( output, uri ), '.' );
return t ? (t[0] = 0, output) : output;
}
char *uri_type( char output[URI_MAXPATH], const char *uri ) {
char *s = strchr( uri_file( output, uri ), '.' );
return strcpy( output, s ? s : "" );
}
char *uri_norm( char output[URI_MAXPATH], const char *uri ) {
int i = 0;
for( ; uri[i] ; ++i ) {
output[i] = uri[i] == '\\' ? '/' : uri[i];
}
// !: add extra NUL in case user wants to add ending slash quickly.
// ie, uri_norm(output, uri); output[ strlen(output) ] = '/';
return output[i] = 0, output[i+1] = 0 /*!*/, output;
}
int uri_isdir( const char *uri ) {
return uri && uri[0] && uri[ strlen(uri) - 1 ] == '/';
}
int uri_isbin( const char *uri ) {
return uri && !uri_isdir(uri);
}
int uri_isabs( const char *uri ) {
return uri && uri[0] && (uri[0] == '/' || uri[1] == ':');
}
int uri_isrel( const char *uri ) {
return uri && !uri_isabs( uri );
}
int uri_isnorm( const char *uri ) {
return uri && strchr(uri, '\\') == 0;
}
#endif
#ifdef URI_DEMO
#include <assert.h>
#include <stdio.h>
int main() {
// sample
char buf[URI_MAXPATH];
printf( "%s\n", "http://192.168.1.1:1234/dev/home/name.ext1.ext2" );
printf( "\tnorm: %s\n", uri_norm(buf, "http://192.168.1.1:1234\\dev\\home\\name.ext1.ext2") );
printf( "\tspec: %s\n", uri_spec(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\taddr: %s\n", uri_addr(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\thost: %s\n", uri_host(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\tport: %s\n", uri_port(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\tpath: %s\n", uri_full(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\tbase: %s\n", uri_path(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\tfile: %s\n", uri_file(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\tname: %s\n", uri_name(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
printf( "\ttype: %s\n", uri_type(buf, "http://192.168.1.1:1234/dev/home/name.ext1.ext2") );
// tests
#define spec "spec://"
#define host "host"
#define port "port"
#define addr host ":" port
#define name "name"
#define type ".ext1.ext2"
#define file name type
#define base "/folder1/folder2/"
#define path base file
#define full spec addr path
#define testURL(expr, spec, addr,host,port, path ) \
assert( 0 == strcmp(uri_spec(buf, ""expr), ""spec ) ); \
assert( 0 == strcmp(uri_addr(buf, ""expr), ""addr ) ); \
assert( 0 == strcmp(uri_host(buf, ""expr), ""host ) ); \
assert( 0 == strcmp(uri_port(buf, ""expr), ""port ) ); \
assert( 0 == strcmp(uri_full(buf, ""expr), ""path ) );
#define testPATH(expr, path, base,file, name,type) \
assert( 0 == strcmp(uri_full(buf, ""expr), ""path ) ); \
assert( 0 == strcmp(uri_path(buf, ""expr), ""base ) ); \
assert( 0 == strcmp(uri_file(buf, ""expr), ""file ) ); \
assert( 0 == strcmp(uri_name(buf, ""expr), ""name ) ); \
assert( 0 == strcmp(uri_type(buf, ""expr), ""type ) );
#define testALL(expr, spec, addr,host,port, path, base,file, name,type) \
testURL(expr,spec,addr,host,port,path); \
testPATH(expr,path, base,file, name,type);
if( "test many spec and/or addr and/or path combinations" ) {
testALL( , , , , , , , , , );
testALL( path, , , , , path ,base,file,name,type );
testALL( addr , , addr,host,port, , , , , );
testALL( addr path, , addr,host,port, path ,base,file,name,type );
testALL( spec , spec, , , , , , , , );
testALL( spec path, spec, , , , path ,base,file,name,type );
testALL( spec addr , spec, addr,host,port, , , , , );
testALL( spec addr path, spec, addr,host,port, path ,base,file,name,type );
testALL( type, , , , , type, ,type, ,type );
testALL( name , , , , , name, ,name,name, );
testALL( name type, , , , , name type, ,file,name,type );
testALL( base , , , , , base ,base, , , );
testALL( base type, , , , , base type,base,type, ,type );
testALL( base name , , , , , base name ,base,name,name, );
testALL( base name type, , , , , base name type,base,file,name,type );
}
if( "test more readable examples as well" ) {
testURL( "http://192.168.1.1:1234/dev/home/file", "http://", "192.168.1.1:1234", "192.168.1.1", "1234", "/dev/home/file" );
testURL( "file://lala:3201", "file://", "lala:3201", "lala", "3201", "");
testURL( "file:///dev/home", "file://", "", "", "", "/dev/home");
testURL( "tcp://server:3204/resource", "tcp://", "server:3204", "server", "3204", "/resource");
testURL( "tcp://server:3202", "tcp://", "server:3202", "server", "3202", "");
testURL( "tcp://server:/", "tcp://", "server:", "server", "", "/");
testURL( "tcp://file", "tcp://", "", "", "", "file");
testURL( "lala:1234/lala2", "", "lala:1234", "lala", "1234", "/lala2" );
testURL( "lala:1234", "", "lala:1234", "lala", "1234", "" );
testURL( "/lala/lala2", "", "", "", "", "/lala/lala2" );
testURL( "lala", "", "", "", "", "lala" );
testURL( "../~.home/lala/lala2", "", "", "", "", "../~.home/lala/lala2" );
testPATH( "../~.home/lala/lala2..ext2", "../~.home/lala/lala2..ext2", "../~.home/lala/", "lala2..ext2", "lala2", "..ext2" );
}
if( "random tests from another project" ) {
assert( 0 == strcmp( uri_norm(buf, "c:\\hello.txt"), "c:/hello.txt") );
assert( 0 == strcmp( uri_norm(buf, "/A\\b//c"), "/A/b//c") );
assert( 0 == strcmp( uri_full(buf, "/ab/c.e.xt"), "/ab/c.e.xt") );
assert( 0 == strcmp( uri_path(buf, "/ab/c.e.xt"), "/ab/") );
assert( 0 == strcmp( uri_file(buf, "/ab/c.e.xt"), "c.e.xt") );
assert( 0 == strcmp( uri_name(buf, "/ab/c.e.xt"), "c") );
assert( 0 == strcmp( uri_type(buf, "/ab/c.e.xt"), ".e.xt") );
assert( 0 == strcmp( uri_full(buf, "c.e.xt"), "c.e.xt") );
assert( 0 == strcmp( uri_path(buf, "c.e.xt"), "") );
assert( 0 == strcmp( uri_file(buf, "c.e.xt"), "c.e.xt") );
assert( 0 == strcmp( uri_name(buf, "c.e.xt"), "c") );
assert( 0 == strcmp( uri_type(buf, "c.e.xt"), ".e.xt") );
}
if( "sanity checks" ) {
assert(!uri_isnorm("c:\\hello.txt"));
assert(!uri_isdir(0));
assert(!uri_isbin(0));
assert(!uri_isabs(0));
assert(!uri_isrel(0));
assert( uri_isdir("~user/"));
assert( uri_isdir("/C/prj/"));
assert( uri_isdir("./data/"));
assert( uri_isbin("~user/abc.txt"));
assert( uri_isbin("/C/prj/abc.txt"));
assert( uri_isbin("./data/abc.txt"));
assert( uri_isrel("~user/abc.txt"));
assert( uri_isabs("/C/prj/abc.txt"));
assert( uri_isabs("C:/prj/abc.txt"));
assert( uri_isrel("./data/abc.txt"));
}
assert(~puts("Ok"));
}
#endif
|
the_stack_data/40764038.c | /*
* $Id: stdlib_main_stub.c,v 1.2 2006-01-08 12:04:25 obarthel Exp $
*
* :ts=4
*
* Portable ISO 'C' (1994) runtime library for the Amiga computer
* Copyright (c) 2002-2015 by Olaf Barthel <obarthel (at) gmx.net>
* All rights reserved.
*
* 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.
*
* - Neither the name of Olaf Barthel nor the names of 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.
*/
#if defined(__GNUC__)
/****************************************************************************/
/* The following is automatically called by the main() function through code
inserted by GCC. In theory, this could be removed by updating the machine
definition, but for now we'll just keep this stub around. It is intended
to call the constructor functions, but we do this in our own _main()
anyway. */
/****************************************************************************/
void __main(void);
/****************************************************************************/
void
__main(void)
{
}
/****************************************************************************/
#endif /* __GNUC__ */
|
the_stack_data/1149518.c | /* typedef scope in preprocessor: here "cookie" is not a typedef */
/* Case used to avoid quick fixes for typedef06.c */
typedef int f(int cookie);
typedef int (*g)(int);
f typedef07;
/* Not supported by preprocessor */
/* int typedef07(int cookie) {return cookie;} */
int typedef07(int cookie)
{return cookie;}
|
the_stack_data/103265263.c | #include <stdio.h>
void func(void);
int main(int argc,char *argv[])
{
func();
func();
}
void func()
{
static int a = 5;
printf("a=%d\n",a);
a *= 2;
}
|
the_stack_data/136541.c | /* Teensyduino Core Library
* http://www.pjrc.com/teensy/
* Copyright (c) 2017 PJRC.COM, LLC.
*
* 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:
*
* 1. The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* 2. If the Software is incorporated into a build system that allows
* selection among a list of target devices, then similar target
* devices manufactured by PJRC.COM must be included in the list of
* target devices and selectable in the same manner.
*
* 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.
*/
#if F_CPU >= 20000000
#define USB_DESC_LIST_DEFINE
#include "usb_desc.h"
#ifdef NUM_ENDPOINTS
#include "usb_names.h"
#include "kinetis.h"
#include "avr_functions.h"
// USB Descriptors are binary data which the USB host reads to
// automatically detect a USB device's capabilities. The format
// and meaning of every field is documented in numerous USB
// standards. When working with USB descriptors, despite the
// complexity of the standards and poor writing quality in many
// of those documents, remember descriptors are nothing more
// than constant binary data that tells the USB host what the
// device can do. Computers will load drivers based on this data.
// Those drivers then communicate on the endpoints specified by
// the descriptors.
// To configure a new combination of interfaces or make minor
// changes to existing configuration (eg, change the name or ID
// numbers), usually you would edit "usb_desc.h". This file
// is meant to be configured by the header, so generally it is
// only edited to add completely new USB interfaces or features.
// **************************************************************
// USB Device
// **************************************************************
#define LSB(n) ((n) & 255)
#define MSB(n) (((n) >> 8) & 255)
// USB Device Descriptor. The USB host reads this first, to learn
// what type of device is connected.
static uint8_t device_descriptor[] = {
18, // bLength
1, // bDescriptorType
0x01, 0x01, // bcdUSB
#ifdef DEVICE_CLASS
DEVICE_CLASS, // bDeviceClass
#else
0,
#endif
#ifdef DEVICE_SUBCLASS
DEVICE_SUBCLASS, // bDeviceSubClass
#else
0,
#endif
#ifdef DEVICE_PROTOCOL
DEVICE_PROTOCOL, // bDeviceProtocol
#else
0,
#endif
EP0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
#ifdef BCD_DEVICE
LSB(BCD_DEVICE), MSB(BCD_DEVICE), // bcdDevice
#else
0x00, 0x02,
#endif
1, // iManufacturer
2, // iProduct
3, // iSerialNumber
1 // bNumConfigurations
};
// These descriptors must NOT be "const", because the USB DMA
// has trouble accessing flash memory with enough bandwidth
// while the processor is executing from flash.
// **************************************************************
// HID Report Descriptors
// **************************************************************
// Each HID interface needs a special report descriptor that tells
// the meaning and format of the data.
#ifdef KEYBOARD_INTERFACE
// Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
static uint8_t keyboard_report_desc[] = {
0x05, 0x01, // Usage Page (Generic Desktop),
0x09, 0x06, // Usage (Keyboard),
0xA1, 0x01, // Collection (Application),
0x75, 0x01, // Report Size (1),
0x95, 0x08, // Report Count (8),
0x05, 0x07, // Usage Page (Key Codes),
0x19, 0xE0, // Usage Minimum (224),
0x29, 0xE7, // Usage Maximum (231),
0x15, 0x00, // Logical Minimum (0),
0x25, 0x01, // Logical Maximum (1),
0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier keys
0x95, 0x01, // Report Count (1),
0x75, 0x08, // Report Size (8),
0x81, 0x03, // Input (Constant), ;Reserved byte
0x95, 0x05, // Report Count (5),
0x75, 0x01, // Report Size (1),
0x05, 0x08, // Usage Page (LEDs),
0x19, 0x01, // Usage Minimum (1),
0x29, 0x05, // Usage Maximum (5),
0x91, 0x02, // Output (Data, Variable, Absolute), ;LED report
0x95, 0x01, // Report Count (1),
0x75, 0x03, // Report Size (3),
0x91, 0x03, // Output (Constant), ;LED report padding
0x95, 0x06, // Report Count (6),
0x75, 0x08, // Report Size (8),
0x15, 0x00, // Logical Minimum (0),
0x25, 0x7F, // Logical Maximum(104),
0x05, 0x07, // Usage Page (Key Codes),
0x19, 0x00, // Usage Minimum (0),
0x29, 0x7F, // Usage Maximum (104),
0x81, 0x00, // Input (Data, Array), ;Normal keys
0xC0 // End Collection
};
#endif
#ifdef KEYMEDIA_INTERFACE
static uint8_t keymedia_report_desc[] = {
0x05, 0x0C, // Usage Page (Consumer)
0x09, 0x01, // Usage (Consumer Controls)
0xA1, 0x01, // Collection (Application)
0x75, 0x0A, // Report Size (10)
0x95, 0x04, // Report Count (4)
0x19, 0x00, // Usage Minimum (0)
0x2A, 0x9C, 0x02, // Usage Maximum (0x29C)
0x15, 0x00, // Logical Minimum (0)
0x26, 0x9C, 0x02, // Logical Maximum (0x29C)
0x81, 0x00, // Input (Data, Array)
0x05, 0x01, // Usage Page (Generic Desktop)
0x75, 0x08, // Report Size (8)
0x95, 0x03, // Report Count (3)
0x19, 0x00, // Usage Minimum (0)
0x29, 0xB7, // Usage Maximum (0xB7)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xB7, 0x00, // Logical Maximum (0xB7)
0x81, 0x00, // Input (Data, Array)
0xC0 // End Collection
};
#endif
#ifdef MOUSE_INTERFACE
// Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
static uint8_t mouse_report_desc[] = {
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x02, // Usage (Mouse)
0xA1, 0x01, // Collection (Application)
0x85, 0x01, // REPORT_ID (1)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (Button #1)
0x29, 0x08, // Usage Maximum (Button #8)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x95, 0x08, // Report Count (8)
0x75, 0x01, // Report Size (1)
0x81, 0x02, // Input (Data, Variable, Absolute)
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x38, // Usage (Wheel)
0x15, 0x81, // Logical Minimum (-127)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x08, // Report Size (8),
0x95, 0x03, // Report Count (3),
0x81, 0x06, // Input (Data, Variable, Relative)
0x05, 0x0C, // Usage Page (Consumer)
0x0A, 0x38, 0x02, // Usage (AC Pan)
0x15, 0x81, // Logical Minimum (-127)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x08, // Report Size (8),
0x95, 0x01, // Report Count (1),
0x81, 0x06, // Input (Data, Variable, Relative)
0xC0, // End Collection
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x02, // Usage (Mouse)
0xA1, 0x01, // Collection (Application)
0x85, 0x02, // REPORT_ID (2)
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x7F, // Logical Maximum (32767)
0x75, 0x10, // Report Size (16),
0x95, 0x02, // Report Count (2),
0x81, 0x02, // Input (Data, Variable, Absolute)
0xC0 // End Collection
};
#endif
#ifdef JOYSTICK_INTERFACE
#if JOYSTICK_SIZE == 12
static uint8_t joystick_report_desc[] = {
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x04, // Usage (Joystick)
0xA1, 0x01, // Collection (Application)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x20, // Report Count (32)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (Button #1)
0x29, 0x20, // Usage Maximum (Button #32)
0x81, 0x02, // Input (variable,absolute)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x07, // Logical Maximum (7)
0x35, 0x00, // Physical Minimum (0)
0x46, 0x3B, 0x01, // Physical Maximum (315)
0x75, 0x04, // Report Size (4)
0x95, 0x01, // Report Count (1)
0x65, 0x14, // Unit (20)
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x39, // Usage (Hat switch)
0x81, 0x42, // Input (variable,absolute,null_state)
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection ()
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x03, // Logical Maximum (1023)
0x75, 0x0A, // Report Size (10)
0x95, 0x04, // Report Count (4)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x32, // Usage (Z)
0x09, 0x35, // Usage (Rz)
0x81, 0x02, // Input (variable,absolute)
0xC0, // End Collection
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x03, // Logical Maximum (1023)
0x75, 0x0A, // Report Size (10)
0x95, 0x02, // Report Count (2)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x81, 0x02, // Input (variable,absolute)
0xC0 // End Collection
};
#elif JOYSTICK_SIZE == 64
// extreme joystick (to use this, edit JOYSTICK_SIZE to 64 in usb_desc.h)
// 128 buttons 16
// 6 axes 12
// 17 sliders 34
// 4 pov 2
static uint8_t joystick_report_desc[] = {
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x04, // Usage (Joystick)
0xA1, 0x01, // Collection (Application)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x80, // Report Count (128)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (Button #1)
0x29, 0x80, // Usage Maximum (Button #128)
0x81, 0x02, // Input (variable,absolute)
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection ()
0x15, 0x00, // Logical Minimum (0)
0x27, 0xFF, 0xFF, 0, 0, // Logical Maximum (65535)
0x75, 0x10, // Report Size (16)
0x95, 23, // Report Count (23)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x32, // Usage (Z)
0x09, 0x33, // Usage (Rx)
0x09, 0x34, // Usage (Ry)
0x09, 0x35, // Usage (Rz)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x09, 0x36, // Usage (Slider)
0x81, 0x02, // Input (variable,absolute)
0xC0, // End Collection
0x15, 0x00, // Logical Minimum (0)
0x25, 0x07, // Logical Maximum (7)
0x35, 0x00, // Physical Minimum (0)
0x46, 0x3B, 0x01, // Physical Maximum (315)
0x75, 0x04, // Report Size (4)
0x95, 0x04, // Report Count (4)
0x65, 0x14, // Unit (20)
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x39, // Usage (Hat switch)
0x09, 0x39, // Usage (Hat switch)
0x09, 0x39, // Usage (Hat switch)
0x09, 0x39, // Usage (Hat switch)
0x81, 0x42, // Input (variable,absolute,null_state)
0xC0 // End Collection
};
#endif // JOYSTICK_SIZE
#endif // JOYSTICK_INTERFACE
#ifdef MULTITOUCH_INTERFACE
// https://forum.pjrc.com/threads/32331-USB-HID-Touchscreen-support-needed
// https://msdn.microsoft.com/en-us/library/windows/hardware/jj151563%28v=vs.85%29.aspx
// https://msdn.microsoft.com/en-us/library/windows/hardware/jj151565%28v=vs.85%29.aspx
// https://msdn.microsoft.com/en-us/library/windows/hardware/ff553734%28v=vs.85%29.aspx
// https://msdn.microsoft.com/en-us/library/windows/hardware/jj151564%28v=vs.85%29.aspx
// download.microsoft.com/download/a/d/f/adf1347d-08dc-41a4-9084-623b1194d4b2/digitizerdrvs_touch.docx
static uint8_t multitouch_report_desc[] = {
0x05, 0x0D, // Usage Page (Digitizer)
0x09, 0x04, // Usage (Touch Screen)
0xa1, 0x01, // Collection (Application)
0x09, 0x22, // Usage (Finger)
0xA1, 0x02, // Collection (Logical)
0x09, 0x42, // Usage (Tip Switch)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (variable,absolute)
0x09, 0x30, // Usage (Pressure)
0x25, 0x7F, // Logical Maximum (127)
0x75, 0x07, // Report Size (7)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (variable,absolute)
0x09, 0x51, // Usage (Contact Identifier)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (variable,absolute)
0x05, 0x01, // Usage Page (Generic Desktop)
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x26, 0xFF, 0x7F, // Logical Maximum (32767)
0x65, 0x00, // Unit (None) <-- probably needs real units?
0x75, 0x10, // Report Size (16)
0x95, 0x02, // Report Count (2)
0x81, 0x02, // Input (variable,absolute)
0xC0, // End Collection
0x05, 0x0D, // Usage Page (Digitizer)
0x27, 0xFF, 0xFF, 0, 0, // Logical Maximum (65535)
0x75, 0x10, // Report Size (16)
0x95, 0x01, // Report Count (1)
0x09, 0x56, // Usage (Scan Time)
0x81, 0x02, // Input (variable,absolute)
0x09, 0x54, // Usage (Contact Count)
0x25, MULTITOUCH_FINGERS, // Logical Maximum (10)
0x75, 0x08, // Report Size (8)
0x95, 0x01, // Report Count (1)
0x81, 0x02, // Input (variable,absolute)
0x05, 0x0D, // Usage Page (Digitizers)
0x09, 0x55, // Usage (Contact Count Maximum)
0x25, MULTITOUCH_FINGERS, // Logical Maximum (10)
0x75, 0x08, // Report Size (8)
0x95, 0x01, // Report Count (1)
0xB1, 0x02, // Feature (variable,absolute)
0xC0 // End Collection
};
#endif
#ifdef SEREMU_INTERFACE
static uint8_t seremu_report_desc[] = {
0x06, 0xC9, 0xFF, // Usage Page 0xFFC9 (vendor defined)
0x09, 0x04, // Usage 0x04
0xA1, 0x5C, // Collection 0x5C
0x75, 0x08, // report size = 8 bits (global)
0x15, 0x00, // logical minimum = 0 (global)
0x26, 0xFF, 0x00, // logical maximum = 255 (global)
0x95, SEREMU_TX_SIZE, // report count (global)
0x09, 0x75, // usage (local)
0x81, 0x02, // Input
0x95, SEREMU_RX_SIZE, // report count (global)
0x09, 0x76, // usage (local)
0x91, 0x02, // Output
0x95, 0x04, // report count (global)
0x09, 0x76, // usage (local)
0xB1, 0x02, // Feature
0xC0 // end collection
};
#endif
#ifdef RAWHID_INTERFACE
static uint8_t rawhid_report_desc[] = {
0x06, LSB(RAWHID_USAGE_PAGE), MSB(RAWHID_USAGE_PAGE),
0x0A, LSB(RAWHID_USAGE), MSB(RAWHID_USAGE),
0xA1, 0x01, // Collection 0x01
0x75, 0x08, // report size = 8 bits
0x15, 0x00, // logical minimum = 0
0x26, 0xFF, 0x00, // logical maximum = 255
0x95, RAWHID_TX_SIZE, // report count
0x09, 0x01, // usage
0x81, 0x02, // Input (array)
0x95, RAWHID_RX_SIZE, // report count
0x09, 0x02, // usage
0x91, 0x02, // Output (array)
0xC0 // end collection
};
#endif
#ifdef FLIGHTSIM_INTERFACE
static uint8_t flightsim_report_desc[] = {
0x06, 0x1C, 0xFF, // Usage page = 0xFF1C
0x0A, 0x39, 0xA7, // Usage = 0xA739
0xA1, 0x01, // Collection 0x01
0x75, 0x08, // report size = 8 bits
0x15, 0x00, // logical minimum = 0
0x26, 0xFF, 0x00, // logical maximum = 255
0x95, FLIGHTSIM_TX_SIZE, // report count
0x09, 0x01, // usage
0x81, 0x02, // Input (array)
0x95, FLIGHTSIM_RX_SIZE, // report count
0x09, 0x02, // usage
0x91, 0x02, // Output (array)
0xC0 // end collection
};
#endif
// **************************************************************
// USB Descriptor Sizes
// **************************************************************
// pre-compute the size and position of everything in the config descriptor
//
#define CONFIG_HEADER_DESCRIPTOR_SIZE 9
#define CDC_IAD_DESCRIPTOR_POS CONFIG_HEADER_DESCRIPTOR_SIZE
#ifdef CDC_IAD_DESCRIPTOR
#define CDC_IAD_DESCRIPTOR_SIZE 8
#else
#define CDC_IAD_DESCRIPTOR_SIZE 0
#endif
#define CDC_DATA_INTERFACE_DESC_POS CDC_IAD_DESCRIPTOR_POS+CDC_IAD_DESCRIPTOR_SIZE
#ifdef CDC_DATA_INTERFACE
#define CDC_DATA_INTERFACE_DESC_SIZE 9+5+5+4+5+7+9+7+7
#else
#define CDC_DATA_INTERFACE_DESC_SIZE 0
#endif
#define MIDI_INTERFACE_DESC_POS CDC_DATA_INTERFACE_DESC_POS+CDC_DATA_INTERFACE_DESC_SIZE
#ifdef MIDI_INTERFACE
#if !defined(MIDI_NUM_CABLES) || MIDI_NUM_CABLES < 1 || MIDI_NUM_CABLES > 16
#error "MIDI_NUM_CABLES must be defined between 1 to 16"
#endif
#define MIDI_INTERFACE_DESC_SIZE 9+7+((6+6+9+9)*MIDI_NUM_CABLES)+(9+4+MIDI_NUM_CABLES)*2
#else
#define MIDI_INTERFACE_DESC_SIZE 0
#endif
#define KEYBOARD_INTERFACE_DESC_POS MIDI_INTERFACE_DESC_POS+MIDI_INTERFACE_DESC_SIZE
#ifdef KEYBOARD_INTERFACE
#define KEYBOARD_INTERFACE_DESC_SIZE 9+9+7
#define KEYBOARD_HID_DESC_OFFSET KEYBOARD_INTERFACE_DESC_POS+9
#else
#define KEYBOARD_INTERFACE_DESC_SIZE 0
#endif
#define MOUSE_INTERFACE_DESC_POS KEYBOARD_INTERFACE_DESC_POS+KEYBOARD_INTERFACE_DESC_SIZE
#ifdef MOUSE_INTERFACE
#define MOUSE_INTERFACE_DESC_SIZE 9+9+7
#define MOUSE_HID_DESC_OFFSET MOUSE_INTERFACE_DESC_POS+9
#else
#define MOUSE_INTERFACE_DESC_SIZE 0
#endif
#define RAWHID_INTERFACE_DESC_POS MOUSE_INTERFACE_DESC_POS+MOUSE_INTERFACE_DESC_SIZE
#ifdef RAWHID_INTERFACE
#define RAWHID_INTERFACE_DESC_SIZE 9+9+7+7
#define RAWHID_HID_DESC_OFFSET RAWHID_INTERFACE_DESC_POS+9
#else
#define RAWHID_INTERFACE_DESC_SIZE 0
#endif
#define FLIGHTSIM_INTERFACE_DESC_POS RAWHID_INTERFACE_DESC_POS+RAWHID_INTERFACE_DESC_SIZE
#ifdef FLIGHTSIM_INTERFACE
#define FLIGHTSIM_INTERFACE_DESC_SIZE 9+9+7+7
#define FLIGHTSIM_HID_DESC_OFFSET FLIGHTSIM_INTERFACE_DESC_POS+9
#else
#define FLIGHTSIM_INTERFACE_DESC_SIZE 0
#endif
#define SEREMU_INTERFACE_DESC_POS FLIGHTSIM_INTERFACE_DESC_POS+FLIGHTSIM_INTERFACE_DESC_SIZE
#ifdef SEREMU_INTERFACE
#define SEREMU_INTERFACE_DESC_SIZE 9+9+7+7
#define SEREMU_HID_DESC_OFFSET SEREMU_INTERFACE_DESC_POS+9
#else
#define SEREMU_INTERFACE_DESC_SIZE 0
#endif
#define JOYSTICK_INTERFACE_DESC_POS SEREMU_INTERFACE_DESC_POS+SEREMU_INTERFACE_DESC_SIZE
#ifdef JOYSTICK_INTERFACE
#define JOYSTICK_INTERFACE_DESC_SIZE 9+9+7
#define JOYSTICK_HID_DESC_OFFSET JOYSTICK_INTERFACE_DESC_POS+9
#else
#define JOYSTICK_INTERFACE_DESC_SIZE 0
#endif
#define MTP_INTERFACE_DESC_POS JOYSTICK_INTERFACE_DESC_POS+JOYSTICK_INTERFACE_DESC_SIZE
#ifdef MTP_INTERFACE
#define MTP_INTERFACE_DESC_SIZE 9+7+7+7
#else
#define MTP_INTERFACE_DESC_SIZE 0
#endif
#define KEYMEDIA_INTERFACE_DESC_POS MTP_INTERFACE_DESC_POS+MTP_INTERFACE_DESC_SIZE
#ifdef KEYMEDIA_INTERFACE
#define KEYMEDIA_INTERFACE_DESC_SIZE 9+9+7
#define KEYMEDIA_HID_DESC_OFFSET KEYMEDIA_INTERFACE_DESC_POS+9
#else
#define KEYMEDIA_INTERFACE_DESC_SIZE 0
#endif
#define AUDIO_INTERFACE_DESC_POS KEYMEDIA_INTERFACE_DESC_POS+KEYMEDIA_INTERFACE_DESC_SIZE
#ifdef AUDIO_INTERFACE
#define AUDIO_INTERFACE_DESC_SIZE 8 + 9+10+12+9+12+10+9 + 9+9+7+11+9+7 + 9+9+7+11+9+7+9
#else
#define AUDIO_INTERFACE_DESC_SIZE 0
#endif
#define MULTITOUCH_INTERFACE_DESC_POS AUDIO_INTERFACE_DESC_POS+AUDIO_INTERFACE_DESC_SIZE
#ifdef MULTITOUCH_INTERFACE
#define MULTITOUCH_INTERFACE_DESC_SIZE 9+9+7
#define MULTITOUCH_HID_DESC_OFFSET MULTITOUCH_INTERFACE_DESC_POS+9
#else
#define MULTITOUCH_INTERFACE_DESC_SIZE 0
#endif
#define CONFIG_DESC_SIZE MULTITOUCH_INTERFACE_DESC_POS+MULTITOUCH_INTERFACE_DESC_SIZE
// **************************************************************
// USB Configuration
// **************************************************************
// USB Configuration Descriptor. This huge descriptor tells all
// of the devices capbilities.
static uint8_t config_descriptor[CONFIG_DESC_SIZE] = {
// configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
9, // bLength;
2, // bDescriptorType;
LSB(CONFIG_DESC_SIZE), // wTotalLength
MSB(CONFIG_DESC_SIZE),
NUM_INTERFACE, // bNumInterfaces
1, // bConfigurationValue
0, // iConfiguration
0xC0, // bmAttributes
50, // bMaxPower
#ifdef CDC_IAD_DESCRIPTOR
// interface association descriptor, USB ECN, Table 9-Z
8, // bLength
11, // bDescriptorType
CDC_STATUS_INTERFACE, // bFirstInterface
2, // bInterfaceCount
0x02, // bFunctionClass
0x02, // bFunctionSubClass
0x01, // bFunctionProtocol
4, // iFunction
#endif
#ifdef CDC_DATA_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
CDC_STATUS_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
1, // bNumEndpoints
0x02, // bInterfaceClass
0x02, // bInterfaceSubClass
0x01, // bInterfaceProtocol
0, // iInterface
// CDC Header Functional Descriptor, CDC Spec 5.2.3.1, Table 26
5, // bFunctionLength
0x24, // bDescriptorType
0x00, // bDescriptorSubtype
0x10, 0x01, // bcdCDC
// Call Management Functional Descriptor, CDC Spec 5.2.3.2, Table 27
5, // bFunctionLength
0x24, // bDescriptorType
0x01, // bDescriptorSubtype
0x01, // bmCapabilities
1, // bDataInterface
// Abstract Control Management Functional Descriptor, CDC Spec 5.2.3.3, Table 28
4, // bFunctionLength
0x24, // bDescriptorType
0x02, // bDescriptorSubtype
0x06, // bmCapabilities
// Union Functional Descriptor, CDC Spec 5.2.3.8, Table 33
5, // bFunctionLength
0x24, // bDescriptorType
0x06, // bDescriptorSubtype
CDC_STATUS_INTERFACE, // bMasterInterface
CDC_DATA_INTERFACE, // bSlaveInterface0
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
CDC_ACM_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
CDC_ACM_SIZE, 0, // wMaxPacketSize
64, // bInterval
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
CDC_DATA_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
2, // bNumEndpoints
0x0A, // bInterfaceClass
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0, // iInterface
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
CDC_RX_ENDPOINT, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
CDC_RX_SIZE, 0, // wMaxPacketSize
0, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
CDC_TX_ENDPOINT | 0x80, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
CDC_TX_SIZE, 0, // wMaxPacketSize
0, // bInterval
#endif // CDC_DATA_INTERFACE
#ifdef MIDI_INTERFACE
// Standard MS Interface Descriptor,
9, // bLength
4, // bDescriptorType
MIDI_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
2, // bNumEndpoints
0x01, // bInterfaceClass (0x01 = Audio)
0x03, // bInterfaceSubClass (0x03 = MIDI)
0x00, // bInterfaceProtocol (unused for MIDI)
0, // iInterface
// MIDI MS Interface Header, USB MIDI 6.1.2.1, page 21, Table 6-2
7, // bLength
0x24, // bDescriptorType = CS_INTERFACE
0x01, // bDescriptorSubtype = MS_HEADER
0x00, 0x01, // bcdMSC = revision 01.00
LSB(7+(6+6+9+9)*MIDI_NUM_CABLES), // wTotalLength
MSB(7+(6+6+9+9)*MIDI_NUM_CABLES),
// MIDI IN Jack Descriptor, B.4.3, Table B-7 (embedded), page 40
6, // bLength
0x24, // bDescriptorType = CS_INTERFACE
0x02, // bDescriptorSubtype = MIDI_IN_JACK
0x01, // bJackType = EMBEDDED
1, // bJackID, ID = 1
0, // iJack
// MIDI IN Jack Descriptor, B.4.3, Table B-8 (external), page 40
6, // bLength
0x24, // bDescriptorType = CS_INTERFACE
0x02, // bDescriptorSubtype = MIDI_IN_JACK
0x02, // bJackType = EXTERNAL
2, // bJackID, ID = 2
0, // iJack
// MIDI OUT Jack Descriptor, B.4.4, Table B-9, page 41
9,
0x24, // bDescriptorType = CS_INTERFACE
0x03, // bDescriptorSubtype = MIDI_OUT_JACK
0x01, // bJackType = EMBEDDED
3, // bJackID, ID = 3
1, // bNrInputPins = 1 pin
2, // BaSourceID(1) = 2
1, // BaSourcePin(1) = first pin
0, // iJack
// MIDI OUT Jack Descriptor, B.4.4, Table B-10, page 41
9,
0x24, // bDescriptorType = CS_INTERFACE
0x03, // bDescriptorSubtype = MIDI_OUT_JACK
0x02, // bJackType = EXTERNAL
4, // bJackID, ID = 4
1, // bNrInputPins = 1 pin
1, // BaSourceID(1) = 1
1, // BaSourcePin(1) = first pin
0, // iJack
#if MIDI_NUM_CABLES >= 2
#define MIDI_INTERFACE_JACK_PAIR(a, b, c, d) \
6, 0x24, 0x02, 0x01, (a), 0, \
6, 0x24, 0x02, 0x02, (b), 0, \
9, 0x24, 0x03, 0x01, (c), 1, (b), 1, 0, \
9, 0x24, 0x03, 0x02, (d), 1, (a), 1, 0,
MIDI_INTERFACE_JACK_PAIR(5, 6, 7, 8)
#endif
#if MIDI_NUM_CABLES >= 3
MIDI_INTERFACE_JACK_PAIR(9, 10, 11, 12)
#endif
#if MIDI_NUM_CABLES >= 4
MIDI_INTERFACE_JACK_PAIR(13, 14, 15, 16)
#endif
#if MIDI_NUM_CABLES >= 5
MIDI_INTERFACE_JACK_PAIR(17, 18, 19, 20)
#endif
#if MIDI_NUM_CABLES >= 6
MIDI_INTERFACE_JACK_PAIR(21, 22, 23, 24)
#endif
#if MIDI_NUM_CABLES >= 7
MIDI_INTERFACE_JACK_PAIR(25, 26, 27, 28)
#endif
#if MIDI_NUM_CABLES >= 8
MIDI_INTERFACE_JACK_PAIR(29, 30, 31, 32)
#endif
#if MIDI_NUM_CABLES >= 9
MIDI_INTERFACE_JACK_PAIR(33, 34, 35, 36)
#endif
#if MIDI_NUM_CABLES >= 10
MIDI_INTERFACE_JACK_PAIR(37, 38, 39, 40)
#endif
#if MIDI_NUM_CABLES >= 11
MIDI_INTERFACE_JACK_PAIR(41, 42, 43, 44)
#endif
#if MIDI_NUM_CABLES >= 12
MIDI_INTERFACE_JACK_PAIR(45, 46, 47, 48)
#endif
#if MIDI_NUM_CABLES >= 13
MIDI_INTERFACE_JACK_PAIR(49, 50, 51, 52)
#endif
#if MIDI_NUM_CABLES >= 14
MIDI_INTERFACE_JACK_PAIR(53, 54, 55, 56)
#endif
#if MIDI_NUM_CABLES >= 15
MIDI_INTERFACE_JACK_PAIR(57, 58, 59, 60)
#endif
#if MIDI_NUM_CABLES >= 16
MIDI_INTERFACE_JACK_PAIR(61, 62, 63, 64)
#endif
// Standard Bulk OUT Endpoint Descriptor, B.5.1, Table B-11, pae 42
9, // bLength
5, // bDescriptorType = ENDPOINT
MIDI_RX_ENDPOINT, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MIDI_RX_SIZE, 0, // wMaxPacketSize
0, // bInterval
0, // bRefresh
0, // bSynchAddress
// Class-specific MS Bulk OUT Endpoint Descriptor, B.5.2, Table B-12, page 42
4+MIDI_NUM_CABLES, // bLength
0x25, // bDescriptorSubtype = CS_ENDPOINT
0x01, // bJackType = MS_GENERAL
MIDI_NUM_CABLES, // bNumEmbMIDIJack = number of jacks
1, // BaAssocJackID(1) = jack ID #1
#if MIDI_NUM_CABLES >= 2
5,
#endif
#if MIDI_NUM_CABLES >= 3
9,
#endif
#if MIDI_NUM_CABLES >= 4
13,
#endif
#if MIDI_NUM_CABLES >= 5
17,
#endif
#if MIDI_NUM_CABLES >= 6
21,
#endif
#if MIDI_NUM_CABLES >= 7
25,
#endif
#if MIDI_NUM_CABLES >= 8
29,
#endif
#if MIDI_NUM_CABLES >= 9
33,
#endif
#if MIDI_NUM_CABLES >= 10
37,
#endif
#if MIDI_NUM_CABLES >= 11
41,
#endif
#if MIDI_NUM_CABLES >= 12
45,
#endif
#if MIDI_NUM_CABLES >= 13
49,
#endif
#if MIDI_NUM_CABLES >= 14
53,
#endif
#if MIDI_NUM_CABLES >= 15
57,
#endif
#if MIDI_NUM_CABLES >= 16
61,
#endif
// Standard Bulk IN Endpoint Descriptor, B.5.1, Table B-11, pae 42
9, // bLength
5, // bDescriptorType = ENDPOINT
MIDI_TX_ENDPOINT | 0x80, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MIDI_TX_SIZE, 0, // wMaxPacketSize
0, // bInterval
0, // bRefresh
0, // bSynchAddress
// Class-specific MS Bulk IN Endpoint Descriptor, B.5.2, Table B-12, page 42
4+MIDI_NUM_CABLES, // bLength
0x25, // bDescriptorSubtype = CS_ENDPOINT
0x01, // bJackType = MS_GENERAL
MIDI_NUM_CABLES, // bNumEmbMIDIJack = number of jacks
3, // BaAssocJackID(1) = jack ID #3
#if MIDI_NUM_CABLES >= 2
7,
#endif
#if MIDI_NUM_CABLES >= 3
11,
#endif
#if MIDI_NUM_CABLES >= 4
15,
#endif
#if MIDI_NUM_CABLES >= 5
19,
#endif
#if MIDI_NUM_CABLES >= 6
23,
#endif
#if MIDI_NUM_CABLES >= 7
27,
#endif
#if MIDI_NUM_CABLES >= 8
31,
#endif
#if MIDI_NUM_CABLES >= 9
35,
#endif
#if MIDI_NUM_CABLES >= 10
39,
#endif
#if MIDI_NUM_CABLES >= 11
43,
#endif
#if MIDI_NUM_CABLES >= 12
47,
#endif
#if MIDI_NUM_CABLES >= 13
51,
#endif
#if MIDI_NUM_CABLES >= 14
55,
#endif
#if MIDI_NUM_CABLES >= 15
59,
#endif
#if MIDI_NUM_CABLES >= 16
63,
#endif
#endif // MIDI_INTERFACE
#ifdef KEYBOARD_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
KEYBOARD_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
1, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x01, // bInterfaceSubClass (0x01 = Boot)
0x01, // bInterfaceProtocol (0x01 = Keyboard)
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(keyboard_report_desc)), // wDescriptorLength
MSB(sizeof(keyboard_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
KEYBOARD_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
KEYBOARD_SIZE, 0, // wMaxPacketSize
KEYBOARD_INTERVAL, // bInterval
#endif // KEYBOARD_INTERFACE
#ifdef MOUSE_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
MOUSE_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
1, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass (0x01 = Boot)
0x00, // bInterfaceProtocol (0x02 = Mouse)
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(mouse_report_desc)), // wDescriptorLength
MSB(sizeof(mouse_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
MOUSE_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
MOUSE_SIZE, 0, // wMaxPacketSize
MOUSE_INTERVAL, // bInterval
#endif // MOUSE_INTERFACE
#ifdef RAWHID_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
RAWHID_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
2, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(rawhid_report_desc)), // wDescriptorLength
MSB(sizeof(rawhid_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
RAWHID_TX_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
RAWHID_TX_SIZE, 0, // wMaxPacketSize
RAWHID_TX_INTERVAL, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
RAWHID_RX_ENDPOINT, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
RAWHID_RX_SIZE, 0, // wMaxPacketSize
RAWHID_RX_INTERVAL, // bInterval
#endif // RAWHID_INTERFACE
#ifdef FLIGHTSIM_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
FLIGHTSIM_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
2, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(flightsim_report_desc)), // wDescriptorLength
MSB(sizeof(flightsim_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
FLIGHTSIM_TX_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
FLIGHTSIM_TX_SIZE, 0, // wMaxPacketSize
FLIGHTSIM_TX_INTERVAL, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
FLIGHTSIM_RX_ENDPOINT, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
FLIGHTSIM_RX_SIZE, 0, // wMaxPacketSize
FLIGHTSIM_RX_INTERVAL, // bInterval
#endif // FLIGHTSIM_INTERFACE
#ifdef SEREMU_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
SEREMU_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
2, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(seremu_report_desc)), // wDescriptorLength
MSB(sizeof(seremu_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
SEREMU_TX_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
SEREMU_TX_SIZE, 0, // wMaxPacketSize
SEREMU_TX_INTERVAL, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
SEREMU_RX_ENDPOINT, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
SEREMU_RX_SIZE, 0, // wMaxPacketSize
SEREMU_RX_INTERVAL, // bInterval
#endif // SEREMU_INTERFACE
#ifdef JOYSTICK_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
JOYSTICK_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
1, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(joystick_report_desc)), // wDescriptorLength
MSB(sizeof(joystick_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
JOYSTICK_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
JOYSTICK_SIZE, 0, // wMaxPacketSize
JOYSTICK_INTERVAL, // bInterval
#endif // JOYSTICK_INTERFACE
#ifdef MTP_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
MTP_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
3, // bNumEndpoints
0x06, // bInterfaceClass (0x06 = still image)
0x01, // bInterfaceSubClass
0x01, // bInterfaceProtocol
4, // iInterface
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
MTP_TX_ENDPOINT | 0x80, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MTP_TX_SIZE, 0, // wMaxPacketSize
0, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
MTP_RX_ENDPOINT, // bEndpointAddress
0x02, // bmAttributes (0x02=bulk)
MTP_RX_SIZE, 0, // wMaxPacketSize
0, // bInterval
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
MTP_EVENT_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
MTP_EVENT_SIZE, 0, // wMaxPacketSize
MTP_EVENT_INTERVAL, // bInterval
#endif // MTP_INTERFACE
#ifdef KEYMEDIA_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
KEYMEDIA_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
1, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(keymedia_report_desc)), // wDescriptorLength
MSB(sizeof(keymedia_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
KEYMEDIA_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
KEYMEDIA_SIZE, 0, // wMaxPacketSize
KEYMEDIA_INTERVAL, // bInterval
#endif // KEYMEDIA_INTERFACE
#ifdef AUDIO_INTERFACE
// interface association descriptor, USB ECN, Table 9-Z
8, // bLength
11, // bDescriptorType
AUDIO_INTERFACE, // bFirstInterface
3, // bInterfaceCount
0x01, // bFunctionClass
0x01, // bFunctionSubClass
0x00, // bFunctionProtocol
0, // iFunction
// Standard AudioControl (AC) Interface Descriptor
// USB DCD for Audio Devices 1.0, Table 4-1, page 36
9, // bLength
4, // bDescriptorType, 4 = INTERFACE
AUDIO_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
0, // bNumEndpoints
1, // bInterfaceClass, 1 = AUDIO
1, // bInterfaceSubclass, 1 = AUDIO_CONTROL
0, // bInterfaceProtocol
0, // iInterface
// Class-specific AC Interface Header Descriptor
// USB DCD for Audio Devices 1.0, Table 4-2, page 37-38
10, // bLength
0x24, // bDescriptorType, 0x24 = CS_INTERFACE
0x01, // bDescriptorSubtype, 1 = HEADER
0x00, 0x01, // bcdADC (version 1.0)
LSB(62), MSB(62), // wTotalLength
2, // bInCollection
AUDIO_INTERFACE+1, // baInterfaceNr(1) - Transmit to PC
AUDIO_INTERFACE+2, // baInterfaceNr(2) - Receive from PC
// Input Terminal Descriptor
// USB DCD for Audio Devices 1.0, Table 4-3, page 39
12, // bLength
0x24, // bDescriptorType, 0x24 = CS_INTERFACE
0x02, // bDescriptorSubType, 2 = INPUT_TERMINAL
1, // bTerminalID
//0x01, 0x02, // wTerminalType, 0x0201 = MICROPHONE
//0x03, 0x06, // wTerminalType, 0x0603 = Line Connector
0x02, 0x06, // wTerminalType, 0x0602 = Digital Audio
0, // bAssocTerminal, 0 = unidirectional
2, // bNrChannels
0x03, 0x00, // wChannelConfig, 0x0003 = Left & Right Front
0, // iChannelNames
0, // iTerminal
// Output Terminal Descriptor
// USB DCD for Audio Devices 1.0, Table 4-4, page 40
9, // bLength
0x24, // bDescriptorType, 0x24 = CS_INTERFACE
3, // bDescriptorSubtype, 3 = OUTPUT_TERMINAL
2, // bTerminalID
0x01, 0x01, // wTerminalType, 0x0101 = USB_STREAMING
0, // bAssocTerminal, 0 = unidirectional
1, // bCSourceID, connected to input terminal, ID=1
0, // iTerminal
// Input Terminal Descriptor
// USB DCD for Audio Devices 1.0, Table 4-3, page 39
12, // bLength
0x24, // bDescriptorType, 0x24 = CS_INTERFACE
2, // bDescriptorSubType, 2 = INPUT_TERMINAL
3, // bTerminalID
0x01, 0x01, // wTerminalType, 0x0101 = USB_STREAMING
0, // bAssocTerminal, 0 = unidirectional
2, // bNrChannels
0x03, 0x00, // wChannelConfig, 0x0003 = Left & Right Front
0, // iChannelNames
0, // iTerminal
// Volume feature descriptor
10, // bLength
0x24, // bDescriptorType = CS_INTERFACE
0x06, // bDescriptorSubType = FEATURE_UNIT
0x31, // bUnitID
0x03, // bSourceID (Input Terminal)
0x01, // bControlSize (each channel is 1 byte, 3 channels)
0x01, // bmaControls(0) Master: Mute
0x02, // bmaControls(1) Left: Volume
0x02, // bmaControls(2) Right: Volume
0x00, // iFeature
// Output Terminal Descriptor
// USB DCD for Audio Devices 1.0, Table 4-4, page 40
9, // bLength
0x24, // bDescriptorType, 0x24 = CS_INTERFACE
3, // bDescriptorSubtype, 3 = OUTPUT_TERMINAL
4, // bTerminalID
//0x02, 0x03, // wTerminalType, 0x0302 = Headphones
0x02, 0x06, // wTerminalType, 0x0602 = Digital Audio
0, // bAssocTerminal, 0 = unidirectional
0x31, // bCSourceID, connected to feature, ID=31
0, // iTerminal
// Standard AS Interface Descriptor
// USB DCD for Audio Devices 1.0, Section 4.5.1, Table 4-18, page 59
// Alternate 0: default setting, disabled zero bandwidth
9, // bLenght
4, // bDescriptorType = INTERFACE
AUDIO_INTERFACE+1, // bInterfaceNumber
0, // bAlternateSetting
0, // bNumEndpoints
1, // bInterfaceClass, 1 = AUDIO
2, // bInterfaceSubclass, 2 = AUDIO_STREAMING
0, // bInterfaceProtocol
0, // iInterface
// Alternate 1: streaming data
9, // bLenght
4, // bDescriptorType = INTERFACE
AUDIO_INTERFACE+1, // bInterfaceNumber
1, // bAlternateSetting
1, // bNumEndpoints
1, // bInterfaceClass, 1 = AUDIO
2, // bInterfaceSubclass, 2 = AUDIO_STREAMING
0, // bInterfaceProtocol
0, // iInterface
// Class-Specific AS Interface Descriptor
// USB DCD for Audio Devices 1.0, Section 4.5.2, Table 4-19, page 60
7, // bLength
0x24, // bDescriptorType = CS_INTERFACE
1, // bDescriptorSubtype, 1 = AS_GENERAL
2, // bTerminalLink: Terminal ID = 2
3, // bDelay (approx 3ms delay, audio lib updates)
0x01, 0x00, // wFormatTag, 0x0001 = PCM
// Type I Format Descriptor
// USB DCD for Audio Data Formats 1.0, Section 2.2.5, Table 2-1, page 10
11, // bLength
0x24, // bDescriptorType = CS_INTERFACE
2, // bDescriptorSubtype = FORMAT_TYPE
1, // bFormatType = FORMAT_TYPE_I
2, // bNrChannels = 2
2, // bSubFrameSize = 2 byte
16, // bBitResolution = 16 bits
1, // bSamFreqType = 1 frequency
LSB(44100), MSB(44100), 0, // tSamFreq
// Standard AS Isochronous Audio Data Endpoint Descriptor
// USB DCD for Audio Devices 1.0, Section 4.6.1.1, Table 4-20, page 61-62
9, // bLength
5, // bDescriptorType, 5 = ENDPOINT_DESCRIPTOR
AUDIO_TX_ENDPOINT | 0x80, // bEndpointAddress
0x09, // bmAttributes = isochronous, adaptive
LSB(AUDIO_TX_SIZE), MSB(AUDIO_TX_SIZE), // wMaxPacketSize
1, // bInterval, 1 = every frame
0, // bRefresh
0, // bSynchAddress
// Class-Specific AS Isochronous Audio Data Endpoint Descriptor
// USB DCD for Audio Devices 1.0, Section 4.6.1.2, Table 4-21, page 62-63
7, // bLength
0x25, // bDescriptorType, 0x25 = CS_ENDPOINT
1, // bDescriptorSubtype, 1 = EP_GENERAL
0x00, // bmAttributes
0, // bLockDelayUnits, 1 = ms
0x00, 0x00, // wLockDelay
// Standard AS Interface Descriptor
// USB DCD for Audio Devices 1.0, Section 4.5.1, Table 4-18, page 59
// Alternate 0: default setting, disabled zero bandwidth
9, // bLenght
4, // bDescriptorType = INTERFACE
AUDIO_INTERFACE+2, // bInterfaceNumber
0, // bAlternateSetting
0, // bNumEndpoints
1, // bInterfaceClass, 1 = AUDIO
2, // bInterfaceSubclass, 2 = AUDIO_STREAMING
0, // bInterfaceProtocol
0, // iInterface
// Alternate 1: streaming data
9, // bLenght
4, // bDescriptorType = INTERFACE
AUDIO_INTERFACE+2, // bInterfaceNumber
1, // bAlternateSetting
2, // bNumEndpoints
1, // bInterfaceClass, 1 = AUDIO
2, // bInterfaceSubclass, 2 = AUDIO_STREAMING
0, // bInterfaceProtocol
0, // iInterface
// Class-Specific AS Interface Descriptor
// USB DCD for Audio Devices 1.0, Section 4.5.2, Table 4-19, page 60
7, // bLength
0x24, // bDescriptorType = CS_INTERFACE
1, // bDescriptorSubtype, 1 = AS_GENERAL
3, // bTerminalLink: Terminal ID = 3
3, // bDelay (approx 3ms delay, audio lib updates)
0x01, 0x00, // wFormatTag, 0x0001 = PCM
// Type I Format Descriptor
// USB DCD for Audio Data Formats 1.0, Section 2.2.5, Table 2-1, page 10
11, // bLength
0x24, // bDescriptorType = CS_INTERFACE
2, // bDescriptorSubtype = FORMAT_TYPE
1, // bFormatType = FORMAT_TYPE_I
2, // bNrChannels = 2
2, // bSubFrameSize = 2 byte
16, // bBitResolution = 16 bits
1, // bSamFreqType = 1 frequency
LSB(44100), MSB(44100), 0, // tSamFreq
// Standard AS Isochronous Audio Data Endpoint Descriptor
// USB DCD for Audio Devices 1.0, Section 4.6.1.1, Table 4-20, page 61-62
9, // bLength
5, // bDescriptorType, 5 = ENDPOINT_DESCRIPTOR
AUDIO_RX_ENDPOINT, // bEndpointAddress
0x05, // bmAttributes = isochronous, asynchronous
LSB(AUDIO_RX_SIZE), MSB(AUDIO_RX_SIZE), // wMaxPacketSize
1, // bInterval, 1 = every frame
0, // bRefresh
AUDIO_SYNC_ENDPOINT | 0x80, // bSynchAddress
// Class-Specific AS Isochronous Audio Data Endpoint Descriptor
// USB DCD for Audio Devices 1.0, Section 4.6.1.2, Table 4-21, page 62-63
7, // bLength
0x25, // bDescriptorType, 0x25 = CS_ENDPOINT
1, // bDescriptorSubtype, 1 = EP_GENERAL
0x00, // bmAttributes
0, // bLockDelayUnits, 1 = ms
0x00, 0x00, // wLockDelay
// Standard AS Isochronous Audio Synch Endpoint Descriptor
// USB DCD for Audio Devices 1.0, Section 4.6.2.1, Table 4-22, page 63-64
9, // bLength
5, // bDescriptorType, 5 = ENDPOINT_DESCRIPTOR
AUDIO_SYNC_ENDPOINT | 0x80, // bEndpointAddress
0x11, // bmAttributes = isochronous, feedback
3, 0, // wMaxPacketSize, 3 bytes
1, // bInterval, 1 = every frame
5, // bRefresh, 5 = 32ms
0, // bSynchAddress
#endif
#ifdef MULTITOUCH_INTERFACE
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
9, // bLength
4, // bDescriptorType
MULTITOUCH_INTERFACE, // bInterfaceNumber
0, // bAlternateSetting
1, // bNumEndpoints
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0, // iInterface
// HID interface descriptor, HID 1.11 spec, section 6.2.1
9, // bLength
0x21, // bDescriptorType
0x11, 0x01, // bcdHID
0, // bCountryCode
1, // bNumDescriptors
0x22, // bDescriptorType
LSB(sizeof(multitouch_report_desc)), // wDescriptorLength
MSB(sizeof(multitouch_report_desc)),
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
7, // bLength
5, // bDescriptorType
MULTITOUCH_ENDPOINT | 0x80, // bEndpointAddress
0x03, // bmAttributes (0x03=intr)
MULTITOUCH_SIZE, 0, // wMaxPacketSize
1, // bInterval
#endif // KEYMEDIA_INTERFACE
};
// **************************************************************
// String Descriptors
// **************************************************************
// The descriptors above can provide human readable strings,
// referenced by index numbers. These descriptors are the
// actual string data
/* defined in usb_names.h
struct usb_string_descriptor_struct {
uint8_t bLength;
uint8_t bDescriptorType;
uint16_t wString[];
};
*/
extern struct usb_string_descriptor_struct usb_string_manufacturer_name
__attribute__ ((weak, alias("usb_string_manufacturer_name_default")));
extern struct usb_string_descriptor_struct usb_string_product_name
__attribute__ ((weak, alias("usb_string_product_name_default")));
extern struct usb_string_descriptor_struct usb_string_serial_number
__attribute__ ((weak, alias("usb_string_serial_number_default")));
struct usb_string_descriptor_struct string0 = {
4,
3,
{0x0409}
};
struct usb_string_descriptor_struct usb_string_manufacturer_name_default = {
2 + MANUFACTURER_NAME_LEN * 2,
3,
MANUFACTURER_NAME
};
struct usb_string_descriptor_struct usb_string_product_name_default = {
2 + PRODUCT_NAME_LEN * 2,
3,
PRODUCT_NAME
};
struct usb_string_descriptor_struct usb_string_serial_number_default = {
12,
3,
{0,0,0,0,0,0,0,0,0,0}
};
#ifdef MTP_INTERFACE
struct usb_string_descriptor_struct usb_string_mtp = {
2 + 3 * 2,
3,
{'M','T','P'}
};
#endif
void usb_init_serialnumber(void)
{
char buf[11];
uint32_t i, num;
__disable_irq();
#if defined(HAS_KINETIS_FLASH_FTFA) || defined(HAS_KINETIS_FLASH_FTFL)
FTFL_FSTAT = FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL;
FTFL_FCCOB0 = 0x41;
FTFL_FCCOB1 = 15;
FTFL_FSTAT = FTFL_FSTAT_CCIF;
while (!(FTFL_FSTAT & FTFL_FSTAT_CCIF)) ; // wait
num = *(uint32_t *)&FTFL_FCCOB7;
#elif defined(HAS_KINETIS_FLASH_FTFE)
kinetis_hsrun_disable();
FTFL_FSTAT = FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL;
*(uint32_t *)&FTFL_FCCOB3 = 0x41070000;
FTFL_FSTAT = FTFL_FSTAT_CCIF;
while (!(FTFL_FSTAT & FTFL_FSTAT_CCIF)) ; // wait
num = *(uint32_t *)&FTFL_FCCOBB;
kinetis_hsrun_enable();
#endif
__enable_irq();
// add extra zero to work around OS-X CDC-ACM driver bug
if (num < 10000000) num = num * 10;
ultoa(num, buf, 10);
for (i=0; i<10; i++) {
char c = buf[i];
if (!c) break;
usb_string_serial_number_default.wString[i] = c;
}
usb_string_serial_number_default.bLength = i * 2 + 2;
}
// **************************************************************
// Descriptors List
// **************************************************************
// This table provides access to all the descriptor data above.
const usb_descriptor_list_t usb_descriptor_list[] = {
//wValue, wIndex, address, length
{0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
{0x0200, 0x0000, config_descriptor, sizeof(config_descriptor)},
#ifdef SEREMU_INTERFACE
{0x2200, SEREMU_INTERFACE, seremu_report_desc, sizeof(seremu_report_desc)},
{0x2100, SEREMU_INTERFACE, config_descriptor+SEREMU_HID_DESC_OFFSET, 9},
#endif
#ifdef KEYBOARD_INTERFACE
{0x2200, KEYBOARD_INTERFACE, keyboard_report_desc, sizeof(keyboard_report_desc)},
{0x2100, KEYBOARD_INTERFACE, config_descriptor+KEYBOARD_HID_DESC_OFFSET, 9},
#endif
#ifdef MOUSE_INTERFACE
{0x2200, MOUSE_INTERFACE, mouse_report_desc, sizeof(mouse_report_desc)},
{0x2100, MOUSE_INTERFACE, config_descriptor+MOUSE_HID_DESC_OFFSET, 9},
#endif
#ifdef JOYSTICK_INTERFACE
{0x2200, JOYSTICK_INTERFACE, joystick_report_desc, sizeof(joystick_report_desc)},
{0x2100, JOYSTICK_INTERFACE, config_descriptor+JOYSTICK_HID_DESC_OFFSET, 9},
#endif
#ifdef RAWHID_INTERFACE
{0x2200, RAWHID_INTERFACE, rawhid_report_desc, sizeof(rawhid_report_desc)},
{0x2100, RAWHID_INTERFACE, config_descriptor+RAWHID_HID_DESC_OFFSET, 9},
#endif
#ifdef FLIGHTSIM_INTERFACE
{0x2200, FLIGHTSIM_INTERFACE, flightsim_report_desc, sizeof(flightsim_report_desc)},
{0x2100, FLIGHTSIM_INTERFACE, config_descriptor+FLIGHTSIM_HID_DESC_OFFSET, 9},
#endif
#ifdef KEYMEDIA_INTERFACE
{0x2200, KEYMEDIA_INTERFACE, keymedia_report_desc, sizeof(keymedia_report_desc)},
{0x2100, KEYMEDIA_INTERFACE, config_descriptor+KEYMEDIA_HID_DESC_OFFSET, 9},
#endif
#ifdef MULTITOUCH_INTERFACE
{0x2200, MULTITOUCH_INTERFACE, multitouch_report_desc, sizeof(multitouch_report_desc)},
{0x2100, MULTITOUCH_INTERFACE, config_descriptor+MULTITOUCH_HID_DESC_OFFSET, 9},
#endif
#ifdef MTP_INTERFACE
{0x0304, 0x0409, (const uint8_t *)&usb_string_mtp, 0},
#endif
{0x0300, 0x0000, (const uint8_t *)&string0, 0},
{0x0301, 0x0409, (const uint8_t *)&usb_string_manufacturer_name, 0},
{0x0302, 0x0409, (const uint8_t *)&usb_string_product_name, 0},
{0x0303, 0x0409, (const uint8_t *)&usb_string_serial_number, 0},
{0, 0, NULL, 0}
};
// **************************************************************
// Endpoint Configuration
// **************************************************************
#if 0
// 0x00 = not used
// 0x19 = Recieve only
// 0x15 = Transmit only
// 0x1D = Transmit & Recieve
//
const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] =
{
0x00, 0x15, 0x19, 0x15, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#endif
const uint8_t usb_endpoint_config_table[NUM_ENDPOINTS] =
{
#if (defined(ENDPOINT1_CONFIG) && NUM_ENDPOINTS >= 1)
ENDPOINT1_CONFIG,
#elif (NUM_ENDPOINTS >= 1)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT2_CONFIG) && NUM_ENDPOINTS >= 2)
ENDPOINT2_CONFIG,
#elif (NUM_ENDPOINTS >= 2)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT3_CONFIG) && NUM_ENDPOINTS >= 3)
ENDPOINT3_CONFIG,
#elif (NUM_ENDPOINTS >= 3)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT4_CONFIG) && NUM_ENDPOINTS >= 4)
ENDPOINT4_CONFIG,
#elif (NUM_ENDPOINTS >= 4)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT5_CONFIG) && NUM_ENDPOINTS >= 5)
ENDPOINT5_CONFIG,
#elif (NUM_ENDPOINTS >= 5)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT6_CONFIG) && NUM_ENDPOINTS >= 6)
ENDPOINT6_CONFIG,
#elif (NUM_ENDPOINTS >= 6)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT7_CONFIG) && NUM_ENDPOINTS >= 7)
ENDPOINT7_CONFIG,
#elif (NUM_ENDPOINTS >= 7)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT8_CONFIG) && NUM_ENDPOINTS >= 8)
ENDPOINT8_CONFIG,
#elif (NUM_ENDPOINTS >= 8)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT9_CONFIG) && NUM_ENDPOINTS >= 9)
ENDPOINT9_CONFIG,
#elif (NUM_ENDPOINTS >= 9)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT10_CONFIG) && NUM_ENDPOINTS >= 10)
ENDPOINT10_CONFIG,
#elif (NUM_ENDPOINTS >= 10)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT11_CONFIG) && NUM_ENDPOINTS >= 11)
ENDPOINT11_CONFIG,
#elif (NUM_ENDPOINTS >= 11)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT12_CONFIG) && NUM_ENDPOINTS >= 12)
ENDPOINT12_CONFIG,
#elif (NUM_ENDPOINTS >= 12)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT13_CONFIG) && NUM_ENDPOINTS >= 13)
ENDPOINT13_CONFIG,
#elif (NUM_ENDPOINTS >= 13)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT14_CONFIG) && NUM_ENDPOINTS >= 14)
ENDPOINT14_CONFIG,
#elif (NUM_ENDPOINTS >= 14)
ENDPOINT_UNUSED,
#endif
#if (defined(ENDPOINT15_CONFIG) && NUM_ENDPOINTS >= 15)
ENDPOINT15_CONFIG,
#elif (NUM_ENDPOINTS >= 15)
ENDPOINT_UNUSED,
#endif
};
#endif // NUM_ENDPOINTS
#endif // F_CPU >= 20 MHz
|
the_stack_data/111207.c | #include <sys/stat.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main(int ac, char **av)
{
int fd = 0;
int flags = 0;
char template[] = "/tmp/testXXXXXX";
setbuf(stdout, NULL);
fd = mkstemp(template);
long long offset = lseek(fd, 0, SEEK_CUR);
printf("File offset before fork(): %lld\n", offset);
flags = fcntl(fd, F_GETFL);
printf("O_APPEND flag before fork() is: %s\n",
(flags & O_APPEND) ? "on" : "off");
switch (fork()) {
case -1:
break;
case 0:
lseek(fd, 1000, SEEK_SET);
flags |= O_APPEND;
fcntl(fd, F_SETFL, flags);
break;
default:
wait(NULL);
offset = lseek(fd, 0, SEEK_CUR);
printf("File offset in parent: %lld\n", offset);
printf("O_APPEND flag in parent is: %s\n",
(flags & O_APPEND) ? "on" : "off");
}
return 0;
}
|
the_stack_data/182951780.c | static int spready[] = {0, 1, 2, 3};
void explosion_map (int y)
{
int i;
for (i = 0; i < 4; i++)
if (y * spready[i] < 0)
break;
}
void explosion (void)
{
int i;
explosion_map (0);
for (i = 0; i < 2; i++)
continue;
}
|
the_stack_data/747931.c | void foo(double *X, int N) {
double T[2];
for (int I = 1; I < N - 1; ++I) {
T[0] = X[I-1];
T[1] = X[I+1];
X[I] += T[0] + T[1];
}
}
|
the_stack_data/234518452.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[], char *env[])
{
int time = 0;
//char alphabet[100] = {0,};
char *alphabet = malloc(sizeof(char) * 100);
printf("Enter the Dial Alphabet : ");
scanf("%s", alphabet);
// printf("test %c", alphabet[1]);
//printf("test2 %ld\n", strlen(alphabet));
//printf("test3 %ld\n", sizeof(alphabet)/sizeof(char));
for(int i = 0; i < strlen(alphabet); i++)
{
if(alphabet[i] == 'A' || alphabet[i] == 'B' || alphabet[i] == 'C')
{
time += 3;
}
else if(alphabet[i] == 'D' || alphabet[i] == 'E' || alphabet[i] == 'F')
{
time += 4;
}
else if(alphabet[i] == 'G' || alphabet[i] == 'H' || alphabet[i] == 'I')
{
time += 5;
}
else if(alphabet[i] == 'J' || alphabet[i] == 'K' || alphabet[i] == 'L')
{
time += 6;
}
else if(alphabet[i] == 'M' || alphabet[i] == 'N' || alphabet[i] == 'O')
{
time += 7;
}
else if(alphabet[i] == 'P' || alphabet[i] == 'Q' || alphabet[i] == 'R' || alphabet[i] == 'S')
{
time += 8;
}
else if(alphabet[i] == 'T' || alphabet[i] == 'U' || alphabet[i] == 'V')
{
time += 9;
}
else if(alphabet[i] == 'W' || alphabet[i] == 'X' || alphabet[i] == 'Y' || alphabet[i] == 'Z')
{
time += 10;
}
else
{
time += 2;
}
}
printf("Dial Time : %d\n", time);
free(alphabet);
return 0;
}
|
the_stack_data/20234.c | #include <unistd.h>
#include "syscall.h"
#ifndef PS4
gid_t getgid(void)
{
return __syscall(SYS_getgid);
}
#endif
|
the_stack_data/1191654.c |
typedef unsigned long DWORD;
int nondet();
int main(void)
{
DWORD dwLength;
DWORD dwSoFar;
assume(dwLength!=0);
for (;;)
{
;
dwSoFar=nondet();
// nondet-break removed
if (dwSoFar >= dwLength) break;
;
dwLength -= dwSoFar;
}
return 0;
}
|
the_stack_data/128785.c | /*!
\mainpage Reader-Writers Example
\section intro Introduction
An implementation example for reader-writers protocol, giving priority to readers.
The goal of this example is to
- create two or more readers,
- create a writer
- simlutate some reads and some writes on shared data
following the reader-writers protol.
See \link main main \endlink function to run the code.
\date 06/05/2018
\version 0.1.0
\author Luca Parolari
*/
/*!
* \file rws.c
* \brief Main file
* \author L. Parolari
* \date 06/05/2018
*/
#include <semaphore.h>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
static sem_t mutex; //!< Mutex semaphore, used to syncronize readers while the writer is writing.
static sem_t write_sem; //!< Writer semaphore, used to syncronize writer: waits until there aren't any reader.
int readers_no = 0; //!< Counts the readers number, in order to lock or unlock the writer mutex.
int shared[100]; //!< Shared array on which readers read and writer write.
int writed_no = 0; //!< Counts writed cells number.
/*!
Simulates a read procedure reading things from the shared data,
and waits for some seconds simulating reader pause.
\brief Simulates a read procedure
\param The reader number
*/
void* reader(void* arg) {
while(1) {
reader_internal((int)arg);
// simulating a delay between reads (different for every thread) in order to allo
// the writer to write again.
sleep(((int)arg)+2);
}
}
/*!
Execute a read following reader-writers protocol.
\brief Executes a read
\param The reader thread number
*/
void reader_internal(int r) {
int r_id = r;
sem_wait(&mutex); // mutex down
++readers_no;
if (readers_no == 1)
sem_wait(&write_sem); // write down if the first
sem_post(&mutex); // mutex up
printf("Thread %d start reading\n",r_id);
for(int i = 0; i < writed_no; i += r_id+1) printf("%d, ",shared[i]);
printf("\n");
sleep(2);
printf("Thread %d end reading\n\n",r_id);
sem_wait(&mutex); // mutex down
--readers_no;
if (readers_no == 0)
sem_post(&write_sem);
sem_post(&mutex); // mutex up
}
/*!
Simulates a write procedure writing a shared data cell per time,
and waits for some seconds simulating writer pause.
\brief Simulates a write procedure
\param The writer name
*/
void* writer(void* arg) {
while(1) {
writer_internal((char*)arg);
// waits at least 2 seconds between two writes, in order to allow
// readers to read something.
sleep(2);
}
}
/*!
Execute a write following reader-writers protocol.
\brief Executes a write
\param The writer thread name
*/
void writer_internal(char* w) {
sem_wait(&write_sem); // write down
printf("Thread %s start writing\n",w);
shared[writed_no] = writed_no*10;
++writed_no;
sleep(2);
printf("Thread %s end writing\n\n",w);
sem_post(&write_sem); // write up
}
/*!
Initializes semaphores and creates thread, making them starting writing or reading.
\brief Entry point function
\param The arguments number
\param The arguments data
\ref main
*/
int main(int argc, char const *argv[])
{
const int r_no = 5;
// threads
pthread_t readers[r_no];
pthread_t wrt;
void * ret; // threads return value
// semaphore inits.
sem_init(&mutex,0,1); // mutex(1)
sem_init(&write_sem,0,1); // write_sem(1)
// creating a writer.
if (pthread_create(&wrt, NULL, writer, "writer") < 0) {
printf("pthread_create error for thread writer\n");
exit (1);
}
// creating r_no readers.
for(int i=0; i<r_no; ++i) {
if (pthread_create(&readers[i], NULL, reader, i) < 0){
printf("pthread_create error for thread\n");
exit (1);
}
}
// main waits each thread before exiting.
for(int i=0; i<r_no; ++i) pthread_join (readers[i], &ret);
pthread_join (wrt, &ret);
printf("Exit\n");
return 0;
}
|
the_stack_data/109514204.c | /* $Id: addr_is_reserved.c,v 1.4 2021/03/02 23:40:32 nanard Exp $ */
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* Project : miniupnp
* Web : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
* Author : Thomas BERNARD
* copyright (c) 2005-2021 Thomas Bernard
* This software is subjet to the conditions detailed in the
* provided LICENSE file. */
#ifdef _WIN32
/* Win32 Specific includes and defines */
#include <winsock2.h>
#include <ws2tcpip.h>
#if !defined(_MSC_VER)
#include <stdint.h>
#else /* !defined(_MSC_VER) */
typedef unsigned long uint32_t;
#endif /* !defined(_MSC_VER) */
#else /* _WIN32 */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif /* _WIN32 */
/* List of IP address blocks which are private / reserved and therefore not suitable for public external IP addresses */
#define IP(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
#define MSK(m) (32-(m))
static const struct { uint32_t address; uint32_t rmask; } reserved[] = {
{ IP( 0, 0, 0, 0), MSK( 8) }, /* RFC1122 "This host on this network" */
{ IP( 10, 0, 0, 0), MSK( 8) }, /* RFC1918 Private-Use */
{ IP(100, 64, 0, 0), MSK(10) }, /* RFC6598 Shared Address Space */
{ IP(127, 0, 0, 0), MSK( 8) }, /* RFC1122 Loopback */
{ IP(169, 254, 0, 0), MSK(16) }, /* RFC3927 Link-Local */
{ IP(172, 16, 0, 0), MSK(12) }, /* RFC1918 Private-Use */
{ IP(192, 0, 0, 0), MSK(24) }, /* RFC6890 IETF Protocol Assignments */
{ IP(192, 0, 2, 0), MSK(24) }, /* RFC5737 Documentation (TEST-NET-1) */
{ IP(192, 31, 196, 0), MSK(24) }, /* RFC7535 AS112-v4 */
{ IP(192, 52, 193, 0), MSK(24) }, /* RFC7450 AMT */
{ IP(192, 88, 99, 0), MSK(24) }, /* RFC7526 6to4 Relay Anycast */
{ IP(192, 168, 0, 0), MSK(16) }, /* RFC1918 Private-Use */
{ IP(192, 175, 48, 0), MSK(24) }, /* RFC7534 Direct Delegation AS112 Service */
{ IP(198, 18, 0, 0), MSK(15) }, /* RFC2544 Benchmarking */
{ IP(198, 51, 100, 0), MSK(24) }, /* RFC5737 Documentation (TEST-NET-2) */
{ IP(203, 0, 113, 0), MSK(24) }, /* RFC5737 Documentation (TEST-NET-3) */
{ IP(224, 0, 0, 0), MSK( 4) }, /* RFC1112 Multicast */
{ IP(240, 0, 0, 0), MSK( 4) }, /* RFC1112 Reserved for Future Use + RFC919 Limited Broadcast */
};
#undef IP
#undef MSK
/**
* @return 1 or 0
*/
int addr_is_reserved(const char * addr_str)
{
#ifdef MINIUPNPC_CHECK_ADDR_RESERVED
uint32_t addr_n, address;
size_t i;
#if defined(_WIN32) && (!defined(_WIN32_WINNT_VISTA) || (_WIN32_WINNT < _WIN32_WINNT_VISTA))
addr_n = inet_addr(addr_str);
if (addr_n == INADDR_NONE)
return 1;
#else
/* was : addr_n = inet_addr(addr_str); */
if (inet_pton(AF_INET, addr_str, &addr_n) <= 0) {
/* error */
return 1;
}
#endif
address = ntohl(addr_n);
for (i = 0; i < sizeof(reserved)/sizeof(reserved[0]); ++i) {
if ((address >> reserved[i].rmask) == (reserved[i].address >> reserved[i].rmask))
return 1;
}
#endif
return 0;
}
|
the_stack_data/7950541.c | extern int printf ( const char * format, ... );
extern int __VERIFIER_nondet_int();
int main(void) {
int *myPointerA = ((void*) 0);
int *myPointerB = ((void*) 0);
if(__VERIFIER_nondet_int())
{
int myNumberA = 7;
myPointerA = &myNumberA;
// scope of myNumber ends here
}
int myNumberB = 3;
myPointerB = &myNumberB;
int sumOfMyNumbers = *myPointerA + *myPointerB; // myPointerA is out of scope
printf("%d", sumOfMyNumbers);
return 0;
}
|
the_stack_data/48876.c | #ifdef COMPILE_FOR_TEST
#include <assert.h>
#define assume(cond) assert(cond)
#endif
void main(int argc, char* argv[]) {
int x_0_0;//sh_buf.outcnt
int x_0_1;//sh_buf.outcnt
int x_0_2;//sh_buf.outcnt
int x_0_3;//sh_buf.outcnt
int x_0_4;//sh_buf.outcnt
int x_0_5;//sh_buf.outcnt
int x_1_0;//sh_buf.outbuf[0]
int x_1_1;//sh_buf.outbuf[0]
int x_2_0;//sh_buf.outbuf[1]
int x_2_1;//sh_buf.outbuf[1]
int x_3_0;//sh_buf.outbuf[2]
int x_3_1;//sh_buf.outbuf[2]
int x_4_0;//sh_buf.outbuf[3]
int x_4_1;//sh_buf.outbuf[3]
int x_5_0;//sh_buf.outbuf[4]
int x_5_1;//sh_buf.outbuf[4]
int x_6_0;//sh_buf.outbuf[5]
int x_7_0;//sh_buf.outbuf[6]
int x_8_0;//sh_buf.outbuf[7]
int x_9_0;//sh_buf.outbuf[8]
int x_10_0;//sh_buf.outbuf[9]
int x_11_0;//LOG_BUFSIZE
int x_11_1;//LOG_BUFSIZE
int x_12_0;//CREST_scheduler::lock_0
int x_13_0;//t3 T0
int x_14_0;//t2 T0
int x_15_0;//arg T0
int x_16_0;//functioncall::param T0
int x_16_1;//functioncall::param T0
int x_17_0;//buffered T0
int x_18_0;//functioncall::param T0
int x_18_1;//functioncall::param T0
int x_19_0;//functioncall::param T0
int x_19_1;//functioncall::param T0
int x_20_0;//functioncall::param T0
int x_20_1;//functioncall::param T0
int x_21_0;//functioncall::param T0
int x_21_1;//functioncall::param T0
int x_22_0;//direction T0
int x_23_0;//functioncall::param T0
int x_23_1;//functioncall::param T0
int x_24_0;//functioncall::param T0
int x_24_1;//functioncall::param T0
int x_25_0;//functioncall::param T0
int x_25_1;//functioncall::param T0
int x_26_0;//functioncall::param T0
int x_26_1;//functioncall::param T0
int x_27_0;//functioncall::param T0
int x_27_1;//functioncall::param T0
int x_28_0;//functioncall::param T0
int x_28_1;//functioncall::param T0
int x_29_0;//functioncall::param T0
int x_29_1;//functioncall::param T0
int x_30_0;//functioncall::param T0
int x_30_1;//functioncall::param T0
int x_31_0;//functioncall::param T0
int x_31_1;//functioncall::param T0
int x_32_0;//functioncall::param T0
int x_32_1;//functioncall::param T0
int x_33_0;//functioncall::param T0
int x_33_1;//functioncall::param T0
int x_34_0;//functioncall::param T0
int x_34_1;//functioncall::param T0
int x_35_0;//functioncall::param T1
int x_35_1;//functioncall::param T1
int x_36_0;//functioncall::param T1
int x_36_1;//functioncall::param T1
int x_37_0;//i T1
int x_37_1;//i T1
int x_37_2;//i T1
int x_38_0;//rv T1
int x_39_0;//functioncall::param T1
int x_39_1;//functioncall::param T1
int x_40_0;//functioncall::param T1
int x_40_1;//functioncall::param T1
int x_41_0;//functioncall::param T1
int x_41_1;//functioncall::param T1
int x_42_0;//functioncall::param T1
int x_42_1;//functioncall::param T1
int x_43_0;//functioncall::param T1
int x_43_1;//functioncall::param T1
int x_44_0;//functioncall::param T1
int x_44_1;//functioncall::param T1
int x_45_0;//functioncall::param T2
int x_45_1;//functioncall::param T2
int x_46_0;//functioncall::param T2
int x_46_1;//functioncall::param T2
int x_47_0;//i T2
int x_47_1;//i T2
int x_47_2;//i T2
int x_47_3;//i T2
int x_48_0;//rv T2
int x_49_0;//rv T2
int x_49_1;//rv T2
int x_50_0;//functioncall::param T2
int x_50_1;//functioncall::param T2
int x_51_0;//functioncall::param T2
int x_51_1;//functioncall::param T2
int x_52_0;//functioncall::param T2
int x_52_1;//functioncall::param T2
int x_53_0;//functioncall::param T2
int x_53_1;//functioncall::param T2
int x_54_0;//functioncall::param T2
int x_54_1;//functioncall::param T2
int x_55_0;//functioncall::param T2
int x_55_1;//functioncall::param T2
int x_55_2;//functioncall::param T2
int x_56_0;//functioncall::param T2
int x_56_1;//functioncall::param T2
T_0_0_0: x_0_0 = 0;
T_0_1_0: x_1_0 = 0;
T_0_2_0: x_2_0 = 0;
T_0_3_0: x_3_0 = 0;
T_0_4_0: x_4_0 = 0;
T_0_5_0: x_5_0 = 0;
T_0_6_0: x_6_0 = 0;
T_0_7_0: x_7_0 = 0;
T_0_8_0: x_8_0 = 0;
T_0_9_0: x_9_0 = 0;
T_0_10_0: x_10_0 = 0;
T_0_11_0: x_11_0 = 0;
T_0_12_0: x_13_0 = 723750832;
T_0_13_0: x_14_0 = 2968420960;
T_0_14_0: x_15_0 = 0;
T_0_15_0: x_16_0 = 2034412142;
T_0_16_0: x_16_1 = -1;
T_0_17_0: x_17_0 = 0;
T_0_18_0: x_18_0 = 142892338;
T_0_19_0: x_18_1 = x_17_0;
T_0_20_0: x_19_0 = 234969537;
T_0_21_0: x_19_1 = 97;
T_0_22_0: x_20_0 = 1995399150;
T_0_23_0: x_20_1 = 0;
T_0_24_0: x_21_0 = 1354821663;
T_0_25_0: x_21_1 = 0;
T_0_26_0: x_22_0 = -1326550976;
T_0_27_0: x_23_0 = 756188798;
T_0_28_0: x_23_1 = x_22_0;
T_0_29_0: x_24_0 = 202619357;
T_0_30_0: x_24_1 = 0;
T_0_31_0: x_12_0 = -1;
T_0_32_0: x_0_1 = 5;
T_0_33_0: x_1_1 = 72;
T_0_34_0: x_2_1 = 69;
T_0_35_0: x_3_1 = 76;
T_0_36_0: x_4_1 = 76;
T_0_37_0: x_5_1 = 79;
T_0_38_0: x_25_0 = 824920925;
T_0_39_0: x_25_1 = 83;
T_0_40_0: x_26_0 = 1499317775;
T_0_41_0: x_26_1 = 1;
T_0_42_0: x_27_0 = 1625154215;
T_0_43_0: x_27_1 = 1;
T_0_44_0: x_28_0 = 1051478417;
T_0_45_0: x_28_1 = 1;
T_0_46_0: x_29_0 = 692684369;
T_0_47_0: x_29_1 = 82;
T_0_48_0: x_30_0 = 1195072425;
T_0_49_0: x_30_1 = 90;
T_0_50_0: x_31_0 = 1103132188;
T_0_51_0: x_31_1 = 1;
T_0_52_0: x_32_0 = 565169940;
T_0_53_0: x_32_1 = 1;
T_0_54_0: x_33_0 = 1242182272;
T_0_55_0: x_33_1 = 2;
T_0_56_0: x_34_0 = 1801556925;
T_0_57_0: x_34_1 = 2;
T_0_58_0: x_11_1 = 6;
T_2_59_2: x_45_0 = 1849613578;
T_2_60_2: x_45_1 = x_33_1;
T_2_61_2: x_46_0 = 1726056356;
T_2_62_2: x_46_1 = x_34_1;
T_2_63_2: x_47_0 = 0;
T_2_64_2: x_48_0 = 1275888129;
T_1_65_1: x_35_0 = 1127212203;
T_1_66_1: x_35_1 = x_27_1;
T_1_67_1: x_36_0 = 322129642;
T_1_68_1: x_36_1 = x_28_1;
T_1_69_1: x_37_0 = 0;
T_1_70_1: x_38_0 = 1277989377;
T_2_71_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0) x_49_0 = -1319483472;
T_2_72_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0 && x_18_1 == 0 && x_18_1 == 0) x_50_0 = 1242944632;
T_2_73_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0 && x_18_1 == 0 && x_18_1 == 0) x_50_1 = -1;
T_2_74_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0 && x_18_1 == 0 && x_18_1 == 0) x_49_1 = x_50_1;
T_2_75_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0 && x_18_1 == 0 && x_49_1 + 1 == 0) x_0_2 = 0;
T_1_76_1: if (x_36_1 < x_11_1) x_39_0 = 1377392546;
T_1_77_1: if (x_36_1 < x_11_1) x_39_1 = 47943441938176;
T_1_78_1: if (x_36_1 < x_11_1) x_40_0 = 1317511953;
T_1_79_1: if (x_36_1 < x_11_1) x_40_1 = x_0_2 + x_36_1;
T_1_80_1: if (x_36_1 < x_11_1) x_37_1 = 0;
T_1_81_1: if (x_36_1 < x_11_1 && x_37_1 < x_35_1) x_41_0 = 393048405;
T_1_82_1: if (x_36_1 < x_11_1 && x_37_1 < x_35_1) x_41_1 = 47943441938176;
T_1_83_1: if (x_36_1 < x_11_1) x_37_2 = 1 + x_37_1;
T_1_84_1: if (x_36_1 < x_11_1) x_42_0 = 1108644447;
T_1_85_1: if (x_36_1 < x_11_1) x_42_1 = 47943441938176;
T_1_86_1: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0) x_51_0 = 2094351796;
T_1_87_1: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0) x_51_1 = 9;
T_2_88_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0) x_52_0 = 1929002610;
T_2_89_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0) x_52_1 = x_51_1;
T_2_90_2: if (x_0_1 + x_46_1 > x_11_1 && x_0_1 != 0) x_0_3 = 0;
T_2_91_2: if (x_36_1 < x_11_1) x_0_4 = x_0_2 + x_36_1;
T_1_92_1: if (x_46_1 < x_11_1) x_53_0 = 1776106186;
T_2_93_2: if (x_46_1 < x_11_1) x_53_1 = 47943444039424;
T_2_94_2: if (x_36_1 < x_11_1) x_43_0 = 1919163028;
T_2_95_2: if (x_36_1 < x_11_1) x_43_1 = 47943441938176;
T_1_96_1: if (x_46_1 < x_11_1) x_54_0 = 1253959182;
T_1_97_1: if (x_46_1 < x_11_1) x_54_1 = x_0_4 + x_46_1;
T_2_98_2: if (x_46_1 < x_11_1) x_47_1 = 0;
T_2_99_2: if (x_46_1 < x_11_1 && x_47_1 < x_45_1) x_55_0 = 1663034680;
T_2_100_2: if (x_46_1 < x_11_1 && x_47_1 < x_45_1) x_55_1 = 47943444039424;
T_2_101_2: if (x_46_1 < x_11_1) x_47_2 = 1 + x_47_1;
T_2_102_2: if (x_46_1 < x_11_1 && x_47_2 < x_45_1) x_55_2 = 47943444039424;
T_2_103_2: if (x_46_1 < x_11_1) x_47_3 = 1 + x_47_2;
T_2_104_2: if (x_46_1 < x_11_1) x_56_0 = 2062055366;
T_2_105_2: if (x_46_1 < x_11_1) x_56_1 = 47943444039424;
T_2_106_2: if (x_46_1 < x_11_1) x_0_5 = x_0_4 + x_46_1;
T_2_107_2: if (x_36_1 < x_11_1) x_44_0 = 1488928719;
T_2_108_2: if (x_36_1 < x_11_1) x_44_1 = 47943441938176;
T_1_109_1: if (x_36_1 < x_11_1) assert(x_0_5 == x_40_1);
}
|
the_stack_data/151705273.c | /* crypto/sha/sha_one.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* 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 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 cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
#include <stdio.h>
#include <string.h>
#include <openssl/sha.h>
#include <openssl/crypto.h>
#ifndef OPENSSL_NO_SHA0
unsigned char *SHA(const unsigned char *d, unsigned long n, unsigned char *md)
{
SHA_CTX c;
static unsigned char m[SHA_DIGEST_LENGTH];
if (md == NULL) md=m;
SHA_Init(&c);
SHA_Update(&c,d,n);
SHA_Final(md,&c);
OPENSSL_cleanse(&c,sizeof(c));
return(md);
}
#endif
|
the_stack_data/745462.c | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
void countingSort(int* arr, int highest, int num){
int* Count = (int*)malloc(highest*sizeof(int));
int* Sorted = (int*)malloc(num*sizeof(int));
for(int i=0;i<highest+1;i++)
Count[i]=0;
for(int i=0;i<num;i++){
Count[arr[i]]++;
}
int j=0;
for(int i=0;i<=highest;i++){
int temp = Count[i];
while(temp--){
Sorted[j]=i;
j++;
}
}
printf("The sorted array is : \n");
for(int i=0;i<num;i++)
printf("%d ",Sorted[i]);
}
int main(void) {
int* arr;
printf("Enter the number of elements : ");
int n,k=0;
scanf("%d",&n);
arr = (int*)malloc(n*sizeof(int));
printf("Enter the elements : ");
for(int i=0;i<n;i++){
scanf("%d",&arr[i]);
if(arr[i]>k)
k = arr[i];
}
countingSort(arr,k,n);
return 0;
}
|
the_stack_data/11075728.c | #include <stdio.h>
struct test {
int a;
long b;
};
int main() {
struct test s1 = { 4, 5 };
struct test s2 = { 7, 8 };
s1 = s2;
s2.a = 9;
s2.b = 3;
printf("%d %ld\n", s1.a, s1.b);
printf("%d %ld\n", s2.a, s2.b);
}
|
the_stack_data/142094.c | #include<stdio.h>
#include<stdlib.h>
void input_array(int *arr, int n)
{
int i;
for (i = 0; i < n; ++i)
scanf("%d", &arr[i]);
}
void print_array(int *arr, int n)
{
int i;
for (i = 0; i < n; ++i)
printf("%d ", arr[i]);
printf("\n");
}
int get_equilibrium_index(int *arr, int n)
{
int i, *left_arr, *right_arr;
left_arr = (int*)malloc((n+1)*sizeof(int));
right_arr = (int*)malloc((n+1)*sizeof(int));
left_arr[0] = arr[0];
right_arr[0] = arr[n-1];
// filling left_arr with sum of elements from left
for (i = 1; i < n; ++i)
left_arr[i] = left_arr[i-1] + arr[i];
// filling right_arr with sum of elements from right
for (i = 1; i < n; ++i)
right_arr[i] = right_arr[i-1] + arr[n-i-1];
// now iterating over left_arr and right_arr and checking if somewhere the elements matches
for (i = 0; i < n; ++i)
if (left_arr[i] == right_arr[i+1])
return i;
//print_array(left_arr, n);
//print_array(right_arr, n);
return -1;
}
int main()
{
int n, *arr;
scanf("%d", &n);
arr = (int *)malloc(n * sizeof(int));
input_array(arr, n);
int ret_val = get_equilibrium_index(arr, n);
if (ret_val != -1)
printf ("\n%d is the equilibrium index\n", ret_val);
else
printf("\nThere is no equilibrium index\n");
return 0;
}
|
the_stack_data/15762247.c | #include <stdio.h>
int main(){
int num;
printf("Enter a number between 1 to 7 to check its weekday.\n");
scanf("%d",&num);
switch(num)
{
case 1: printf("It's Monday");
break;
case 2: printf("It's Tuesday");
break;
case 3: printf("It's Wednesday");
break;
case 4: printf("It's Thursday");
break;
case 5: printf("It's Friday");
break;
case 6: printf("It's Saturday");
break;
case 7: printf("It's Sunday");
break;
default: printf("You have not entered a valid number please enter a valid number.\n");
}
return 0;
}
|
the_stack_data/857048.c | /* $Id$ */
/* Copyright (c) 2018-2020 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS uKernel */
#if defined(__i386__)
# include <stdio.h>
# include <string.h>
# include <kernel/drivers/bus.h>
# include <kernel/drivers/console.h>
# include <kernel/drivers/clock.h>
# include <kernel/drivers/display.h>
# include "arch/amd64/gdt.h"
# include "arch/i386/gdt.h"
# include "drivers/boot/multiboot.h"
# ifndef LOADER_CLOCK
# define LOADER_CLOCK "cmos"
# endif
# ifndef LOADER_CONSOLE
# define LOADER_CONSOLE "uart"
# endif
# ifndef LOADER_DISPLAY
# define LOADER_DISPLAY "vga"
# endif
/* private */
/* constants */
/* GDT: 4GB flat memory setup */
static const GDT _gdt_4gb[4] =
{
{ 0x00000000, 0x00000000, 0x00 },
{ 0x00000000, 0xffffffff, 0x9a },
{ 0x00000000, 0xffffffff, 0x92 },
{ 0x00000000, 0x00000000, 0x89 }
};
/* public */
/* functions */
/* multiboot */
int multiboot(const ukMultibootInfo * mi)
{
ukBus * ioportbus;
ukBus * vgabus;
ukBus * cmosbus;
char const * clock = LOADER_CLOCK;
char const * console = LOADER_CONSOLE;
char const * display = LOADER_DISPLAY;
ukMultibootMod * mod;
unsigned char elfclass;
vaddr_t entrypoint;
ukMultibootInfo kmi;
/* initialize the heap */
multiboot_heap_reset(mi);
/* initialize the buses */
ioportbus = bus_init(NULL, "ioport");
vgabus = bus_init(ioportbus, "vga");
cmosbus = bus_init(ioportbus, "cmos");
#ifdef notyet
/* detect the video driver to use */
if(mi->flags & BOOT_MULTIBOOT_INFO_HAS_VBE)
display = "vesa";
#endif
/* initialize the display */
display_init(vgabus, display);
/* initialize the console */
console_init(ioportbus, console);
/* initialize the clock */
clock_init(cmosbus, clock);
/* report information on the boot process */
puts("DeforaOS Multiboot");
if(mi->loader_name != NULL)
printf("Loader: %s\n", mi->loader_name);
if(mi->cmdline != NULL)
printf("Command line: %s\n", mi->cmdline);
printf("%u MB memory available\n",
(mi->mem_upper - mi->mem_lower) / 1024);
printf("Booted from %#x\n", mi->boot_device_drive);
/* setup the GDT */
if(_arch_setgdt(_gdt_4gb, sizeof(_gdt_4gb) / sizeof(*_gdt_4gb)) != 0)
{
puts("Could not setup the GDT");
return 4;
}
/* load the kernel */
if(!(mi->flags & BOOT_MULTIBOOT_INFO_HAS_MODS))
{
puts("No modules provided");
return 6;
}
if(mi->mods_count == 0)
{
puts("No kernel provided");
return 7;
}
mod = &mi->mods_addr[0];
printf("Loading kernel: %s\n", mod->cmdline);
if(multiboot_load_module(mod, &elfclass, &entrypoint) != 0)
{
puts("Could not load the kernel");
return 8;
}
/* forward the Multiboot information */
memcpy(&kmi, mi, sizeof(kmi));
kmi.loader_name = "DeforaOS uLoader";
kmi.cmdline = mod->cmdline;
kmi.mods_count = mi->mods_count - 1;
kmi.mods_addr = &mi->mods_addr[1];
/* hand control over to the kernel */
#ifdef DEBUG
printf("Jumping into the kernel at %#x (%u, %u, %#x)\n", entrypoint,
mi->elfshdr_num, mi->elfshdr_size, mi->elfshdr_addr);
#endif
switch(elfclass)
{
case ELFCLASS32:
puts("Detected 32-bit kernel");
return multiboot_boot_kernel32(&kmi, entrypoint);
case ELFCLASS64:
puts("Detected 64-bit kernel");
return multiboot_boot_kernel64(&kmi, entrypoint);
}
puts("Unsupported ELF class for the kernel");
return 7;
}
#endif
|
the_stack_data/22011665.c | #include <stdio.h>
#include <stdlib.h>
void init(int *t, int n)
{
for (int i = 0; i < n; i++)
{
t[i] = -1;
}
}
int *insert(int *t, int data, int i, int n)
{
if (t[i] == -1)
{
t[i] = data;
}
else
{
int l = 2 * i;
int r = (2 * i) + 1;
if (t[l] == -1)
{
t[l] = data;
}
else if (t[r] == -1)
{
t[r] = data;
}
else
{
if (l >= n)
{
t = insert(t, data, l / 2, n);
}
else if (r >= n)
{
t = insert(t, data, (r - 1) / 2, n);
}
else
{
if (l < n)
{
t = insert(t, data, l, n);
}
else
{
t = insert(t, data, r, n);
}
}
}
}
return t;
}
void preorder(int *t, int i, int n)
{
if (i < n)
{
printf("%d\t", t[i]);
preorder(t, 2 * i, n);
preorder(t, (2 * i) + 1, n);
}
}
int bt(int *t, int i, int n)
{
int l = 2 * i;
int r = (2 * i) + 1;
if (t[l] < t[i] && l < n)
{
bt(t, l, n);
}
else
{
return 0;
}
if (t[r] > t[i] && r < n)
{
bt(t, r, n);
}
else
{
return 0;
}
return 1;
}
int main()
{
int n;
int k;
int data;
printf("Enter the number of elemenets in the tree: ");
scanf("%d", &k);
n = k + 1;
int *t = (int *)malloc(n * sizeof(int));
init(t, n);
for (int i = 0; i < k; i++)
{
printf("Enter the data to be inserted: ");
scanf("%d", &data);
t = insert(t, data, 1, n);
}
printf("The tree in preorder is: ");
preorder(t, 1, n);
printf("\n");
int c = bt(t, 1, n);
if (c == 1)
{
printf("The tree is a binary search tree");
}
else
{
printf("The tree is not a binary search tree");
}
} |
the_stack_data/12637359.c | void _Z10forcepointR11QTextStream() {} ;
void _Z10noshowbaseR11QTextStream() {} ;
void _Z10qvsnprintfPcmPKcPv() {} ;
void _Z10scientificR11QTextStream() {} ;
void _Z11noforcesignR11QTextStream() {} ;
void _Z11qUncompressPKhi() {} ;
void _Z11qt_assert_xPKcS0_S0_i() {} ;
void _Z12noforcepointR11QTextStream() {} ;
void _Z12qInstallPathv() {} ;
void _Z12qSharedBuildv() {} ;
void _Z13lowercasebaseR11QTextStream() {} ;
void _Z13qErrnoWarningPKcz() {} ;
void _Z13qErrnoWarningiPKcz() {} ;
void _Z13uppercasebaseR11QTextStream() {} ;
void _Z14qSystemWarningPKci() {} ;
void _Z15lowercasedigitsR11QTextStream() {} ;
void _Z15qAddPostRoutinePFvvE() {} ;
void _Z15qt_error_stringi() {} ;
void _Z15uppercasedigitsR11QTextStream() {} ;
void _Z16qInstallPathBinsv() {} ;
void _Z16qInstallPathDatav() {} ;
void _Z16qInstallPathDocsv() {} ;
void _Z16qInstallPathLibsv() {} ;
void _Z16qt_check_pointerPKci() {} ;
void _Z17qt_message_output9QtMsgTypePKc() {} ;
void _Z18qInstallMsgHandlerPFv9QtMsgTypePKcE() {} ;
void _Z18qRemovePostRoutinePFvvE() {} ;
void _Z19qInstallPathHeadersv() {} ;
void _Z19qInstallPathPluginsv() {} ;
void _Z19qInstallPathSysconfv() {} ;
void _Z20qt_qFindChild_helperPK7QObjectRK7QStringRK11QMetaObject() {} ;
void _Z21qRegisterResourceDataiPKhS0_S0_() {} ;
void _Z23qUnregisterResourceDataiPKhS0_S0_() {} ;
void _Z23qt_qFindChildren_helperPK7QObjectRK7QStringPK7QRegExpRK11QMetaObjectP5QListIPvE() {} ;
void _Z24qInstallPathTranslationsv() {} ;
void _Z2wsR11QTextStream() {} ;
void _Z32qt_register_signal_spy_callbacksRK21QSignalSpyCallbackSet() {} ;
void _Z37qRegisterStaticPluginInstanceFunctionPFP7QObjectvE() {} ;
void _Z3binR11QTextStream() {} ;
void _Z3bomR11QTextStream() {} ;
void _Z3decR11QTextStream() {} ;
void _Z3hexR11QTextStream() {} ;
void _Z3octR11QTextStream() {} ;
void _Z4endlR11QTextStream() {} ;
void _Z4leftR11QTextStream() {} ;
void _Z5fixedR11QTextStream() {} ;
void _Z5flushR11QTextStream() {} ;
void _Z5qFreePv() {} ;
void _Z5qHashRK10QByteArray() {} ;
void _Z5qHashRK7QString() {} ;
void _Z5qrandv() {} ;
void _Z5resetR11QTextStream() {} ;
void _Z5rightR11QTextStream() {} ;
void _Z6centerR11QTextStream() {} ;
void _Z6qDebugPKcz() {} ;
void _Z6qFatalPKcz() {} ;
void _Z6qsrandj() {} ;
void _Z7qMallocm() {} ;
void _Z7qMemSetPvim() {} ;
void _Z7qgetenvPKc() {} ;
void _Z7qstrcmpPKcS0_() {} ;
void _Z7qstrcpyPcPKc() {} ;
void _Z7qstrdupPKc() {} ;
void _Z8qAppNamev() {} ;
void _Z8qMemCopyPvPKvm() {} ;
void _Z8qReallocPvm() {} ;
void _Z8qVersionv() {} ;
void _Z8qWarningPKcz() {} ;
void _Z8qstricmpPKcS0_() {} ;
void _Z8qstrncpyPcPKcj() {} ;
void _Z8showbaseR11QTextStream() {} ;
void _Z9forcesignR11QTextStream() {} ;
void _Z9qChecksumPKcj() {} ;
void _Z9qCompressPKhii() {} ;
void _Z9qCriticalPKcz() {} ;
void _Z9qsnprintfPcmPKcz() {} ;
void _Z9qstrnicmpPKcS0_j() {} ;
void _Z9qt_assertPKcS0_i() {} ;
void _ZN10QByteArray10fromBase64ERKS_() {} ;
void _ZN10QByteArray11fromRawDataEPKci() {} ;
void _ZN10QByteArray4chopEi() {} ;
void _ZN10QByteArray4fillEci() {} ;
void _ZN10QByteArray5clearEv() {} ;
void _ZN10QByteArray6appendEPKc() {} ;
void _ZN10QByteArray6appendERKS_() {} ;
void _ZN10QByteArray6appendEc() {} ;
void _ZN10QByteArray6expandEi() {} ;
void _ZN10QByteArray6insertEiPKc() {} ;
void _ZN10QByteArray6insertEiRKS_() {} ;
void _ZN10QByteArray6insertEic() {} ;
void _ZN10QByteArray6numberEdci() {} ;
void _ZN10QByteArray6numberEii() {} ;
void _ZN10QByteArray6numberEji() {} ;
void _ZN10QByteArray6numberExi() {} ;
void _ZN10QByteArray6numberEyi() {} ;
void _ZN10QByteArray6removeEii() {} ;
void _ZN10QByteArray6resizeEi() {} ;
void _ZN10QByteArray6setNumEdci() {} ;
void _ZN10QByteArray6setNumExi() {} ;
void _ZN10QByteArray6setNumEyi() {} ;
void _ZN10QByteArray7prependEPKc() {} ;
void _ZN10QByteArray7prependERKS_() {} ;
void _ZN10QByteArray7prependEc() {} ;
void _ZN10QByteArray7reallocEi() {} ;
void _ZN10QByteArray7replaceERKS_S1_() {} ;
void _ZN10QByteArray7replaceEcRKS_() {} ;
void _ZN10QByteArray7replaceEcc() {} ;
void _ZN10QByteArray7replaceEiiRKS_() {} ;
void _ZN10QByteArray8truncateEi() {} ;
void _ZN10QByteArrayC1EPKc() {} ;
void _ZN10QByteArrayC1EPKci() {} ;
void _ZN10QByteArrayC1Eic() {} ;
void _ZN10QByteArrayC2EPKc() {} ;
void _ZN10QByteArrayC2EPKci() {} ;
void _ZN10QByteArrayC2Eic() {} ;
void _ZN10QByteArrayaSEPKc() {} ;
void _ZN10QByteArrayaSERKS_() {} ;
void _ZN10QEventLoop11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN10QEventLoop11qt_metacastEPKc() {} ;
void _ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE() {} ;
void _ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEEi() {} ;
void _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE() {} ;
void _ZN10QEventLoop4exitEi() {} ;
void _ZN10QEventLoop4quitEv() {} ;
void _ZN10QEventLoop6wakeUpEv() {} ;
void _ZN10QEventLoopC1EP7QObject() {} ;
void _ZN10QEventLoopC2EP7QObject() {} ;
void _ZN10QEventLoopD0Ev() {} ;
void _ZN10QEventLoopD1Ev() {} ;
void _ZN10QEventLoopD2Ev() {} ;
void _ZN10QSemaphore10tryAcquireEi() {} ;
void _ZN10QSemaphore7acquireEi() {} ;
void _ZN10QSemaphore7releaseEi() {} ;
void _ZN10QSemaphoreC1Ei() {} ;
void _ZN10QSemaphoreC2Ei() {} ;
void _ZN10QSemaphoreD1Ev() {} ;
void _ZN10QSemaphoreD2Ev() {} ;
void _ZN10QTextCodec11codecForMibEi() {} ;
void _ZN10QTextCodec12codecForHtmlERK10QByteArray() {} ;
void _ZN10QTextCodec12codecForNameERK10QByteArray() {} ;
void _ZN10QTextCodec13availableMibsEv() {} ;
void _ZN10QTextCodec14codecForLocaleEv() {} ;
void _ZN10QTextCodec15availableCodecsEv() {} ;
void _ZN10QTextCodec17setCodecForLocaleEPS_() {} ;
void _ZN10QTextCodec6localeEv() {} ;
void _ZN10QTextCodecC1Ev() {} ;
void _ZN10QTextCodecC2Ev() {} ;
void _ZN10QTextCodecD0Ev() {} ;
void _ZN10QTextCodecD1Ev() {} ;
void _ZN10QTextCodecD2Ev() {} ;
void _ZN11QBasicTimer4stopEv() {} ;
void _ZN11QBasicTimer5startEiP7QObject() {} ;
void _ZN11QChildEventC1EN6QEvent4TypeEP7QObject() {} ;
void _ZN11QChildEventC2EN6QEvent4TypeEP7QObject() {} ;
void _ZN11QChildEventD0Ev() {} ;
void _ZN11QChildEventD1Ev() {} ;
void _ZN11QChildEventD2Ev() {} ;
void _ZN11QDataStream10writeBytesEPKcj() {} ;
void _ZN11QDataStream11readRawDataEPci() {} ;
void _ZN11QDataStream11resetStatusEv() {} ;
void _ZN11QDataStream11skipRawDataEi() {} ;
void _ZN11QDataStream11unsetDeviceEv() {} ;
void _ZN11QDataStream12setByteOrderENS_9ByteOrderE() {} ;
void _ZN11QDataStream12writeRawDataEPKci() {} ;
void _ZN11QDataStream9readBytesERPcRj() {} ;
void _ZN11QDataStream9setDeviceEP9QIODevice() {} ;
void _ZN11QDataStream9setStatusENS_6StatusE() {} ;
void _ZN11QDataStreamC1EP10QByteArray6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QDataStreamC1EP10QByteArrayi() {} ;
void _ZN11QDataStreamC1EP9QIODevice() {} ;
void _ZN11QDataStreamC1ERK10QByteArray() {} ;
void _ZN11QDataStreamC1Ev() {} ;
void _ZN11QDataStreamC2EP10QByteArray6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QDataStreamC2EP10QByteArrayi() {} ;
void _ZN11QDataStreamC2EP9QIODevice() {} ;
void _ZN11QDataStreamC2ERK10QByteArray() {} ;
void _ZN11QDataStreamC2Ev() {} ;
void _ZN11QDataStreamD0Ev() {} ;
void _ZN11QDataStreamD1Ev() {} ;
void _ZN11QDataStreamD2Ev() {} ;
void _ZN11QDataStreamlsEPKc() {} ;
void _ZN11QDataStreamlsEa() {} ;
void _ZN11QDataStreamlsEb() {} ;
void _ZN11QDataStreamlsEd() {} ;
void _ZN11QDataStreamlsEf() {} ;
void _ZN11QDataStreamlsEi() {} ;
void _ZN11QDataStreamlsEs() {} ;
void _ZN11QDataStreamlsEx() {} ;
void _ZN11QDataStreamrsERPc() {} ;
void _ZN11QDataStreamrsERa() {} ;
void _ZN11QDataStreamrsERb() {} ;
void _ZN11QDataStreamrsERd() {} ;
void _ZN11QDataStreamrsERf() {} ;
void _ZN11QDataStreamrsERi() {} ;
void _ZN11QDataStreamrsERs() {} ;
void _ZN11QDataStreamrsERx() {} ;
void _ZN11QMetaObject10disconnectEPK7QObjectiS2_i() {} ;
void _ZN11QMetaObject11changeGuardEPP7QObjectS1_() {} ;
void _ZN11QMetaObject11removeGuardEPP7QObject() {} ;
void _ZN11QMetaObject12invokeMethodEP7QObjectPKcN2Qt14ConnectionTypeE22QGenericReturnArgument16QGenericArgumentS7_S7_S7_S7_S7_S7_S7_S7_S7_() {} ;
void _ZN11QMetaObject14normalizedTypeEPKc() {} ;
void _ZN11QMetaObject16checkConnectArgsEPKcS1_() {} ;
void _ZN11QMetaObject18connectSlotsByNameEP7QObject() {} ;
void _ZN11QMetaObject19normalizedSignatureEPKc() {} ;
void _ZN11QMetaObject7connectEPK7QObjectiS2_iiPi() {} ;
void _ZN11QMetaObject8activateEP7QObjectPKS_iPPv() {} ;
void _ZN11QMetaObject8activateEP7QObjectPKS_iiPPv() {} ;
void _ZN11QMetaObject8activateEP7QObjectiPPv() {} ;
void _ZN11QMetaObject8activateEP7QObjectiiPPv() {} ;
void _ZN11QMetaObject8addGuardEPP7QObject() {} ;
void _ZN11QTextStream10setPadCharE5QChar() {} ;
void _ZN11QTextStream11resetStatusEv() {} ;
void _ZN11QTextStream11setEncodingENS_8EncodingE() {} ;
void _ZN11QTextStream13setFieldWidthEi() {} ;
void _ZN11QTextStream14setIntegerBaseEi() {} ;
void _ZN11QTextStream14setNumberFlagsE6QFlagsINS_10NumberFlagEE() {} ;
void _ZN11QTextStream14skipWhiteSpaceEv() {} ;
void _ZN11QTextStream17setFieldAlignmentENS_14FieldAlignmentE() {} ;
void _ZN11QTextStream20setAutoDetectUnicodeEb() {} ;
void _ZN11QTextStream21setRealNumberNotationENS_18RealNumberNotationE() {} ;
void _ZN11QTextStream22setRealNumberPrecisionEi() {} ;
void _ZN11QTextStream24setGenerateByteOrderMarkEb() {} ;
void _ZN11QTextStream4readEx() {} ;
void _ZN11QTextStream4seekEx() {} ;
void _ZN11QTextStream5flushEv() {} ;
void _ZN11QTextStream5resetEv() {} ;
void _ZN11QTextStream7readAllEv() {} ;
void _ZN11QTextStream8readLineEx() {} ;
void _ZN11QTextStream8setCodecEP10QTextCodec() {} ;
void _ZN11QTextStream8setCodecEPKc() {} ;
void _ZN11QTextStream9setDeviceEP9QIODevice() {} ;
void _ZN11QTextStream9setStatusENS_6StatusE() {} ;
void _ZN11QTextStream9setStringEP7QString6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC1EP10QByteArray6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC1EP7QString6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC1EP8_IO_FILE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC1EP9QIODevice() {} ;
void _ZN11QTextStreamC1ERK10QByteArray6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC1Ev() {} ;
void _ZN11QTextStreamC2EP10QByteArray6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC2EP7QString6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC2EP8_IO_FILE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC2EP9QIODevice() {} ;
void _ZN11QTextStreamC2ERK10QByteArray6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN11QTextStreamC2Ev() {} ;
void _ZN11QTextStreamD0Ev() {} ;
void _ZN11QTextStreamD1Ev() {} ;
void _ZN11QTextStreamD2Ev() {} ;
void _ZN11QTextStreamlsE5QBool() {} ;
void _ZN11QTextStreamlsE5QChar() {} ;
void _ZN11QTextStreamlsEPKc() {} ;
void _ZN11QTextStreamlsEPKv() {} ;
void _ZN11QTextStreamlsERK10QByteArray() {} ;
void _ZN11QTextStreamlsERK7QString() {} ;
void _ZN11QTextStreamlsEc() {} ;
void _ZN11QTextStreamlsEd() {} ;
void _ZN11QTextStreamlsEf() {} ;
void _ZN11QTextStreamlsEi() {} ;
void _ZN11QTextStreamlsEj() {} ;
void _ZN11QTextStreamlsEl() {} ;
void _ZN11QTextStreamlsEm() {} ;
void _ZN11QTextStreamlsEs() {} ;
void _ZN11QTextStreamlsEt() {} ;
void _ZN11QTextStreamlsEx() {} ;
void _ZN11QTextStreamlsEy() {} ;
void _ZN11QTextStreamrsEPc() {} ;
void _ZN11QTextStreamrsER10QByteArray() {} ;
void _ZN11QTextStreamrsER5QChar() {} ;
void _ZN11QTextStreamrsER7QString() {} ;
void _ZN11QTextStreamrsERc() {} ;
void _ZN11QTextStreamrsERd() {} ;
void _ZN11QTextStreamrsERf() {} ;
void _ZN11QTextStreamrsERi() {} ;
void _ZN11QTextStreamrsERj() {} ;
void _ZN11QTextStreamrsERl() {} ;
void _ZN11QTextStreamrsERm() {} ;
void _ZN11QTextStreamrsERs() {} ;
void _ZN11QTextStreamrsERt() {} ;
void _ZN11QTextStreamrsERx() {} ;
void _ZN11QTextStreamrsERy() {} ;
void _ZN11QTimerEventC1Ei() {} ;
void _ZN11QTimerEventC2Ei() {} ;
void _ZN11QTimerEventD0Ev() {} ;
void _ZN11QTimerEventD1Ev() {} ;
void _ZN11QTimerEventD2Ev() {} ;
void _ZN11QTranslator11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN11QTranslator11qt_metacastEPKc() {} ;
void _ZN11QTranslator4loadEPKhi() {} ;
void _ZN11QTranslator4loadERK7QStringS2_S2_S2_() {} ;
void _ZN11QTranslatorC1EP7QObject() {} ;
void _ZN11QTranslatorC1EP7QObjectPKc() {} ;
void _ZN11QTranslatorC2EP7QObject() {} ;
void _ZN11QTranslatorC2EP7QObjectPKc() {} ;
void _ZN11QTranslatorD0Ev() {} ;
void _ZN11QTranslatorD1Ev() {} ;
void _ZN11QTranslatorD2Ev() {} ;
void _ZN11QVectorData4growEiiib() {} ;
void _ZN11QVectorData6mallocEiiiPS_() {} ;
void _ZN12QCustomEventC1EiPv() {} ;
void _ZN12QCustomEventC2EiPv() {} ;
void _ZN12QCustomEventD0Ev() {} ;
void _ZN12QCustomEventD1Ev() {} ;
void _ZN12QCustomEventD2Ev() {} ;
void _ZN12QLibraryInfo16licensedProductsEv() {} ;
void _ZN12QLibraryInfo8buildKeyEv() {} ;
void _ZN12QLibraryInfo8licenseeEv() {} ;
void _ZN12QLibraryInfo8locationENS_15LibraryLocationE() {} ;
void _ZN12QTextDecoder9toUnicodeEPKci() {} ;
void _ZN12QTextDecoder9toUnicodeERK10QByteArray() {} ;
void _ZN12QTextDecoderD1Ev() {} ;
void _ZN12QTextDecoderD2Ev() {} ;
void _ZN12QTextEncoder11fromUnicodeEPK5QChari() {} ;
void _ZN12QTextEncoder11fromUnicodeERK7QString() {} ;
void _ZN12QTextEncoder11fromUnicodeERK7QStringRi() {} ;
void _ZN12QTextEncoderD1Ev() {} ;
void _ZN12QTextEncoderD2Ev() {} ;
void _ZN13QFSFileEngine11currentPathERK7QString() {} ;
void _ZN13QFSFileEngine11setFileNameERK7QString() {} ;
void _ZN13QFSFileEngine12endEntryListEv() {} ;
void _ZN13QFSFileEngine14beginEntryListE6QFlagsIN4QDir6FilterEERK11QStringList() {} ;
void _ZN13QFSFileEngine14setCurrentPathERK7QString() {} ;
void _ZN13QFSFileEngine14setPermissionsEj() {} ;
void _ZN13QFSFileEngine4copyERK7QString() {} ;
void _ZN13QFSFileEngine4linkERK7QString() {} ;
void _ZN13QFSFileEngine4openE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN13QFSFileEngine4openE6QFlagsIN9QIODevice12OpenModeFlagEEP8_IO_FILE() {} ;
void _ZN13QFSFileEngine4openE6QFlagsIN9QIODevice12OpenModeFlagEEi() {} ;
void _ZN13QFSFileEngine4readEPcx() {} ;
void _ZN13QFSFileEngine4seekEx() {} ;
void _ZN13QFSFileEngine5closeEv() {} ;
void _ZN13QFSFileEngine5flushEv() {} ;
void _ZN13QFSFileEngine5writeEPKcx() {} ;
void _ZN13QFSFileEngine6drivesEv() {} ;
void _ZN13QFSFileEngine6removeEv() {} ;
void _ZN13QFSFileEngine6renameERK7QString() {} ;
void _ZN13QFSFileEngine7setSizeEx() {} ;
void _ZN13QFSFileEngine8homePathEv() {} ;
void _ZN13QFSFileEngine8readLineEPcx() {} ;
void _ZN13QFSFileEngine8rootPathEv() {} ;
void _ZN13QFSFileEngine8tempPathEv() {} ;
void _ZN13QFSFileEngine9extensionEN19QAbstractFileEngine9ExtensionEPKNS0_15ExtensionOptionEPNS0_15ExtensionReturnE() {} ;
void _ZN13QFSFileEngineC1ERK7QString() {} ;
void _ZN13QFSFileEngineC1Ev() {} ;
void _ZN13QFSFileEngineC2ERK7QString() {} ;
void _ZN13QFSFileEngineC2Ev() {} ;
void _ZN13QFSFileEngineD0Ev() {} ;
void _ZN13QFSFileEngineD1Ev() {} ;
void _ZN13QFSFileEngineD2Ev() {} ;
void _ZN13QMetaPropertyC1Ev() {} ;
void _ZN13QMetaPropertyC2Ev() {} ;
void _ZN13QPluginLoader11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN13QPluginLoader11qt_metacastEPKc() {} ;
void _ZN13QPluginLoader11setFileNameERK7QString() {} ;
void _ZN13QPluginLoader15staticInstancesEv() {} ;
void _ZN13QPluginLoader4loadEv() {} ;
void _ZN13QPluginLoader6unloadEv() {} ;
void _ZN13QPluginLoader8instanceEv() {} ;
void _ZN13QPluginLoaderC1EP7QObject() {} ;
void _ZN13QPluginLoaderC1ERK7QStringP7QObject() {} ;
void _ZN13QPluginLoaderC2EP7QObject() {} ;
void _ZN13QPluginLoaderC2ERK7QStringP7QObject() {} ;
void _ZN13QPluginLoaderD0Ev() {} ;
void _ZN13QPluginLoaderD1Ev() {} ;
void _ZN13QPluginLoaderD2Ev() {} ;
void _ZN13QSignalMapper10setMappingEP7QObjectP7QWidget() {} ;
void _ZN13QSignalMapper10setMappingEP7QObjectRK7QString() {} ;
void _ZN13QSignalMapper10setMappingEP7QObjectS1_() {} ;
void _ZN13QSignalMapper10setMappingEP7QObjecti() {} ;
void _ZN13QSignalMapper11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN13QSignalMapper11qt_metacastEPKc() {} ;
void _ZN13QSignalMapper14removeMappingsEP7QObject() {} ;
void _ZN13QSignalMapper3mapEP7QObject() {} ;
void _ZN13QSignalMapper3mapEv() {} ;
void _ZN13QSignalMapper6mappedEP7QObject() {} ;
void _ZN13QSignalMapper6mappedEP7QWidget() {} ;
void _ZN13QSignalMapper6mappedERK7QString() {} ;
void _ZN13QSignalMapper6mappedEi() {} ;
void _ZN13QSignalMapperC1EP7QObject() {} ;
void _ZN13QSignalMapperC1EP7QObjectPKc() {} ;
void _ZN13QSignalMapperC2EP7QObject() {} ;
void _ZN13QSignalMapperC2EP7QObjectPKc() {} ;
void _ZN13QSignalMapperD0Ev() {} ;
void _ZN13QSignalMapperD1Ev() {} ;
void _ZN13QSignalMapperD2Ev() {} ;
void _ZN13QSystemLocaleC1Ev() {} ;
void _ZN13QSystemLocaleC2Ev() {} ;
void _ZN13QSystemLocaleD0Ev() {} ;
void _ZN13QSystemLocaleD1Ev() {} ;
void _ZN13QSystemLocaleD2Ev() {} ;
void _ZN14QReadWriteLock11lockForReadEv() {} ;
void _ZN14QReadWriteLock12lockForWriteEv() {} ;
void _ZN14QReadWriteLock14tryLockForReadEv() {} ;
void _ZN14QReadWriteLock15tryLockForWriteEv() {} ;
void _ZN14QReadWriteLock6unlockEv() {} ;
void _ZN14QReadWriteLockC1Ev() {} ;
void _ZN14QReadWriteLockC2Ev() {} ;
void _ZN14QReadWriteLockD1Ev() {} ;
void _ZN14QReadWriteLockD2Ev() {} ;
void _ZN14QStringMatcher10setPatternERK7QString() {} ;
void _ZN14QStringMatcher18setCaseSensitivityEN2Qt15CaseSensitivityE() {} ;
void _ZN14QStringMatcherC1ERK7QStringN2Qt15CaseSensitivityE() {} ;
void _ZN14QStringMatcherC1ERKS_() {} ;
void _ZN14QStringMatcherC1Ev() {} ;
void _ZN14QStringMatcherC2ERK7QStringN2Qt15CaseSensitivityE() {} ;
void _ZN14QStringMatcherC2ERKS_() {} ;
void _ZN14QStringMatcherC2Ev() {} ;
void _ZN14QStringMatcherD1Ev() {} ;
void _ZN14QStringMatcherD2Ev() {} ;
void _ZN14QStringMatcheraSERKS_() {} ;
void _ZN14QTemporaryFile11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN14QTemporaryFile11qt_metacastEPKc() {} ;
void _ZN14QTemporaryFile13setAutoRemoveEb() {} ;
void _ZN14QTemporaryFile15createLocalFileER5QFile() {} ;
void _ZN14QTemporaryFile15setFileTemplateERK7QString() {} ;
void _ZN14QTemporaryFile4openE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN14QTemporaryFileC1EP7QObject() {} ;
void _ZN14QTemporaryFileC1ERK7QString() {} ;
void _ZN14QTemporaryFileC1ERK7QStringP7QObject() {} ;
void _ZN14QTemporaryFileC1Ev() {} ;
void _ZN14QTemporaryFileC2EP7QObject() {} ;
void _ZN14QTemporaryFileC2ERK7QString() {} ;
void _ZN14QTemporaryFileC2ERK7QStringP7QObject() {} ;
void _ZN14QTemporaryFileC2Ev() {} ;
void _ZN14QTemporaryFileD0Ev() {} ;
void _ZN14QTemporaryFileD1Ev() {} ;
void _ZN14QTemporaryFileD2Ev() {} ;
void _ZN14QWaitCondition4waitEP6QMutexm() {} ;
void _ZN14QWaitCondition7wakeAllEv() {} ;
void _ZN14QWaitCondition7wakeOneEv() {} ;
void _ZN14QWaitConditionC1Ev() {} ;
void _ZN14QWaitConditionC2Ev() {} ;
void _ZN14QWaitConditionD1Ev() {} ;
void _ZN14QWaitConditionD2Ev() {} ;
void _ZN15QObjectUserDataD0Ev() {} ;
void _ZN15QObjectUserDataD1Ev() {} ;
void _ZN15QObjectUserDataD2Ev() {} ;
void _ZN15QSocketNotifier10setEnabledEb() {} ;
void _ZN15QSocketNotifier11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN15QSocketNotifier11qt_metacastEPKc() {} ;
void _ZN15QSocketNotifier5eventEP6QEvent() {} ;
void _ZN15QSocketNotifier9activatedEi() {} ;
void _ZN15QSocketNotifierC1EiNS_4TypeEP7QObject() {} ;
void _ZN15QSocketNotifierC1EiNS_4TypeEP7QObjectPKc() {} ;
void _ZN15QSocketNotifierC2EiNS_4TypeEP7QObject() {} ;
void _ZN15QSocketNotifierC2EiNS_4TypeEP7QObjectPKc() {} ;
void _ZN15QSocketNotifierD0Ev() {} ;
void _ZN15QSocketNotifierD1Ev() {} ;
void _ZN15QSocketNotifierD2Ev() {} ;
void _ZN16QCoreApplication10enter_loopEv() {} ;
void _ZN16QCoreApplication10startingUpEv() {} ;
void _ZN16QCoreApplication10unixSignalEi() {} ;
void _ZN16QCoreApplication11aboutToQuitEv() {} ;
void _ZN16QCoreApplication11closingDownEv() {} ;
void _ZN16QCoreApplication11filterEventEPvPl() {} ;
void _ZN16QCoreApplication11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN16QCoreApplication11qt_metacastEPKc() {} ;
void _ZN16QCoreApplication12libraryPathsEv() {} ;
void _ZN16QCoreApplication12setAttributeEN2Qt20ApplicationAttributeEb() {} ;
void _ZN16QCoreApplication13compressEventEP6QEventP7QObjectP14QPostEventList() {} ;
void _ZN16QCoreApplication13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE() {} ;
void _ZN16QCoreApplication13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEEi() {} ;
void _ZN16QCoreApplication13testAttributeEN2Qt20ApplicationAttributeE() {} ;
void _ZN16QCoreApplication14addLibraryPathERK7QString() {} ;
void _ZN16QCoreApplication14setEventFilterEPFbPvPlE() {} ;
void _ZN16QCoreApplication15applicationNameEv() {} ;
void _ZN16QCoreApplication15setLibraryPathsERK11QStringList() {} ;
void _ZN16QCoreApplication15watchUnixSignalEib() {} ;
void _ZN16QCoreApplication16hasPendingEventsEv() {} ;
void _ZN16QCoreApplication16organizationNameEv() {} ;
void _ZN16QCoreApplication16removeTranslatorEP11QTranslator() {} ;
void _ZN16QCoreApplication16sendPostedEventsEP7QObjecti() {} ;
void _ZN16QCoreApplication17installTranslatorEP11QTranslator() {} ;
void _ZN16QCoreApplication17removeLibraryPathERK7QString() {} ;
void _ZN16QCoreApplication18applicationDirPathEv() {} ;
void _ZN16QCoreApplication18organizationDomainEv() {} ;
void _ZN16QCoreApplication18removePostedEventsEP7QObject() {} ;
void _ZN16QCoreApplication18setApplicationNameERK7QString() {} ;
void _ZN16QCoreApplication19applicationFilePathEv() {} ;
void _ZN16QCoreApplication19setOrganizationNameERK7QString() {} ;
void _ZN16QCoreApplication21setOrganizationDomainERK7QString() {} ;
void _ZN16QCoreApplication4argcEv() {} ;
void _ZN16QCoreApplication4argvEv() {} ;
void _ZN16QCoreApplication4execEv() {} ;
void _ZN16QCoreApplication4exitEi() {} ;
void _ZN16QCoreApplication4quitEv() {} ;
void _ZN16QCoreApplication5eventEP6QEvent() {} ;
void _ZN16QCoreApplication5flushEv() {} ;
void _ZN16QCoreApplication6notifyEP7QObjectP6QEvent() {} ;
void _ZN16QCoreApplication9argumentsEv() {} ;
void _ZN16QCoreApplication9exit_loopEv() {} ;
void _ZN16QCoreApplication9loopLevelEv() {} ;
void _ZN16QCoreApplication9postEventEP7QObjectP6QEvent() {} ;
void _ZN16QCoreApplication9translateEPKcS1_S1_NS_8EncodingE() {} ;
void _ZN16QCoreApplication9translateEPKcS1_S1_NS_8EncodingEi() {} ;
void _ZN16QCoreApplicationC1ERiPPc() {} ;
void _ZN16QCoreApplicationC2ERiPPc() {} ;
void _ZN16QCoreApplicationD0Ev() {} ;
void _ZN16QCoreApplicationD1Ev() {} ;
void _ZN16QCoreApplicationD2Ev() {} ;
void _ZN16QTextCodecPlugin11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN16QTextCodecPlugin11qt_metacastEPKc() {} ;
void _ZN16QTextCodecPlugin6createERK7QString() {} ;
void _ZN16QTextCodecPluginC1EP7QObject() {} ;
void _ZN16QTextCodecPluginC2EP7QObject() {} ;
void _ZN16QTextCodecPluginD0Ev() {} ;
void _ZN16QTextCodecPluginD1Ev() {} ;
void _ZN16QTextCodecPluginD2Ev() {} ;
void _ZN17QByteArrayMatcher10setPatternERK10QByteArray() {} ;
void _ZN17QByteArrayMatcherC1ERK10QByteArray() {} ;
void _ZN17QByteArrayMatcherC1ERKS_() {} ;
void _ZN17QByteArrayMatcherC1Ev() {} ;
void _ZN17QByteArrayMatcherC2ERK10QByteArray() {} ;
void _ZN17QByteArrayMatcherC2ERKS_() {} ;
void _ZN17QByteArrayMatcherC2Ev() {} ;
void _ZN17QByteArrayMatcherD1Ev() {} ;
void _ZN17QByteArrayMatcherD2Ev() {} ;
void _ZN17QByteArrayMatcheraSERKS_() {} ;
void _ZN18QAbstractItemModel10decodeDataEiiRK11QModelIndexR11QDataStream() {} ;
void _ZN18QAbstractItemModel10insertRowsEiiRK11QModelIndex() {} ;
void _ZN18QAbstractItemModel10removeRowsEiiRK11QModelIndex() {} ;
void _ZN18QAbstractItemModel11dataChangedERK11QModelIndexS2_() {} ;
void _ZN18QAbstractItemModel11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN18QAbstractItemModel11qt_metacastEPKc() {} ;
void _ZN18QAbstractItemModel11setItemDataERK11QModelIndexRK4QMapIi8QVariantE() {} ;
void _ZN18QAbstractItemModel12dropMimeDataEPK9QMimeDataN2Qt10DropActionEiiRK11QModelIndex() {} ;
void _ZN18QAbstractItemModel13endInsertRowsEv() {} ;
void _ZN18QAbstractItemModel13endRemoveRowsEv() {} ;
void _ZN18QAbstractItemModel13insertColumnsEiiRK11QModelIndex() {} ;
void _ZN18QAbstractItemModel13layoutChangedEv() {} ;
void _ZN18QAbstractItemModel13removeColumnsEiiRK11QModelIndex() {} ;
void _ZN18QAbstractItemModel13setHeaderDataEiN2Qt11OrientationERK8QVarianti() {} ;
void _ZN18QAbstractItemModel15beginInsertRowsERK11QModelIndexii() {} ;
void _ZN18QAbstractItemModel15beginRemoveRowsERK11QModelIndexii() {} ;
void _ZN18QAbstractItemModel16endInsertColumnsEv() {} ;
void _ZN18QAbstractItemModel16endRemoveColumnsEv() {} ;
void _ZN18QAbstractItemModel17headerDataChangedEN2Qt11OrientationEii() {} ;
void _ZN18QAbstractItemModel18beginInsertColumnsERK11QModelIndexii() {} ;
void _ZN18QAbstractItemModel18beginRemoveColumnsERK11QModelIndexii() {} ;
void _ZN18QAbstractItemModel21changePersistentIndexERK11QModelIndexS2_() {} ;
void _ZN18QAbstractItemModel22layoutAboutToBeChangedEv() {} ;
void _ZN18QAbstractItemModel23setSupportedDragActionsE6QFlagsIN2Qt10DropActionEE() {} ;
void _ZN18QAbstractItemModel25changePersistentIndexListERK5QListI11QModelIndexES4_() {} ;
void _ZN18QAbstractItemModel4sortEiN2Qt9SortOrderE() {} ;
void _ZN18QAbstractItemModel5resetEv() {} ;
void _ZN18QAbstractItemModel6revertEv() {} ;
void _ZN18QAbstractItemModel6submitEv() {} ;
void _ZN18QAbstractItemModel7setDataERK11QModelIndexRK8QVarianti() {} ;
void _ZN18QAbstractItemModel9fetchMoreERK11QModelIndex() {} ;
void _ZN18QAbstractItemModelC1EP7QObject() {} ;
void _ZN18QAbstractItemModelC2EP7QObject() {} ;
void _ZN18QAbstractItemModelD0Ev() {} ;
void _ZN18QAbstractItemModelD1Ev() {} ;
void _ZN18QAbstractItemModelD2Ev() {} ;
void _ZN18QAbstractListModel11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN18QAbstractListModel11qt_metacastEPKc() {} ;
void _ZN18QAbstractListModel12dropMimeDataEPK9QMimeDataN2Qt10DropActionEiiRK11QModelIndex() {} ;
void _ZN18QAbstractListModelC1EP7QObject() {} ;
void _ZN18QAbstractListModelC2EP7QObject() {} ;
void _ZN18QAbstractListModelD0Ev() {} ;
void _ZN18QAbstractListModelD1Ev() {} ;
void _ZN18QAbstractListModelD2Ev() {} ;
void _ZN18QFileSystemWatcher10removePathERK7QString() {} ;
void _ZN18QFileSystemWatcher11fileChangedERK7QString() {} ;
void _ZN18QFileSystemWatcher11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN18QFileSystemWatcher11qt_metacastEPKc() {} ;
void _ZN18QFileSystemWatcher11removePathsERK11QStringList() {} ;
void _ZN18QFileSystemWatcher16directoryChangedERK7QString() {} ;
void _ZN18QFileSystemWatcher7addPathERK7QString() {} ;
void _ZN18QFileSystemWatcher8addPathsERK11QStringList() {} ;
void _ZN18QFileSystemWatcherC1EP7QObject() {} ;
void _ZN18QFileSystemWatcherC1ERK11QStringListP7QObject() {} ;
void _ZN18QFileSystemWatcherC2EP7QObject() {} ;
void _ZN18QFileSystemWatcherC2ERK11QStringListP7QObject() {} ;
void _ZN18QFileSystemWatcherD0Ev() {} ;
void _ZN18QFileSystemWatcherD1Ev() {} ;
void _ZN18QFileSystemWatcherD2Ev() {} ;
void _ZN18QThreadStorageData3setEPv() {} ;
void _ZN18QThreadStorageData6finishEPPv() {} ;
void _ZN18QThreadStorageDataC1EPFvPvE() {} ;
void _ZN18QThreadStorageDataC2EPFvPvE() {} ;
void _ZN18QThreadStorageDataD1Ev() {} ;
void _ZN18QThreadStorageDataD2Ev() {} ;
void _ZN19QAbstractFileEngine11setFileNameERK7QString() {} ;
void _ZN19QAbstractFileEngine12endEntryListEv() {} ;
void _ZN19QAbstractFileEngine14beginEntryListE6QFlagsIN4QDir6FilterEERK11QStringList() {} ;
void _ZN19QAbstractFileEngine14setPermissionsEj() {} ;
void _ZN19QAbstractFileEngine4copyERK7QString() {} ;
void _ZN19QAbstractFileEngine4linkERK7QString() {} ;
void _ZN19QAbstractFileEngine4openE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN19QAbstractFileEngine4readEPcx() {} ;
void _ZN19QAbstractFileEngine4seekEx() {} ;
void _ZN19QAbstractFileEngine5closeEv() {} ;
void _ZN19QAbstractFileEngine5flushEv() {} ;
void _ZN19QAbstractFileEngine5writeEPKcx() {} ;
void _ZN19QAbstractFileEngine6createERK7QString() {} ;
void _ZN19QAbstractFileEngine6removeEv() {} ;
void _ZN19QAbstractFileEngine6renameERK7QString() {} ;
void _ZN19QAbstractFileEngine7setSizeEx() {} ;
void _ZN19QAbstractFileEngine8readLineEPcx() {} ;
void _ZN19QAbstractFileEngine8setErrorEN5QFile9FileErrorERK7QString() {} ;
void _ZN19QAbstractFileEngine9extensionENS_9ExtensionEPKNS_15ExtensionOptionEPNS_15ExtensionReturnE() {} ;
void _ZN19QAbstractFileEngineC1Ev() {} ;
void _ZN19QAbstractFileEngineC2Ev() {} ;
void _ZN19QAbstractFileEngineD0Ev() {} ;
void _ZN19QAbstractFileEngineD1Ev() {} ;
void _ZN19QAbstractFileEngineD2Ev() {} ;
void _ZN19QAbstractTableModel11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN19QAbstractTableModel11qt_metacastEPKc() {} ;
void _ZN19QAbstractTableModel12dropMimeDataEPK9QMimeDataN2Qt10DropActionEiiRK11QModelIndex() {} ;
void _ZN19QAbstractTableModelC1EP7QObject() {} ;
void _ZN19QAbstractTableModelC2EP7QObject() {} ;
void _ZN19QAbstractTableModelD0Ev() {} ;
void _ZN19QAbstractTableModelD1Ev() {} ;
void _ZN19QAbstractTableModelD2Ev() {} ;
void _ZN21QObjectCleanupHandler11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN21QObjectCleanupHandler11qt_metacastEPKc() {} ;
void _ZN21QObjectCleanupHandler3addEP7QObject() {} ;
void _ZN21QObjectCleanupHandler5clearEv() {} ;
void _ZN21QObjectCleanupHandler6removeEP7QObject() {} ;
void _ZN21QObjectCleanupHandlerC1Ev() {} ;
void _ZN21QObjectCleanupHandlerC2Ev() {} ;
void _ZN21QObjectCleanupHandlerD0Ev() {} ;
void _ZN21QObjectCleanupHandlerD1Ev() {} ;
void _ZN21QObjectCleanupHandlerD2Ev() {} ;
void _ZN21QPersistentModelIndexC1ERK11QModelIndex() {} ;
void _ZN21QPersistentModelIndexC1ERKS_() {} ;
void _ZN21QPersistentModelIndexC1Ev() {} ;
void _ZN21QPersistentModelIndexC2ERK11QModelIndex() {} ;
void _ZN21QPersistentModelIndexC2ERKS_() {} ;
void _ZN21QPersistentModelIndexC2Ev() {} ;
void _ZN21QPersistentModelIndexD1Ev() {} ;
void _ZN21QPersistentModelIndexD2Ev() {} ;
void _ZN21QPersistentModelIndexaSERK11QModelIndex() {} ;
void _ZN21QPersistentModelIndexaSERKS_() {} ;
void _ZN24QAbstractEventDispatcher10startingUpEv() {} ;
void _ZN24QAbstractEventDispatcher11closingDownEv() {} ;
void _ZN24QAbstractEventDispatcher11filterEventEPv() {} ;
void _ZN24QAbstractEventDispatcher11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN24QAbstractEventDispatcher11qt_metacastEPKc() {} ;
void _ZN24QAbstractEventDispatcher12aboutToBlockEv() {} ;
void _ZN24QAbstractEventDispatcher13registerTimerEiP7QObject() {} ;
void _ZN24QAbstractEventDispatcher14setEventFilterEPFbPvE() {} ;
void _ZN24QAbstractEventDispatcher5awakeEv() {} ;
void _ZN24QAbstractEventDispatcher8instanceEP7QThread() {} ;
void _ZN24QAbstractEventDispatcherC1EP7QObject() {} ;
void _ZN24QAbstractEventDispatcherC2EP7QObject() {} ;
void _ZN24QAbstractEventDispatcherD0Ev() {} ;
void _ZN24QAbstractEventDispatcherD1Ev() {} ;
void _ZN24QAbstractEventDispatcherD2Ev() {} ;
void _ZN26QAbstractFileEngineHandlerC1Ev() {} ;
void _ZN26QAbstractFileEngineHandlerC2Ev() {} ;
void _ZN26QAbstractFileEngineHandlerD0Ev() {} ;
void _ZN26QAbstractFileEngineHandlerD1Ev() {} ;
void _ZN26QAbstractFileEngineHandlerD2Ev() {} ;
void _ZN27QDynamicPropertyChangeEventC1ERK10QByteArray() {} ;
void _ZN27QDynamicPropertyChangeEventC2ERK10QByteArray() {} ;
void _ZN27QDynamicPropertyChangeEventD0Ev() {} ;
void _ZN27QDynamicPropertyChangeEventD1Ev() {} ;
void _ZN27QDynamicPropertyChangeEventD2Ev() {} ;
void _ZN4QDir10setCurrentERK7QString() {} ;
void _ZN4QDir10setSortingE6QFlagsINS_8SortFlagEE() {} ;
void _ZN4QDir11currentPathEv() {} ;
void _ZN4QDir12makeAbsoluteEv() {} ;
void _ZN4QDir13setNameFilterERK7QString() {} ;
void _ZN4QDir14isRelativePathERK7QString() {} ;
void _ZN4QDir14setNameFiltersERK11QStringList() {} ;
void _ZN4QDir15setMatchAllDirsEb() {} ;
void _ZN4QDir17convertSeparatorsERK7QString() {} ;
void _ZN4QDir18toNativeSeparatorsERK7QString() {} ;
void _ZN4QDir20fromNativeSeparatorsERK7QString() {} ;
void _ZN4QDir21addResourceSearchPathERK7QString() {} ;
void _ZN4QDir21nameFiltersFromStringERK7QString() {} ;
void _ZN4QDir2cdERK7QString() {} ;
void _ZN4QDir4cdUpEv() {} ;
void _ZN4QDir5matchERK11QStringListRK7QString() {} ;
void _ZN4QDir5matchERK7QStringS2_() {} ;
void _ZN4QDir6drivesEv() {} ;
void _ZN4QDir6removeERK7QString() {} ;
void _ZN4QDir6renameERK7QStringS2_() {} ;
void _ZN4QDir7setPathERK7QString() {} ;
void _ZN4QDir8homePathEv() {} ;
void _ZN4QDir8rootPathEv() {} ;
void _ZN4QDir8tempPathEv() {} ;
void _ZN4QDir9cleanPathERK7QString() {} ;
void _ZN4QDir9separatorEv() {} ;
void _ZN4QDir9setFilterE6QFlagsINS_6FilterEE() {} ;
void _ZN4QDirC1ERK7QString() {} ;
void _ZN4QDirC1ERK7QStringS2_6QFlagsINS_8SortFlagEES3_INS_6FilterEE() {} ;
void _ZN4QDirC1ERKS_() {} ;
void _ZN4QDirC2ERK7QString() {} ;
void _ZN4QDirC2ERK7QStringS2_6QFlagsINS_8SortFlagEES3_INS_6FilterEE() {} ;
void _ZN4QDirC2ERKS_() {} ;
void _ZN4QDirD1Ev() {} ;
void _ZN4QDirD2Ev() {} ;
void _ZN4QDiraSERK7QString() {} ;
void _ZN4QDiraSERKS_() {} ;
void _ZN4QUrl10toPunycodeERK7QString() {} ;
void _ZN4QUrl11fromEncodedERK10QByteArray() {} ;
void _ZN4QUrl11fromEncodedERK10QByteArrayNS_11ParsingModeE() {} ;
void _ZN4QUrl11setFileNameERK7QString() {} ;
void _ZN4QUrl11setFragmentERK7QString() {} ;
void _ZN4QUrl11setPasswordERK7QString() {} ;
void _ZN4QUrl11setUserInfoERK7QString() {} ;
void _ZN4QUrl11setUserNameERK7QString() {} ;
void _ZN4QUrl12addQueryItemERK7QStringS2_() {} ;
void _ZN4QUrl12fromPunycodeERK10QByteArray() {} ;
void _ZN4QUrl12idnWhitelistEv() {} ;
void _ZN4QUrl12setAuthorityERK7QString() {} ;
void _ZN4QUrl13fromLocalFileERK7QString() {} ;
void _ZN4QUrl13setEncodedUrlERK10QByteArray() {} ;
void _ZN4QUrl13setEncodedUrlERK10QByteArrayNS_11ParsingModeE() {} ;
void _ZN4QUrl13setQueryItemsERK5QListI5QPairI7QStringS2_EE() {} ;
void _ZN4QUrl15removeQueryItemERK7QString() {} ;
void _ZN4QUrl15setEncodedQueryERK10QByteArray() {} ;
void _ZN4QUrl15setIdnWhitelistERK11QStringList() {} ;
void _ZN4QUrl17toPercentEncodingERK7QStringRK10QByteArrayS5_() {} ;
void _ZN4QUrl18setQueryDelimitersEcc() {} ;
void _ZN4QUrl19fromPercentEncodingERK10QByteArray() {} ;
void _ZN4QUrl19removeAllQueryItemsERK7QString() {} ;
void _ZN4QUrl5clearEv() {} ;
void _ZN4QUrl5toAceERK7QString() {} ;
void _ZN4QUrl6detachEv() {} ;
void _ZN4QUrl6setUrlERK7QString() {} ;
void _ZN4QUrl6setUrlERK7QStringNS_11ParsingModeE() {} ;
void _ZN4QUrl7fromAceERK10QByteArray() {} ;
void _ZN4QUrl7setHostERK7QString() {} ;
void _ZN4QUrl7setPathERK7QString() {} ;
void _ZN4QUrl7setPortEi() {} ;
void _ZN4QUrl9setSchemeERK7QString() {} ;
void _ZN4QUrlC1ERK7QString() {} ;
void _ZN4QUrlC1ERK7QStringNS_11ParsingModeE() {} ;
void _ZN4QUrlC1ERKS_() {} ;
void _ZN4QUrlC1Ev() {} ;
void _ZN4QUrlC2ERK7QString() {} ;
void _ZN4QUrlC2ERK7QStringNS_11ParsingModeE() {} ;
void _ZN4QUrlC2ERKS_() {} ;
void _ZN4QUrlC2Ev() {} ;
void _ZN4QUrlD1Ev() {} ;
void _ZN4QUrlD2Ev() {} ;
void _ZN4QUrlaSERK7QString() {} ;
void _ZN4QUrlaSERKS_() {} ;
void _ZN5QChar9fromAsciiEc() {} ;
void _ZN5QCharC1Ec() {} ;
void _ZN5QCharC1Eh() {} ;
void _ZN5QCharC2Ec() {} ;
void _ZN5QCharC2Eh() {} ;
void _ZN5QDate10fromStringERK7QStringN2Qt10DateFormatE() {} ;
void _ZN5QDate10fromStringERK7QStringS2_() {} ;
void _ZN5QDate10isLeapYearEi() {} ;
void _ZN5QDate11currentDateEv() {} ;
void _ZN5QDate11longDayNameEi() {} ;
void _ZN5QDate12shortDayNameEi() {} ;
void _ZN5QDate13longMonthNameEi() {} ;
void _ZN5QDate14shortMonthNameEi() {} ;
void _ZN5QDate17gregorianToJulianEiii() {} ;
void _ZN5QDate17julianToGregorianEjRiS0_S0_() {} ;
void _ZN5QDate6setYMDEiii() {} ;
void _ZN5QDate7isValidEiii() {} ;
void _ZN5QDate7setDateEiii() {} ;
void _ZN5QDateC1Eiii() {} ;
void _ZN5QDateC2Eiii() {} ;
void _ZN5QFile10decodeNameERK10QByteArray() {} ;
void _ZN5QFile10encodeNameERK7QString() {} ;
void _ZN5QFile10unsetErrorEv() {} ;
void _ZN5QFile11permissionsERK7QString() {} ;
void _ZN5QFile11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN5QFile11qt_metacastEPKc() {} ;
void _ZN5QFile11setFileNameERK7QString() {} ;
void _ZN5QFile12readLineDataEPcx() {} ;
void _ZN5QFile14setPermissionsE6QFlagsINS_10PermissionEE() {} ;
void _ZN5QFile14setPermissionsERK7QString6QFlagsINS_10PermissionEE() {} ;
void _ZN5QFile19setDecodingFunctionEPF7QStringRK10QByteArrayE() {} ;
void _ZN5QFile19setEncodingFunctionEPF10QByteArrayRK7QStringE() {} ;
void _ZN5QFile4copyERK7QString() {} ;
void _ZN5QFile4copyERK7QStringS2_() {} ;
void _ZN5QFile4linkERK7QString() {} ;
void _ZN5QFile4linkERK7QStringS2_() {} ;
void _ZN5QFile4openE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN5QFile4openEP8_IO_FILE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN5QFile4openEi6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN5QFile4seekEx() {} ;
void _ZN5QFile5closeEv() {} ;
void _ZN5QFile5flushEv() {} ;
void _ZN5QFile6existsERK7QString() {} ;
void _ZN5QFile6removeERK7QString() {} ;
void _ZN5QFile6removeEv() {} ;
void _ZN5QFile6renameERK7QString() {} ;
void _ZN5QFile6renameERK7QStringS2_() {} ;
void _ZN5QFile6resizeERK7QStringx() {} ;
void _ZN5QFile6resizeEx() {} ;
void _ZN5QFile8readDataEPcx() {} ;
void _ZN5QFile8readLinkERK7QString() {} ;
void _ZN5QFile9writeDataEPKcx() {} ;
void _ZN5QFileC1EP7QObject() {} ;
void _ZN5QFileC1ERK7QString() {} ;
void _ZN5QFileC1ERK7QStringP7QObject() {} ;
void _ZN5QFileC1Ev() {} ;
void _ZN5QFileC2EP7QObject() {} ;
void _ZN5QFileC2ERK7QString() {} ;
void _ZN5QFileC2ERK7QStringP7QObject() {} ;
void _ZN5QFileC2Ev() {} ;
void _ZN5QFileD0Ev() {} ;
void _ZN5QFileD1Ev() {} ;
void _ZN5QFileD2Ev() {} ;
void _ZN5QRect10moveCenterERK6QPoint() {} ;
void _ZN5QSize5scaleERKS_N2Qt15AspectRatioModeE() {} ;
void _ZN5QSize9transposeEv() {} ;
void _ZN5QTime10fromStringERK7QStringN2Qt10DateFormatE() {} ;
void _ZN5QTime10fromStringERK7QStringS2_() {} ;
void _ZN5QTime11currentTimeEv() {} ;
void _ZN5QTime5startEv() {} ;
void _ZN5QTime6setHMSEiiii() {} ;
void _ZN5QTime7isValidEiiii() {} ;
void _ZN5QTime7restartEv() {} ;
void _ZN5QTimeC1Eiiii() {} ;
void _ZN5QTimeC2Eiiii() {} ;
void _ZN5QUuid10createUuidEv() {} ;
void _ZN5QUuidC1EPKc() {} ;
void _ZN5QUuidC1ERK7QString() {} ;
void _ZN5QUuidC2EPKc() {} ;
void _ZN5QUuidC2ERK7QString() {} ;
void _ZN6QEventC1ENS_4TypeE() {} ;
void _ZN6QEventC2ENS_4TypeE() {} ;
void _ZN6QEventD0Ev() {} ;
void _ZN6QEventD1Ev() {} ;
void _ZN6QEventD2Ev() {} ;
void _ZN6QMutex4lockEv() {} ;
void _ZN6QMutex6unlockEv() {} ;
void _ZN6QMutex7tryLockEv() {} ;
void _ZN6QMutexC1ENS_13RecursionModeE() {} ;
void _ZN6QMutexC2ENS_13RecursionModeE() {} ;
void _ZN6QMutexD1Ev() {} ;
void _ZN6QMutexD2Ev() {} ;
void _ZN6QSizeF5scaleERKS_N2Qt15AspectRatioModeE() {} ;
void _ZN6QSizeF9transposeEv() {} ;
void _ZN6QTimer10singleShotEiP7QObjectPKc() {} ;
void _ZN6QTimer10timerEventEP11QTimerEvent() {} ;
void _ZN6QTimer11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN6QTimer11qt_metacastEPKc() {} ;
void _ZN6QTimer11setIntervalEi() {} ;
void _ZN6QTimer4stopEv() {} ;
void _ZN6QTimer5startEi() {} ;
void _ZN6QTimer5startEib() {} ;
void _ZN6QTimer5startEv() {} ;
void _ZN6QTimer7timeoutEv() {} ;
void _ZN6QTimerC1EP7QObject() {} ;
void _ZN6QTimerC1EP7QObjectPKc() {} ;
void _ZN6QTimerC2EP7QObject() {} ;
void _ZN6QTimerC2EP7QObjectPKc() {} ;
void _ZN6QTimerD0Ev() {} ;
void _ZN6QTimerD1Ev() {} ;
void _ZN6QTimerD2Ev() {} ;
void _ZN7QBuffer11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN7QBuffer11qt_metacastEPKc() {} ;
void _ZN7QBuffer4openE6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN7QBuffer4seekEx() {} ;
void _ZN7QBuffer5closeEv() {} ;
void _ZN7QBuffer6bufferEv() {} ;
void _ZN7QBuffer7setDataERK10QByteArray() {} ;
void _ZN7QBuffer8readDataEPcx() {} ;
void _ZN7QBuffer9setBufferEP10QByteArray() {} ;
void _ZN7QBuffer9writeDataEPKcx() {} ;
void _ZN7QBufferC1EP10QByteArrayP7QObject() {} ;
void _ZN7QBufferC1EP7QObject() {} ;
void _ZN7QBufferC2EP10QByteArrayP7QObject() {} ;
void _ZN7QBufferC2EP7QObject() {} ;
void _ZN7QBufferD0Ev() {} ;
void _ZN7QBufferD1Ev() {} ;
void _ZN7QBufferD2Ev() {} ;
void _ZN7QLocale10setDefaultERKS_() {} ;
void _ZN7QLocale15countryToStringENS_7CountryE() {} ;
void _ZN7QLocale16languageToStringENS_8LanguageE() {} ;
void _ZN7QLocale16setNumberOptionsE6QFlagsINS_12NumberOptionEE() {} ;
void _ZN7QLocale6systemEv() {} ;
void _ZN7QLocaleC1ENS_8LanguageENS_7CountryE() {} ;
void _ZN7QLocaleC1ERK7QString() {} ;
void _ZN7QLocaleC1ERKS_() {} ;
void _ZN7QLocaleC1Ev() {} ;
void _ZN7QLocaleC2ENS_8LanguageENS_7CountryE() {} ;
void _ZN7QLocaleC2ERK7QString() {} ;
void _ZN7QLocaleC2ERKS_() {} ;
void _ZN7QLocaleC2Ev() {} ;
void _ZN7QLocaleaSERKS_() {} ;
void _ZN7QObject10childEventEP11QChildEvent() {} ;
void _ZN7QObject10disconnectEPKS_PKcS1_S3_() {} ;
void _ZN7QObject10startTimerEi() {} ;
void _ZN7QObject10timerEventEP11QTimerEvent() {} ;
void _ZN7QObject11customEventEP6QEvent() {} ;
void _ZN7QObject11deleteLaterEv() {} ;
void _ZN7QObject11eventFilterEPS_P6QEvent() {} ;
void _ZN7QObject11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN7QObject11qt_metacastEPKc() {} ;
void _ZN7QObject11setPropertyEPKcRK8QVariant() {} ;
void _ZN7QObject11setUserDataEjP15QObjectUserData() {} ;
void _ZN7QObject12blockSignalsEb() {} ;
void _ZN7QObject12moveToThreadEP7QThread() {} ;
void _ZN7QObject13connectNotifyEPKc() {} ;
void _ZN7QObject13setObjectNameERK7QString() {} ;
void _ZN7QObject14dumpObjectInfoEv() {} ;
void _ZN7QObject14dumpObjectTreeEv() {} ;
void _ZN7QObject16disconnectNotifyEPKc() {} ;
void _ZN7QObject16registerUserDataEv() {} ;
void _ZN7QObject17removeEventFilterEPS_() {} ;
void _ZN7QObject18installEventFilterEPS_() {} ;
void _ZN7QObject5eventEP6QEvent() {} ;
void _ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE() {} ;
void _ZN7QObject9destroyedEPS_() {} ;
void _ZN7QObject9killTimerEi() {} ;
void _ZN7QObject9setParentEPS_() {} ;
void _ZN7QObjectC1EPS_() {} ;
void _ZN7QObjectC1EPS_PKc() {} ;
void _ZN7QObjectC2EPS_() {} ;
void _ZN7QObjectC2EPS_PKc() {} ;
void _ZN7QObjectD0Ev() {} ;
void _ZN7QObjectD1Ev() {} ;
void _ZN7QObjectD2Ev() {} ;
void _ZN7QRegExp10setMinimalEb() {} ;
void _ZN7QRegExp10setPatternERK7QString() {} ;
void _ZN7QRegExp11errorStringEv() {} ;
void _ZN7QRegExp13capturedTextsEv() {} ;
void _ZN7QRegExp16setPatternSyntaxENS_13PatternSyntaxE() {} ;
void _ZN7QRegExp18setCaseSensitivityEN2Qt15CaseSensitivityE() {} ;
void _ZN7QRegExp3capEi() {} ;
void _ZN7QRegExp3posEi() {} ;
void _ZN7QRegExp6escapeERK7QString() {} ;
void _ZN7QRegExpC1ERK7QStringN2Qt15CaseSensitivityENS_13PatternSyntaxE() {} ;
void _ZN7QRegExpC1ERKS_() {} ;
void _ZN7QRegExpC1Ev() {} ;
void _ZN7QRegExpC2ERK7QStringN2Qt15CaseSensitivityENS_13PatternSyntaxE() {} ;
void _ZN7QRegExpC2ERKS_() {} ;
void _ZN7QRegExpC2Ev() {} ;
void _ZN7QRegExpD1Ev() {} ;
void _ZN7QRegExpD2Ev() {} ;
void _ZN7QRegExpaSERKS_() {} ;
void _ZN7QString10fromLatin1EPKci() {} ;
void _ZN7QString10setUnicodeEPK5QChari() {} ;
void _ZN7QString11fromRawDataEPK5QChari() {} ;
void _ZN7QString13fromLocal8BitEPKci() {} ;
void _ZN7QString14fromWCharArrayEPKwi() {} ;
void _ZN7QString16fromAscii_helperEPKci() {} ;
void _ZN7QString17fromLatin1_helperEPKci() {} ;
void _ZN7QString4chopEi() {} ;
void _ZN7QString4fillE5QChari() {} ;
void _ZN7QString4freeEPNS_4DataE() {} ;
void _ZN7QString6appendE5QChar() {} ;
void _ZN7QString6appendERK13QLatin1String() {} ;
void _ZN7QString6appendERKS_() {} ;
void _ZN7QString6expandEi() {} ;
void _ZN7QString6insertEi5QChar() {} ;
void _ZN7QString6insertEiPK5QChari() {} ;
void _ZN7QString6insertEiRK13QLatin1String() {} ;
void _ZN7QString6numberEdci() {} ;
void _ZN7QString6numberEii() {} ;
void _ZN7QString6numberEji() {} ;
void _ZN7QString6numberEli() {} ;
void _ZN7QString6numberEmi() {} ;
void _ZN7QString6numberExi() {} ;
void _ZN7QString6numberEyi() {} ;
void _ZN7QString6removeE5QCharN2Qt15CaseSensitivityE() {} ;
void _ZN7QString6removeERKS_N2Qt15CaseSensitivityE() {} ;
void _ZN7QString6removeEii() {} ;
void _ZN7QString6resizeEi() {} ;
void _ZN7QString6setNumEdci() {} ;
void _ZN7QString6setNumExi() {} ;
void _ZN7QString6setNumEyi() {} ;
void _ZN7QString7reallocEi() {} ;
void _ZN7QString7reallocEv() {} ;
void _ZN7QString7replaceE5QCharRKS_N2Qt15CaseSensitivityE() {} ;
void _ZN7QString7replaceE5QCharS0_N2Qt15CaseSensitivityE() {} ;
void _ZN7QString7replaceERK7QRegExpRKS_() {} ;
void _ZN7QString7replaceERKS_S1_N2Qt15CaseSensitivityE() {} ;
void _ZN7QString7replaceEii5QChar() {} ;
void _ZN7QString7replaceEiiPK5QChari() {} ;
void _ZN7QString7replaceEiiRKS_() {} ;
void _ZN7QString7sprintfEPKcz() {} ;
void _ZN7QString8fromUcs4EPKji() {} ;
void _ZN7QString8fromUtf8EPKci() {} ;
void _ZN7QString8truncateEi() {} ;
void _ZN7QString9fromAsciiEPKci() {} ;
void _ZN7QString9fromUtf16EPKti() {} ;
void _ZN7QStringC1E5QChar() {} ;
void _ZN7QStringC1EPK5QChari() {} ;
void _ZN7QStringC1Ei5QChar() {} ;
void _ZN7QStringC2E5QChar() {} ;
void _ZN7QStringC2EPK5QChari() {} ;
void _ZN7QStringC2Ei5QChar() {} ;
void _ZN7QStringaSE5QChar() {} ;
void _ZN7QStringaSERKS_() {} ;
void _ZN7QThread10terminatedEv() {} ;
void _ZN7QThread11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN7QThread11qt_metacastEPKc() {} ;
void _ZN7QThread11setPriorityENS_8PriorityE() {} ;
void _ZN7QThread12setStackSizeEj() {} ;
void _ZN7QThread13currentThreadEv() {} ;
void _ZN7QThread15currentThreadIdEv() {} ;
void _ZN7QThread21setTerminationEnabledEb() {} ;
void _ZN7QThread4execEv() {} ;
void _ZN7QThread4exitEi() {} ;
void _ZN7QThread4quitEv() {} ;
void _ZN7QThread4waitEm() {} ;
void _ZN7QThread5sleepEm() {} ;
void _ZN7QThread5startENS_8PriorityE() {} ;
void _ZN7QThread6msleepEm() {} ;
void _ZN7QThread6usleepEm() {} ;
void _ZN7QThread7startedEv() {} ;
void _ZN7QThread8finishedEv() {} ;
void _ZN7QThread9terminateEv() {} ;
void _ZN7QThreadC1EP7QObject() {} ;
void _ZN7QThreadC2EP7QObject() {} ;
void _ZN7QThreadD0Ev() {} ;
void _ZN7QThreadD1Ev() {} ;
void _ZN7QThreadD2Ev() {} ;
void _ZN8QLibrary11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN8QLibrary11qt_metacastEPKc() {} ;
void _ZN8QLibrary11setFileNameERK7QString() {} ;
void _ZN8QLibrary12setLoadHintsE6QFlagsINS_8LoadHintEE() {} ;
void _ZN8QLibrary21setFileNameAndVersionERK7QStringi() {} ;
void _ZN8QLibrary4loadEv() {} ;
void _ZN8QLibrary6unloadEv() {} ;
void _ZN8QLibrary7resolveEPKc() {} ;
void _ZN8QLibrary7resolveERK7QStringPKc() {} ;
void _ZN8QLibrary7resolveERK7QStringiPKc() {} ;
void _ZN8QLibrary9isLibraryERK7QString() {} ;
void _ZN8QLibraryC1EP7QObject() {} ;
void _ZN8QLibraryC1ERK7QStringP7QObject() {} ;
void _ZN8QLibraryC1ERK7QStringiP7QObject() {} ;
void _ZN8QLibraryC2EP7QObject() {} ;
void _ZN8QLibraryC2ERK7QStringP7QObject() {} ;
void _ZN8QLibraryC2ERK7QStringiP7QObject() {} ;
void _ZN8QLibraryD0Ev() {} ;
void _ZN8QLibraryD1Ev() {} ;
void _ZN8QLibraryD2Ev() {} ;
void _ZN8QMapData10createDataEv() {} ;
void _ZN8QMapData11node_createEPPNS_4NodeEi() {} ;
void _ZN8QMapData11node_deleteEPPNS_4NodeEiS1_() {} ;
void _ZN8QMapData16continueFreeDataEi() {} ;
void _ZN8QProcess11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN8QProcess11qt_metacastEPKc() {} ;
void _ZN8QProcess12stateChangedENS_12ProcessStateE() {} ;
void _ZN8QProcess13startDetachedERK7QString() {} ;
void _ZN8QProcess13startDetachedERK7QStringRK11QStringList() {} ;
void _ZN8QProcess14setEnvironmentERK11QStringList() {} ;
void _ZN8QProcess14setReadChannelENS_14ProcessChannelE() {} ;
void _ZN8QProcess14waitForStartedEi() {} ;
void _ZN8QProcess15setProcessStateENS_12ProcessStateE() {} ;
void _ZN8QProcess15waitForFinishedEi() {} ;
void _ZN8QProcess16closeReadChannelENS_14ProcessChannelE() {} ;
void _ZN8QProcess16waitForReadyReadEi() {} ;
void _ZN8QProcess17closeWriteChannelEv() {} ;
void _ZN8QProcess17setupChildProcessEv() {} ;
void _ZN8QProcess17systemEnvironmentEv() {} ;
void _ZN8QProcess18setReadChannelModeENS_18ProcessChannelModeE() {} ;
void _ZN8QProcess19setWorkingDirectoryERK7QString() {} ;
void _ZN8QProcess19waitForBytesWrittenEi() {} ;
void _ZN8QProcess20readAllStandardErrorEv() {} ;
void _ZN8QProcess20setStandardErrorFileERK7QString6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN8QProcess20setStandardInputFileERK7QString() {} ;
void _ZN8QProcess21readAllStandardOutputEv() {} ;
void _ZN8QProcess21setProcessChannelModeENS_18ProcessChannelModeE() {} ;
void _ZN8QProcess21setStandardOutputFileERK7QString6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN8QProcess22readyReadStandardErrorEv() {} ;
void _ZN8QProcess23readyReadStandardOutputEv() {} ;
void _ZN8QProcess24setStandardOutputProcessEPS_() {} ;
void _ZN8QProcess4killEv() {} ;
void _ZN8QProcess5closeEv() {} ;
void _ZN8QProcess5errorENS_12ProcessErrorE() {} ;
void _ZN8QProcess5startERK7QString6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN8QProcess5startERK7QStringRK11QStringList6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _ZN8QProcess7executeERK7QString() {} ;
void _ZN8QProcess7executeERK7QStringRK11QStringList() {} ;
void _ZN8QProcess7startedEv() {} ;
void _ZN8QProcess8finishedEi() {} ;
void _ZN8QProcess8finishedEiNS_10ExitStatusE() {} ;
void _ZN8QProcess8readDataEPcx() {} ;
void _ZN8QProcess9terminateEv() {} ;
void _ZN8QProcess9writeDataEPKcx() {} ;
void _ZN8QProcessC1EP7QObject() {} ;
void _ZN8QProcessC2EP7QObject() {} ;
void _ZN8QProcessD0Ev() {} ;
void _ZN8QProcessD1Ev() {} ;
void _ZN8QProcessD2Ev() {} ;
void _ZN8QVariant10nameToTypeEPKc() {} ;
void _ZN8QVariant10typeToNameENS_4TypeE() {} ;
void _ZN8QVariant12castOrDetachENS_4TypeE() {} ;
void _ZN8QVariant4dataEv() {} ;
void _ZN8QVariant4loadER11QDataStream() {} ;
void _ZN8QVariant5clearEv() {} ;
void _ZN8QVariant6createEiPKv() {} ;
void _ZN8QVariant6detachEv() {} ;
void _ZN8QVariant7convertENS_4TypeE() {} ;
void _ZN8QVariantC1EN2Qt11GlobalColorE() {} ;
void _ZN8QVariantC1ENS_4TypeE() {} ;
void _ZN8QVariantC1EPKc() {} ;
void _ZN8QVariantC1ER11QDataStream() {} ;
void _ZN8QVariantC1ERK10QByteArray() {} ;
void _ZN8QVariantC1ERK11QStringList() {} ;
void _ZN8QVariantC1ERK13QLatin1String() {} ;
void _ZN8QVariantC1ERK4QMapI7QStringS_E() {} ;
void _ZN8QVariantC1ERK4QUrl() {} ;
void _ZN8QVariantC1ERK5QChar() {} ;
void _ZN8QVariantC1ERK5QDate() {} ;
void _ZN8QVariantC1ERK5QLine() {} ;
void _ZN8QVariantC1ERK5QListIS_E() {} ;
void _ZN8QVariantC1ERK5QRect() {} ;
void _ZN8QVariantC1ERK5QSize() {} ;
void _ZN8QVariantC1ERK5QTime() {} ;
void _ZN8QVariantC1ERK6QLineF() {} ;
void _ZN8QVariantC1ERK6QPoint() {} ;
void _ZN8QVariantC1ERK6QRectF() {} ;
void _ZN8QVariantC1ERK6QSizeF() {} ;
void _ZN8QVariantC1ERK7QLocale() {} ;
void _ZN8QVariantC1ERK7QPointF() {} ;
void _ZN8QVariantC1ERK7QRegExp() {} ;
void _ZN8QVariantC1ERK7QString() {} ;
void _ZN8QVariantC1ERK9QBitArray() {} ;
void _ZN8QVariantC1ERK9QDateTime() {} ;
void _ZN8QVariantC1ERKS_() {} ;
void _ZN8QVariantC1Eb() {} ;
void _ZN8QVariantC1Ed() {} ;
void _ZN8QVariantC1Ei() {} ;
void _ZN8QVariantC1EiPKv() {} ;
void _ZN8QVariantC1Ej() {} ;
void _ZN8QVariantC1Ex() {} ;
void _ZN8QVariantC1Ey() {} ;
void _ZN8QVariantC2EN2Qt11GlobalColorE() {} ;
void _ZN8QVariantC2ENS_4TypeE() {} ;
void _ZN8QVariantC2EPKc() {} ;
void _ZN8QVariantC2ER11QDataStream() {} ;
void _ZN8QVariantC2ERK10QByteArray() {} ;
void _ZN8QVariantC2ERK11QStringList() {} ;
void _ZN8QVariantC2ERK13QLatin1String() {} ;
void _ZN8QVariantC2ERK4QMapI7QStringS_E() {} ;
void _ZN8QVariantC2ERK4QUrl() {} ;
void _ZN8QVariantC2ERK5QChar() {} ;
void _ZN8QVariantC2ERK5QDate() {} ;
void _ZN8QVariantC2ERK5QLine() {} ;
void _ZN8QVariantC2ERK5QListIS_E() {} ;
void _ZN8QVariantC2ERK5QRect() {} ;
void _ZN8QVariantC2ERK5QSize() {} ;
void _ZN8QVariantC2ERK5QTime() {} ;
void _ZN8QVariantC2ERK6QLineF() {} ;
void _ZN8QVariantC2ERK6QPoint() {} ;
void _ZN8QVariantC2ERK6QRectF() {} ;
void _ZN8QVariantC2ERK6QSizeF() {} ;
void _ZN8QVariantC2ERK7QLocale() {} ;
void _ZN8QVariantC2ERK7QPointF() {} ;
void _ZN8QVariantC2ERK7QRegExp() {} ;
void _ZN8QVariantC2ERK7QString() {} ;
void _ZN8QVariantC2ERK9QBitArray() {} ;
void _ZN8QVariantC2ERK9QDateTime() {} ;
void _ZN8QVariantC2ERKS_() {} ;
void _ZN8QVariantC2Eb() {} ;
void _ZN8QVariantC2Ed() {} ;
void _ZN8QVariantC2Ei() {} ;
void _ZN8QVariantC2EiPKv() {} ;
void _ZN8QVariantC2Ej() {} ;
void _ZN8QVariantC2Ex() {} ;
void _ZN8QVariantC2Ey() {} ;
void _ZN8QVariantD1Ev() {} ;
void _ZN8QVariantD2Ev() {} ;
void _ZN8QVariantaSERKS_() {} ;
void _ZN9QBitArray4fillEbii() {} ;
void _ZN9QBitArray6resizeEi() {} ;
void _ZN9QBitArrayC1Eib() {} ;
void _ZN9QBitArrayC2Eib() {} ;
void _ZN9QBitArrayaNERKS_() {} ;
void _ZN9QBitArrayeOERKS_() {} ;
void _ZN9QBitArrayoRERKS_() {} ;
void _ZN9QDateTime10fromStringERK7QStringN2Qt10DateFormatE() {} ;
void _ZN9QDateTime10fromStringERK7QStringS2_() {} ;
void _ZN9QDateTime10fromTime_tEj() {} ;
void _ZN9QDateTime11setTimeSpecEN2Qt8TimeSpecE() {} ;
void _ZN9QDateTime15currentDateTimeEv() {} ;
void _ZN9QDateTime7setDateERK5QDate() {} ;
void _ZN9QDateTime7setTimeERK5QTime() {} ;
void _ZN9QDateTime9setTime_tEj() {} ;
void _ZN9QDateTimeC1ERK5QDate() {} ;
void _ZN9QDateTimeC1ERK5QDateRK5QTimeN2Qt8TimeSpecE() {} ;
void _ZN9QDateTimeC1ERKS_() {} ;
void _ZN9QDateTimeC1Ev() {} ;
void _ZN9QDateTimeC2ERK5QDate() {} ;
void _ZN9QDateTimeC2ERK5QDateRK5QTimeN2Qt8TimeSpecE() {} ;
void _ZN9QDateTimeC2ERKS_() {} ;
void _ZN9QDateTimeC2Ev() {} ;
void _ZN9QDateTimeD1Ev() {} ;
void _ZN9QDateTimeD2Ev() {} ;
void _ZN9QDateTimeaSERKS_() {} ;
void _ZN9QFileInfo10setCachingEb() {} ;
void _ZN9QFileInfo12makeAbsoluteEv() {} ;
void _ZN9QFileInfo6detachEv() {} ;
void _ZN9QFileInfo7refreshEv() {} ;
void _ZN9QFileInfo7setFileERK4QDirRK7QString() {} ;
void _ZN9QFileInfo7setFileERK5QFile() {} ;
void _ZN9QFileInfo7setFileERK7QString() {} ;
void _ZN9QFileInfoC1ERK4QDirRK7QString() {} ;
void _ZN9QFileInfoC1ERK5QFile() {} ;
void _ZN9QFileInfoC1ERK7QString() {} ;
void _ZN9QFileInfoC1ERKS_() {} ;
void _ZN9QFileInfoC1Ev() {} ;
void _ZN9QFileInfoC2ERK4QDirRK7QString() {} ;
void _ZN9QFileInfoC2ERK5QFile() {} ;
void _ZN9QFileInfoC2ERK7QString() {} ;
void _ZN9QFileInfoC2ERKS_() {} ;
void _ZN9QFileInfoC2Ev() {} ;
void _ZN9QFileInfoD1Ev() {} ;
void _ZN9QFileInfoD2Ev() {} ;
void _ZN9QFileInfoaSERKS_() {} ;
void _ZN9QFileInfoeqERKS_() {} ;
void _ZN9QHashData12allocateNodeEv() {} ;
void _ZN9QHashData12previousNodeEPNS_4NodeE() {} ;
void _ZN9QHashData13detach_helperEPFvPNS_4NodeEPvEi() {} ;
void _ZN9QHashData14destroyAndFreeEv() {} ;
void _ZN9QHashData6rehashEi() {} ;
void _ZN9QHashData8freeNodeEPv() {} ;
void _ZN9QHashData8nextNodeEPNS_4NodeE() {} ;
void _ZN9QIODevice11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN9QIODevice11qt_metacastEPKc() {} ;
void _ZN9QIODevice11resetStatusEv() {} ;
void _ZN9QIODevice11setOpenModeE6QFlagsINS_12OpenModeFlagEE() {} ;
void _ZN9QIODevice12aboutToCloseEv() {} ;
void _ZN9QIODevice12bytesWrittenEx() {} ;
void _ZN9QIODevice12readLineDataEPcx() {} ;
void _ZN9QIODevice14setErrorStringERK7QString() {} ;
void _ZN9QIODevice16waitForReadyReadEi() {} ;
void _ZN9QIODevice18setTextModeEnabledEb() {} ;
void _ZN9QIODevice19waitForBytesWrittenEi() {} ;
void _ZN9QIODevice4openE6QFlagsINS_12OpenModeFlagEE() {} ;
void _ZN9QIODevice4peekEPcx() {} ;
void _ZN9QIODevice4peekEx() {} ;
void _ZN9QIODevice4readEPcx() {} ;
void _ZN9QIODevice4readEx() {} ;
void _ZN9QIODevice4seekEx() {} ;
void _ZN9QIODevice5closeEv() {} ;
void _ZN9QIODevice5resetEv() {} ;
void _ZN9QIODevice5writeEPKcx() {} ;
void _ZN9QIODevice7readAllEv() {} ;
void _ZN9QIODevice8readLineEPcx() {} ;
void _ZN9QIODevice8readLineEx() {} ;
void _ZN9QIODevice9readyReadEv() {} ;
void _ZN9QIODevice9ungetCharEc() {} ;
void _ZN9QIODeviceC1EP7QObject() {} ;
void _ZN9QIODeviceC1Ev() {} ;
void _ZN9QIODeviceC2EP7QObject() {} ;
void _ZN9QIODeviceC2Ev() {} ;
void _ZN9QIODeviceD0Ev() {} ;
void _ZN9QIODeviceD1Ev() {} ;
void _ZN9QIODeviceD2Ev() {} ;
void _ZN9QInternal12callFunctionENS_16InternalFunctionEPPv() {} ;
void _ZN9QInternal16registerCallbackENS_8CallbackEPFbPPvE() {} ;
void _ZN9QInternal17activateCallbacksENS_8CallbackEPPv() {} ;
void _ZN9QInternal18unregisterCallbackENS_8CallbackEPFbPPvE() {} ;
void _ZN9QListData4moveEii() {} ;
void _ZN9QListData5eraseEPPv() {} ;
void _ZN9QListData6appendERKS_() {} ;
void _ZN9QListData6appendEv() {} ;
void _ZN9QListData6detachEv() {} ;
void _ZN9QListData6insertEi() {} ;
void _ZN9QListData6removeEi() {} ;
void _ZN9QListData6removeEii() {} ;
void _ZN9QListData7prependEv() {} ;
void _ZN9QListData7reallocEi() {} ;
void _ZN9QMetaType12isRegisteredEi() {} ;
void _ZN9QMetaType12registerTypeEPKcPFvPvEPFS2_PKvE() {} ;
void _ZN9QMetaType23registerStreamOperatorsEPKcPFvR11QDataStreamPKvEPFvS3_PvE() {} ;
void _ZN9QMetaType4loadER11QDataStreamiPv() {} ;
void _ZN9QMetaType4saveER11QDataStreamiPKv() {} ;
void _ZN9QMetaType4typeEPKc() {} ;
void _ZN9QMetaType7destroyEiPv() {} ;
void _ZN9QMetaType8typeNameEi() {} ;
void _ZN9QMetaType9constructEiPKv() {} ;
void _ZN9QMimeData11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN9QMimeData11qt_metacastEPKc() {} ;
void _ZN9QMimeData12setColorDataERK8QVariant() {} ;
void _ZN9QMimeData12setImageDataERK8QVariant() {} ;
void _ZN9QMimeData5clearEv() {} ;
void _ZN9QMimeData7setDataERK7QStringRK10QByteArray() {} ;
void _ZN9QMimeData7setHtmlERK7QString() {} ;
void _ZN9QMimeData7setTextERK7QString() {} ;
void _ZN9QMimeData7setUrlsERK5QListI4QUrlE() {} ;
void _ZN9QMimeDataC1Ev() {} ;
void _ZN9QMimeDataC2Ev() {} ;
void _ZN9QMimeDataD0Ev() {} ;
void _ZN9QMimeDataD1Ev() {} ;
void _ZN9QMimeDataD2Ev() {} ;
void _ZN9QResource11searchPathsEv() {} ;
void _ZN9QResource11setFileNameERK7QString() {} ;
void _ZN9QResource13addSearchPathERK7QString() {} ;
void _ZN9QResource16registerResourceERK7QStringS2_() {} ;
void _ZN9QResource18unregisterResourceERK7QStringS2_() {} ;
void _ZN9QResource9setLocaleERK7QLocale() {} ;
void _ZN9QResourceC1ERK7QStringRK7QLocale() {} ;
void _ZN9QResourceC2ERK7QStringRK7QLocale() {} ;
void _ZN9QResourceD1Ev() {} ;
void _ZN9QResourceD2Ev() {} ;
void _ZN9QSettings10beginGroupERK7QString() {} ;
void _ZN9QSettings11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN9QSettings11qt_metacastEPKc() {} ;
void _ZN9QSettings13setArrayIndexEi() {} ;
void _ZN9QSettings14beginReadArrayERK7QString() {} ;
void _ZN9QSettings14registerFormatERK7QStringPFbR9QIODeviceR4QMapIS0_8QVariantEEPFbS4_RKS7_EN2Qt15CaseSensitivityE() {} ;
void _ZN9QSettings14setUserIniPathERK7QString() {} ;
void _ZN9QSettings15beginWriteArrayERK7QStringi() {} ;
void _ZN9QSettings16setSystemIniPathERK7QString() {} ;
void _ZN9QSettings19setFallbacksEnabledEb() {} ;
void _ZN9QSettings4syncEv() {} ;
void _ZN9QSettings5clearEv() {} ;
void _ZN9QSettings5eventEP6QEvent() {} ;
void _ZN9QSettings6removeERK7QString() {} ;
void _ZN9QSettings7setPathENS_6FormatENS_5ScopeERK7QString() {} ;
void _ZN9QSettings8endArrayEv() {} ;
void _ZN9QSettings8endGroupEv() {} ;
void _ZN9QSettings8setValueERK7QStringRK8QVariant() {} ;
void _ZN9QSettingsC1ENS_5ScopeERK7QStringS3_P7QObject() {} ;
void _ZN9QSettingsC1ENS_6FormatENS_5ScopeERK7QStringS4_P7QObject() {} ;
void _ZN9QSettingsC1EP7QObject() {} ;
void _ZN9QSettingsC1ERK7QStringNS_6FormatEP7QObject() {} ;
void _ZN9QSettingsC1ERK7QStringS2_P7QObject() {} ;
void _ZN9QSettingsC2ENS_5ScopeERK7QStringS3_P7QObject() {} ;
void _ZN9QSettingsC2ENS_6FormatENS_5ScopeERK7QStringS4_P7QObject() {} ;
void _ZN9QSettingsC2EP7QObject() {} ;
void _ZN9QSettingsC2ERK7QStringNS_6FormatEP7QObject() {} ;
void _ZN9QSettingsC2ERK7QStringS2_P7QObject() {} ;
void _ZN9QSettingsD0Ev() {} ;
void _ZN9QSettingsD1Ev() {} ;
void _ZN9QSettingsD2Ev() {} ;
void _ZN9QTimeLine10timerEventEP11QTimerEvent() {} ;
void _ZN9QTimeLine11qt_metacallEN11QMetaObject4CallEiPPv() {} ;
void _ZN9QTimeLine11qt_metacastEPKc() {} ;
void _ZN9QTimeLine11setDurationEi() {} ;
void _ZN9QTimeLine11setEndFrameEi() {} ;
void _ZN9QTimeLine12frameChangedEi() {} ;
void _ZN9QTimeLine12setDirectionENS_9DirectionE() {} ;
void _ZN9QTimeLine12setLoopCountEi() {} ;
void _ZN9QTimeLine12stateChangedENS_5StateE() {} ;
void _ZN9QTimeLine12valueChangedEd() {} ;
void _ZN9QTimeLine13setCurveShapeENS_10CurveShapeE() {} ;
void _ZN9QTimeLine13setFrameRangeEii() {} ;
void _ZN9QTimeLine13setStartFrameEi() {} ;
void _ZN9QTimeLine14setCurrentTimeEi() {} ;
void _ZN9QTimeLine15toggleDirectionEv() {} ;
void _ZN9QTimeLine17setUpdateIntervalEi() {} ;
void _ZN9QTimeLine4stopEv() {} ;
void _ZN9QTimeLine5startEv() {} ;
void _ZN9QTimeLine8finishedEv() {} ;
void _ZN9QTimeLine9setPausedEb() {} ;
void _ZN9QTimeLineC1EiP7QObject() {} ;
void _ZN9QTimeLineC2EiP7QObject() {} ;
void _ZN9QTimeLineD0Ev() {} ;
void _ZN9QTimeLineD1Ev() {} ;
void _ZN9QTimeLineD2Ev() {} ;
void _ZN9QtPrivate16QStringList_joinEPK11QStringListRK7QString() {} ;
void _ZN9QtPrivate16QStringList_sortEP11QStringList() {} ;
void _ZN9QtPrivate18QStringList_filterEPK11QStringListRK7QRegExp() {} ;
void _ZN9QtPrivate18QStringList_filterEPK11QStringListRK7QStringN2Qt15CaseSensitivityE() {} ;
void _ZN9QtPrivate19QStringList_indexOfEPK11QStringListRK7QRegExpi() {} ;
void _ZN9QtPrivate20QStringList_containsEPK11QStringListRK7QStringN2Qt15CaseSensitivityE() {} ;
void _ZN9QtPrivate23QStringList_lastIndexOfEPK11QStringListRK7QRegExpi() {} ;
void _ZN9QtPrivate28QStringList_replaceInStringsEP11QStringListRK7QRegExpRK7QString() {} ;
void _ZN9QtPrivate28QStringList_replaceInStringsEP11QStringListRK7QStringS4_N2Qt15CaseSensitivityE() {} ;
void _ZNK10QByteArray10simplifiedEv() {} ;
void _ZNK10QByteArray10startsWithEPKc() {} ;
void _ZNK10QByteArray10startsWithERKS_() {} ;
void _ZNK10QByteArray10startsWithEc() {} ;
void _ZNK10QByteArray10toLongLongEPbi() {} ;
void _ZNK10QByteArray11lastIndexOfERKS_i() {} ;
void _ZNK10QByteArray11lastIndexOfEci() {} ;
void _ZNK10QByteArray11toULongLongEPbi() {} ;
void _ZNK10QByteArray13leftJustifiedEicb() {} ;
void _ZNK10QByteArray14rightJustifiedEicb() {} ;
void _ZNK10QByteArray3midEii() {} ;
void _ZNK10QByteArray4leftEi() {} ;
void _ZNK10QByteArray5countEPKc() {} ;
void _ZNK10QByteArray5countERKS_() {} ;
void _ZNK10QByteArray5countEc() {} ;
void _ZNK10QByteArray5rightEi() {} ;
void _ZNK10QByteArray5splitEc() {} ;
void _ZNK10QByteArray5toIntEPbi() {} ;
void _ZNK10QByteArray6isNullEv() {} ;
void _ZNK10QByteArray6toLongEPbi() {} ;
void _ZNK10QByteArray6toUIntEPbi() {} ;
void _ZNK10QByteArray7indexOfERKS_i() {} ;
void _ZNK10QByteArray7indexOfEci() {} ;
void _ZNK10QByteArray7toFloatEPb() {} ;
void _ZNK10QByteArray7toLowerEv() {} ;
void _ZNK10QByteArray7toShortEPbi() {} ;
void _ZNK10QByteArray7toULongEPbi() {} ;
void _ZNK10QByteArray7toUpperEv() {} ;
void _ZNK10QByteArray7trimmedEv() {} ;
void _ZNK10QByteArray8endsWithEPKc() {} ;
void _ZNK10QByteArray8endsWithERKS_() {} ;
void _ZNK10QByteArray8endsWithEc() {} ;
void _ZNK10QByteArray8toBase64Ev() {} ;
void _ZNK10QByteArray8toDoubleEPb() {} ;
void _ZNK10QByteArray8toUShortEPbi() {} ;
void _ZNK10QEventLoop10metaObjectEv() {} ;
void _ZNK10QEventLoop9isRunningEv() {} ;
void _ZNK10QSemaphore9availableEv() {} ;
void _ZNK10QTextCodec11fromUnicodeERK7QString() {} ;
void _ZNK10QTextCodec11fromUnicodeERK7QStringRi() {} ;
void _ZNK10QTextCodec11makeDecoderEv() {} ;
void _ZNK10QTextCodec11makeEncoderEv() {} ;
void _ZNK10QTextCodec7aliasesEv() {} ;
void _ZNK10QTextCodec9canEncodeE5QChar() {} ;
void _ZNK10QTextCodec9canEncodeERK7QString() {} ;
void _ZNK10QTextCodec9toUnicodeEPKc() {} ;
void _ZNK10QTextCodec9toUnicodeERK10QByteArray() {} ;
void _ZNK10QTextCodec9toUnicodeERK10QByteArrayi() {} ;
void _ZNK11QDataStream5atEndEv() {} ;
void _ZNK11QDataStream6statusEv() {} ;
void _ZNK11QMetaMethod10attributesEv() {} ;
void _ZNK11QMetaMethod10methodTypeEv() {} ;
void _ZNK11QMetaMethod14parameterNamesEv() {} ;
void _ZNK11QMetaMethod14parameterTypesEv() {} ;
void _ZNK11QMetaMethod3tagEv() {} ;
void _ZNK11QMetaMethod6accessEv() {} ;
void _ZNK11QMetaMethod8typeNameEv() {} ;
void _ZNK11QMetaMethod9signatureEv() {} ;
void _ZNK11QMetaObject10enumeratorEi() {} ;
void _ZNK11QMetaObject11indexOfSlotEPKc() {} ;
void _ZNK11QMetaObject11methodCountEv() {} ;
void _ZNK11QMetaObject12methodOffsetEv() {} ;
void _ZNK11QMetaObject12userPropertyEv() {} ;
void _ZNK11QMetaObject13indexOfMethodEPKc() {} ;
void _ZNK11QMetaObject13indexOfSignalEPKc() {} ;
void _ZNK11QMetaObject13propertyCountEv() {} ;
void _ZNK11QMetaObject14classInfoCountEv() {} ;
void _ZNK11QMetaObject14propertyOffsetEv() {} ;
void _ZNK11QMetaObject15classInfoOffsetEv() {} ;
void _ZNK11QMetaObject15enumeratorCountEv() {} ;
void _ZNK11QMetaObject15indexOfPropertyEPKc() {} ;
void _ZNK11QMetaObject16enumeratorOffsetEv() {} ;
void _ZNK11QMetaObject16indexOfClassInfoEPKc() {} ;
void _ZNK11QMetaObject17indexOfEnumeratorEPKc() {} ;
void _ZNK11QMetaObject2trEPKcS1_() {} ;
void _ZNK11QMetaObject2trEPKcS1_i() {} ;
void _ZNK11QMetaObject4castEP7QObject() {} ;
void _ZNK11QMetaObject6methodEi() {} ;
void _ZNK11QMetaObject6trUtf8EPKcS1_() {} ;
void _ZNK11QMetaObject6trUtf8EPKcS1_i() {} ;
void _ZNK11QMetaObject8propertyEi() {} ;
void _ZNK11QMetaObject9classInfoEi() {} ;
void _ZNK11QTextStream10fieldWidthEv() {} ;
void _ZNK11QTextStream11integerBaseEv() {} ;
void _ZNK11QTextStream11numberFlagsEv() {} ;
void _ZNK11QTextStream14fieldAlignmentEv() {} ;
void _ZNK11QTextStream17autoDetectUnicodeEv() {} ;
void _ZNK11QTextStream18realNumberNotationEv() {} ;
void _ZNK11QTextStream19realNumberPrecisionEv() {} ;
void _ZNK11QTextStream21generateByteOrderMarkEv() {} ;
void _ZNK11QTextStream3posEv() {} ;
void _ZNK11QTextStream5atEndEv() {} ;
void _ZNK11QTextStream5codecEv() {} ;
void _ZNK11QTextStream6deviceEv() {} ;
void _ZNK11QTextStream6statusEv() {} ;
void _ZNK11QTextStream6stringEv() {} ;
void _ZNK11QTextStream7padCharEv() {} ;
void _ZNK11QTranslator10metaObjectEv() {} ;
void _ZNK11QTranslator7isEmptyEv() {} ;
void _ZNK11QTranslator9translateEPKcS1_S1_() {} ;
void _ZNK11QTranslator9translateEPKcS1_S1_i() {} ;
void _ZNK13QFSFileEngine12isSequentialEv() {} ;
void _ZNK13QFSFileEngine13caseSensitiveEv() {} ;
void _ZNK13QFSFileEngine14isRelativePathEv() {} ;
void _ZNK13QFSFileEngine17supportsExtensionEN19QAbstractFileEngine9ExtensionE() {} ;
void _ZNK13QFSFileEngine3posEv() {} ;
void _ZNK13QFSFileEngine4sizeEv() {} ;
void _ZNK13QFSFileEngine5mkdirERK7QStringb() {} ;
void _ZNK13QFSFileEngine5ownerEN19QAbstractFileEngine9FileOwnerE() {} ;
void _ZNK13QFSFileEngine5rmdirERK7QStringb() {} ;
void _ZNK13QFSFileEngine6handleEv() {} ;
void _ZNK13QFSFileEngine7ownerIdEN19QAbstractFileEngine9FileOwnerE() {} ;
void _ZNK13QFSFileEngine8fileNameEN19QAbstractFileEngine8FileNameE() {} ;
void _ZNK13QFSFileEngine8fileTimeEN19QAbstractFileEngine8FileTimeE() {} ;
void _ZNK13QFSFileEngine9entryListE6QFlagsIN4QDir6FilterEERK11QStringList() {} ;
void _ZNK13QFSFileEngine9fileFlagsE6QFlagsIN19QAbstractFileEngine8FileFlagEE() {} ;
void _ZNK13QMetaProperty10enumeratorEv() {} ;
void _ZNK13QMetaProperty10isEditableEPK7QObject() {} ;
void _ZNK13QMetaProperty10isEnumTypeEv() {} ;
void _ZNK13QMetaProperty10isFlagTypeEv() {} ;
void _ZNK13QMetaProperty10isReadableEv() {} ;
void _ZNK13QMetaProperty10isWritableEv() {} ;
void _ZNK13QMetaProperty12hasStdCppSetEv() {} ;
void _ZNK13QMetaProperty12isDesignableEPK7QObject() {} ;
void _ZNK13QMetaProperty12isResettableEv() {} ;
void _ZNK13QMetaProperty12isScriptableEPK7QObject() {} ;
void _ZNK13QMetaProperty4nameEv() {} ;
void _ZNK13QMetaProperty4readEPK7QObject() {} ;
void _ZNK13QMetaProperty4typeEv() {} ;
void _ZNK13QMetaProperty5resetEP7QObject() {} ;
void _ZNK13QMetaProperty5writeEP7QObjectRK8QVariant() {} ;
void _ZNK13QMetaProperty6isUserEPK7QObject() {} ;
void _ZNK13QMetaProperty8isStoredEPK7QObject() {} ;
void _ZNK13QMetaProperty8typeNameEv() {} ;
void _ZNK13QMetaProperty8userTypeEv() {} ;
void _ZNK13QPluginLoader10metaObjectEv() {} ;
void _ZNK13QPluginLoader11errorStringEv() {} ;
void _ZNK13QPluginLoader8fileNameEv() {} ;
void _ZNK13QPluginLoader8isLoadedEv() {} ;
void _ZNK13QSignalMapper10metaObjectEv() {} ;
void _ZNK13QSignalMapper7mappingEP7QObject() {} ;
void _ZNK13QSignalMapper7mappingEP7QWidget() {} ;
void _ZNK13QSignalMapper7mappingERK7QString() {} ;
void _ZNK13QSignalMapper7mappingEi() {} ;
void _ZNK13QSystemLocale14fallbackLocaleEv() {} ;
void _ZNK13QSystemLocale5queryENS_9QueryTypeE8QVariant() {} ;
void _ZNK14QMetaClassInfo4nameEv() {} ;
void _ZNK14QMetaClassInfo5valueEv() {} ;
void _ZNK14QStringMatcher7indexInERK7QStringi() {} ;
void _ZNK14QTemporaryFile10autoRemoveEv() {} ;
void _ZNK14QTemporaryFile10fileEngineEv() {} ;
void _ZNK14QTemporaryFile10metaObjectEv() {} ;
void _ZNK14QTemporaryFile12fileTemplateEv() {} ;
void _ZNK14QTemporaryFile8fileNameEv() {} ;
void _ZNK15QSocketNotifier10metaObjectEv() {} ;
void _ZNK16QCoreApplication10metaObjectEv() {} ;
void _ZNK16QTextCodecPlugin10metaObjectEv() {} ;
void _ZNK16QTextCodecPlugin4keysEv() {} ;
void _ZNK17QByteArrayMatcher7indexInERK10QByteArrayi() {} ;
void _ZNK18QAbstractItemModel10encodeDataERK5QListI11QModelIndexER11QDataStream() {} ;
void _ZNK18QAbstractItemModel10headerDataEiN2Qt11OrientationEi() {} ;
void _ZNK18QAbstractItemModel10metaObjectEv() {} ;
void _ZNK18QAbstractItemModel11hasChildrenERK11QModelIndex() {} ;
void _ZNK18QAbstractItemModel12canFetchMoreERK11QModelIndex() {} ;
void _ZNK18QAbstractItemModel19persistentIndexListEv() {} ;
void _ZNK18QAbstractItemModel20supportedDragActionsEv() {} ;
void _ZNK18QAbstractItemModel20supportedDropActionsEv() {} ;
void _ZNK18QAbstractItemModel4spanERK11QModelIndex() {} ;
void _ZNK18QAbstractItemModel5buddyERK11QModelIndex() {} ;
void _ZNK18QAbstractItemModel5flagsERK11QModelIndex() {} ;
void _ZNK18QAbstractItemModel5matchERK11QModelIndexiRK8QVarianti6QFlagsIN2Qt9MatchFlagEE() {} ;
void _ZNK18QAbstractItemModel8hasIndexEiiRK11QModelIndex() {} ;
void _ZNK18QAbstractItemModel8itemDataERK11QModelIndex() {} ;
void _ZNK18QAbstractItemModel8mimeDataERK5QListI11QModelIndexE() {} ;
void _ZNK18QAbstractItemModel9mimeTypesEv() {} ;
void _ZNK18QAbstractListModel10metaObjectEv() {} ;
void _ZNK18QAbstractListModel11columnCountERK11QModelIndex() {} ;
void _ZNK18QAbstractListModel11hasChildrenERK11QModelIndex() {} ;
void _ZNK18QAbstractListModel5indexEiiRK11QModelIndex() {} ;
void _ZNK18QAbstractListModel6parentERK11QModelIndex() {} ;
void _ZNK18QFileSystemWatcher10metaObjectEv() {} ;
void _ZNK18QFileSystemWatcher11directoriesEv() {} ;
void _ZNK18QFileSystemWatcher5filesEv() {} ;
void _ZNK18QThreadStorageData3getEv() {} ;
void _ZNK19QAbstractFileEngine11errorStringEv() {} ;
void _ZNK19QAbstractFileEngine12isSequentialEv() {} ;
void _ZNK19QAbstractFileEngine13caseSensitiveEv() {} ;
void _ZNK19QAbstractFileEngine14isRelativePathEv() {} ;
void _ZNK19QAbstractFileEngine17supportsExtensionENS_9ExtensionE() {} ;
void _ZNK19QAbstractFileEngine3posEv() {} ;
void _ZNK19QAbstractFileEngine4sizeEv() {} ;
void _ZNK19QAbstractFileEngine5errorEv() {} ;
void _ZNK19QAbstractFileEngine5mkdirERK7QStringb() {} ;
void _ZNK19QAbstractFileEngine5ownerENS_9FileOwnerE() {} ;
void _ZNK19QAbstractFileEngine5rmdirERK7QStringb() {} ;
void _ZNK19QAbstractFileEngine6handleEv() {} ;
void _ZNK19QAbstractFileEngine7ownerIdENS_9FileOwnerE() {} ;
void _ZNK19QAbstractFileEngine8fileNameENS_8FileNameE() {} ;
void _ZNK19QAbstractFileEngine8fileTimeENS_8FileTimeE() {} ;
void _ZNK19QAbstractFileEngine9entryListE6QFlagsIN4QDir6FilterEERK11QStringList() {} ;
void _ZNK19QAbstractFileEngine9fileFlagsE6QFlagsINS_8FileFlagEE() {} ;
void _ZNK19QAbstractTableModel10metaObjectEv() {} ;
void _ZNK19QAbstractTableModel11hasChildrenERK11QModelIndex() {} ;
void _ZNK19QAbstractTableModel5indexEiiRK11QModelIndex() {} ;
void _ZNK19QAbstractTableModel6parentERK11QModelIndex() {} ;
void _ZNK21QObjectCleanupHandler10metaObjectEv() {} ;
void _ZNK21QObjectCleanupHandler7isEmptyEv() {} ;
void _ZNK21QPersistentModelIndex10internalIdEv() {} ;
void _ZNK21QPersistentModelIndex15internalPointerEv() {} ;
void _ZNK21QPersistentModelIndex3rowEv() {} ;
void _ZNK21QPersistentModelIndex4dataEi() {} ;
void _ZNK21QPersistentModelIndex5childEii() {} ;
void _ZNK21QPersistentModelIndex5flagsEv() {} ;
void _ZNK21QPersistentModelIndex5modelEv() {} ;
void _ZNK21QPersistentModelIndex6columnEv() {} ;
void _ZNK21QPersistentModelIndex6parentEv() {} ;
void _ZNK21QPersistentModelIndex7isValidEv() {} ;
void _ZNK21QPersistentModelIndex7siblingEii() {} ;
void _ZNK21QPersistentModelIndexcvRK11QModelIndexEv() {} ;
void _ZNK21QPersistentModelIndexeqERK11QModelIndex() {} ;
void _ZNK21QPersistentModelIndexeqERKS_() {} ;
void _ZNK21QPersistentModelIndexltERKS_() {} ;
void _ZNK21QPersistentModelIndexneERK11QModelIndex() {} ;
void _ZNK24QAbstractEventDispatcher10metaObjectEv() {} ;
void _ZNK4QDir10isReadableEv() {} ;
void _ZNK4QDir10isRelativeEv() {} ;
void _ZNK4QDir10nameFilterEv() {} ;
void _ZNK4QDir11nameFiltersEv() {} ;
void _ZNK4QDir12absolutePathEv() {} ;
void _ZNK4QDir12matchAllDirsEv() {} ;
void _ZNK4QDir13canonicalPathEv() {} ;
void _ZNK4QDir13entryInfoListE6QFlagsINS_6FilterEES0_INS_8SortFlagEE() {} ;
void _ZNK4QDir13entryInfoListERK11QStringList6QFlagsINS_6FilterEES3_INS_8SortFlagEE() {} ;
void _ZNK4QDir16absoluteFilePathERK7QString() {} ;
void _ZNK4QDir16relativeFilePathERK7QString() {} ;
void _ZNK4QDir4pathEv() {} ;
void _ZNK4QDir5countEv() {} ;
void _ZNK4QDir5mkdirERK7QString() {} ;
void _ZNK4QDir5rmdirERK7QString() {} ;
void _ZNK4QDir6existsERK7QString() {} ;
void _ZNK4QDir6existsEv() {} ;
void _ZNK4QDir6filterEv() {} ;
void _ZNK4QDir6isRootEv() {} ;
void _ZNK4QDir6mkpathERK7QString() {} ;
void _ZNK4QDir6rmpathERK7QString() {} ;
void _ZNK4QDir7dirNameEv() {} ;
void _ZNK4QDir7refreshEv() {} ;
void _ZNK4QDir7sortingEv() {} ;
void _ZNK4QDir8filePathERK7QString() {} ;
void _ZNK4QDir9entryListE6QFlagsINS_6FilterEES0_INS_8SortFlagEE() {} ;
void _ZNK4QDir9entryListERK11QStringList6QFlagsINS_6FilterEES3_INS_8SortFlagEE() {} ;
void _ZNK4QDireqERKS_() {} ;
void _ZNK4QDirixEi() {} ;
void _ZNK4QUrl10isDetachedEv() {} ;
void _ZNK4QUrl10isParentOfERKS_() {} ;
void _ZNK4QUrl10isRelativeEv() {} ;
void _ZNK4QUrl10queryItemsEv() {} ;
void _ZNK4QUrl11errorStringEv() {} ;
void _ZNK4QUrl11hasFragmentEv() {} ;
void _ZNK4QUrl11toLocalFileEv() {} ;
void _ZNK4QUrl12encodedQueryEv() {} ;
void _ZNK4QUrl12hasQueryItemERK7QString() {} ;
void _ZNK4QUrl14queryItemValueERK7QString() {} ;
void _ZNK4QUrl18allQueryItemValuesERK7QString() {} ;
void _ZNK4QUrl18queryPairDelimiterEv() {} ;
void _ZNK4QUrl19queryValueDelimiterEv() {} ;
void _ZNK4QUrl4hostEv() {} ;
void _ZNK4QUrl4pathEv() {} ;
void _ZNK4QUrl4portEi() {} ;
void _ZNK4QUrl4portEv() {} ;
void _ZNK4QUrl6schemeEv() {} ;
void _ZNK4QUrl7dirPathEv() {} ;
void _ZNK4QUrl7isEmptyEv() {} ;
void _ZNK4QUrl7isValidEv() {} ;
void _ZNK4QUrl8fileNameEv() {} ;
void _ZNK4QUrl8fragmentEv() {} ;
void _ZNK4QUrl8hasQueryEv() {} ;
void _ZNK4QUrl8passwordEv() {} ;
void _ZNK4QUrl8resolvedERKS_() {} ;
void _ZNK4QUrl8toStringE6QFlagsINS_16FormattingOptionEE() {} ;
void _ZNK4QUrl8userInfoEv() {} ;
void _ZNK4QUrl8userNameEv() {} ;
void _ZNK4QUrl9authorityEv() {} ;
void _ZNK4QUrl9toEncodedE6QFlagsINS_16FormattingOptionEE() {} ;
void _ZNK4QUrleqERKS_() {} ;
void _ZNK4QUrlltERKS_() {} ;
void _ZNK4QUrlneERKS_() {} ;
void _ZNK5QChar10digitValueEv() {} ;
void _ZNK5QChar11hasMirroredEv() {} ;
void _ZNK5QChar12mirroredCharEv() {} ;
void _ZNK5QChar13decompositionEv() {} ;
void _ZNK5QChar14combiningClassEv() {} ;
void _ZNK5QChar14unicodeVersionEv() {} ;
void _ZNK5QChar16decompositionTagEv() {} ;
void _ZNK5QChar16isLetterOrNumberEv() {} ;
void _ZNK5QChar6isMarkEv() {} ;
void _ZNK5QChar7isDigitEv() {} ;
void _ZNK5QChar7isPrintEv() {} ;
void _ZNK5QChar7isPunctEv() {} ;
void _ZNK5QChar7isSpaceEv() {} ;
void _ZNK5QChar7joiningEv() {} ;
void _ZNK5QChar7toAsciiEv() {} ;
void _ZNK5QChar7toLowerEv() {} ;
void _ZNK5QChar7toUpperEv() {} ;
void _ZNK5QChar8categoryEv() {} ;
void _ZNK5QChar8isLetterEv() {} ;
void _ZNK5QChar8isNumberEv() {} ;
void _ZNK5QChar8isSymbolEv() {} ;
void _ZNK5QChar9directionEv() {} ;
void _ZNK5QDate10daysInYearEv() {} ;
void _ZNK5QDate10weekNumberEPi() {} ;
void _ZNK5QDate11daysInMonthEv() {} ;
void _ZNK5QDate3dayEv() {} ;
void _ZNK5QDate4yearEv() {} ;
void _ZNK5QDate5monthEv() {} ;
void _ZNK5QDate6daysToERKS_() {} ;
void _ZNK5QDate7addDaysEi() {} ;
void _ZNK5QDate7isValidEv() {} ;
void _ZNK5QDate8addYearsEi() {} ;
void _ZNK5QDate8toStringEN2Qt10DateFormatE() {} ;
void _ZNK5QDate8toStringERK7QString() {} ;
void _ZNK5QDate9addMonthsEi() {} ;
void _ZNK5QDate9dayOfWeekEv() {} ;
void _ZNK5QDate9dayOfYearEv() {} ;
void _ZNK5QFile10fileEngineEv() {} ;
void _ZNK5QFile10metaObjectEv() {} ;
void _ZNK5QFile11permissionsEv() {} ;
void _ZNK5QFile12isSequentialEv() {} ;
void _ZNK5QFile3posEv() {} ;
void _ZNK5QFile4sizeEv() {} ;
void _ZNK5QFile5atEndEv() {} ;
void _ZNK5QFile5errorEv() {} ;
void _ZNK5QFile6existsEv() {} ;
void _ZNK5QFile6handleEv() {} ;
void _ZNK5QFile8fileNameEv() {} ;
void _ZNK5QFile8readLinkEv() {} ;
void _ZNK5QRect10intersectsERKS_() {} ;
void _ZNK5QRect10normalizedEv() {} ;
void _ZNK5QRect8containsERK6QPointb() {} ;
void _ZNK5QRect8containsERKS_b() {} ;
void _ZNK5QRectanERKS_() {} ;
void _ZNK5QRectorERKS_() {} ;
void _ZNK5QTime4hourEv() {} ;
void _ZNK5QTime4msecEv() {} ;
void _ZNK5QTime6minuteEv() {} ;
void _ZNK5QTime6secondEv() {} ;
void _ZNK5QTime6secsToERKS_() {} ;
void _ZNK5QTime7addSecsEi() {} ;
void _ZNK5QTime7elapsedEv() {} ;
void _ZNK5QTime7isValidEv() {} ;
void _ZNK5QTime7msecsToERKS_() {} ;
void _ZNK5QTime8addMSecsEi() {} ;
void _ZNK5QTime8toStringEN2Qt10DateFormatE() {} ;
void _ZNK5QTime8toStringERK7QString() {} ;
void _ZNK5QUuid6isNullEv() {} ;
void _ZNK5QUuid7variantEv() {} ;
void _ZNK5QUuid7versionEv() {} ;
void _ZNK5QUuid8toStringEv() {} ;
void _ZNK5QUuidgtERKS_() {} ;
void _ZNK5QUuidltERKS_() {} ;
void _ZNK6QLineF10unitVectorEv() {} ;
void _ZNK6QLineF5angleERKS_() {} ;
void _ZNK6QLineF6isNullEv() {} ;
void _ZNK6QLineF6lengthEv() {} ;
void _ZNK6QLineF9intersectERKS_P7QPointF() {} ;
void _ZNK6QPoint15manhattanLengthEv() {} ;
void _ZNK6QRectF10intersectsERKS_() {} ;
void _ZNK6QRectF10normalizedEv() {} ;
void _ZNK6QRectF8containsERK7QPointF() {} ;
void _ZNK6QRectF8containsERKS_() {} ;
void _ZNK6QRectFanERKS_() {} ;
void _ZNK6QRectForERKS_() {} ;
void _ZNK6QTimer10metaObjectEv() {} ;
void _ZNK7QBuffer10metaObjectEv() {} ;
void _ZNK7QBuffer11canReadLineEv() {} ;
void _ZNK7QBuffer3posEv() {} ;
void _ZNK7QBuffer4dataEv() {} ;
void _ZNK7QBuffer4sizeEv() {} ;
void _ZNK7QBuffer5atEndEv() {} ;
void _ZNK7QBuffer6bufferEv() {} ;
void _ZNK7QLocale10dateFormatENS_10FormatTypeE() {} ;
void _ZNK7QLocale10timeFormatENS_10FormatTypeE() {} ;
void _ZNK7QLocale10toLongLongERK7QStringPbi() {} ;
void _ZNK7QLocale11exponentialEv() {} ;
void _ZNK7QLocale11toULongLongERK7QStringPbi() {} ;
void _ZNK7QLocale12decimalPointEv() {} ;
void _ZNK7QLocale12negativeSignEv() {} ;
void _ZNK7QLocale13numberOptionsEv() {} ;
void _ZNK7QLocale14groupSeparatorEv() {} ;
void _ZNK7QLocale4nameEv() {} ;
void _ZNK7QLocale5toIntERK7QStringPbi() {} ;
void _ZNK7QLocale6toUIntERK7QStringPbi() {} ;
void _ZNK7QLocale7countryEv() {} ;
void _ZNK7QLocale7dayNameEiNS_10FormatTypeE() {} ;
void _ZNK7QLocale7percentEv() {} ;
void _ZNK7QLocale7toFloatERK7QStringPb() {} ;
void _ZNK7QLocale7toShortERK7QStringPbi() {} ;
void _ZNK7QLocale8languageEv() {} ;
void _ZNK7QLocale8toDoubleERK7QStringPb() {} ;
void _ZNK7QLocale8toStringERK5QDateNS_10FormatTypeE() {} ;
void _ZNK7QLocale8toStringERK5QDateRK7QString() {} ;
void _ZNK7QLocale8toStringERK5QTimeNS_10FormatTypeE() {} ;
void _ZNK7QLocale8toStringERK5QTimeRK7QString() {} ;
void _ZNK7QLocale8toStringEdci() {} ;
void _ZNK7QLocale8toStringEx() {} ;
void _ZNK7QLocale8toStringEy() {} ;
void _ZNK7QLocale8toUShortERK7QStringPbi() {} ;
void _ZNK7QLocale9monthNameEiNS_10FormatTypeE() {} ;
void _ZNK7QLocale9zeroDigitEv() {} ;
void _ZNK7QObject10metaObjectEv() {} ;
void _ZNK7QObject10objectNameEv() {} ;
void _ZNK7QObject20dynamicPropertyNamesEv() {} ;
void _ZNK7QObject5childEPKcS1_b() {} ;
void _ZNK7QObject6senderEv() {} ;
void _ZNK7QObject6threadEv() {} ;
void _ZNK7QObject8propertyEPKc() {} ;
void _ZNK7QObject8userDataEj() {} ;
void _ZNK7QObject9queryListEPKcS1_bb() {} ;
void _ZNK7QObject9receiversEPKc() {} ;
void _ZNK7QRegExp10exactMatchERK7QString() {} ;
void _ZNK7QRegExp11lastIndexInERK7QStringiNS_9CaretModeE() {} ;
void _ZNK7QRegExp11numCapturesEv() {} ;
void _ZNK7QRegExp13matchedLengthEv() {} ;
void _ZNK7QRegExp13patternSyntaxEv() {} ;
void _ZNK7QRegExp15caseSensitivityEv() {} ;
void _ZNK7QRegExp7indexInERK7QStringiNS_9CaretModeE() {} ;
void _ZNK7QRegExp7isEmptyEv() {} ;
void _ZNK7QRegExp7isValidEv() {} ;
void _ZNK7QRegExp7patternEv() {} ;
void _ZNK7QRegExp9isMinimalEv() {} ;
void _ZNK7QRegExpeqERKS_() {} ;
void _ZNK7QString10normalizedENS_17NormalizationFormE() {} ;
void _ZNK7QString10normalizedENS_17NormalizationFormEN5QChar14UnicodeVersionE() {} ;
void _ZNK7QString10simplifiedEv() {} ;
void _ZNK7QString10startsWithERK13QLatin1StringN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString10startsWithERK5QCharN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString10startsWithERKS_N2Qt15CaseSensitivityE() {} ;
void _ZNK7QString10toLongLongEPbi() {} ;
void _ZNK7QString11lastIndexOfE5QChariN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString11lastIndexOfERK7QRegExpi() {} ;
void _ZNK7QString11lastIndexOfERKS_iN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString11toLocal8BitEv() {} ;
void _ZNK7QString11toULongLongEPbi() {} ;
void _ZNK7QString12ascii_helperEv() {} ;
void _ZNK7QString12toWCharArrayEPw() {} ;
void _ZNK7QString13latin1_helperEv() {} ;
void _ZNK7QString13leftJustifiedEi5QCharb() {} ;
void _ZNK7QString14rightJustifiedEi5QCharb() {} ;
void _ZNK7QString18localeAwareCompareERKS_() {} ;
void _ZNK7QString3argE5QChariRKS0_() {} ;
void _ZNK7QString3argERKS_iRK5QChar() {} ;
void _ZNK7QString3argEciRK5QChar() {} ;
void _ZNK7QString3argEdiciRK5QChar() {} ;
void _ZNK7QString3argExiiRK5QChar() {} ;
void _ZNK7QString3argEyiiRK5QChar() {} ;
void _ZNK7QString3midEii() {} ;
void _ZNK7QString4leftEi() {} ;
void _ZNK7QString5countE5QCharN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString5countERK7QRegExp() {} ;
void _ZNK7QString5countERKS_N2Qt15CaseSensitivityE() {} ;
void _ZNK7QString5rightEi() {} ;
void _ZNK7QString5splitERK5QCharNS_13SplitBehaviorEN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString5splitERK7QRegExpNS_13SplitBehaviorE() {} ;
void _ZNK7QString5splitERKS_NS_13SplitBehaviorEN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString5toIntEPbi() {} ;
void _ZNK7QString5utf16Ev() {} ;
void _ZNK7QString6toLongEPbi() {} ;
void _ZNK7QString6toUIntEPbi() {} ;
void _ZNK7QString6toUcs4Ev() {} ;
void _ZNK7QString6toUtf8Ev() {} ;
void _ZNK7QString7compareERK13QLatin1StringN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString7compareERKS_() {} ;
void _ZNK7QString7compareERKS_N2Qt15CaseSensitivityE() {} ;
void _ZNK7QString7indexOfE5QChariN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString7indexOfERK7QRegExpi() {} ;
void _ZNK7QString7indexOfERKS_iN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString7sectionERK7QRegExpii6QFlagsINS_11SectionFlagEE() {} ;
void _ZNK7QString7sectionERKS_ii6QFlagsINS_11SectionFlagEE() {} ;
void _ZNK7QString7toAsciiEv() {} ;
void _ZNK7QString7toFloatEPb() {} ;
void _ZNK7QString7toLowerEv() {} ;
void _ZNK7QString7toShortEPbi() {} ;
void _ZNK7QString7toULongEPbi() {} ;
void _ZNK7QString7toUpperEv() {} ;
void _ZNK7QString7trimmedEv() {} ;
void _ZNK7QString8endsWithERK13QLatin1StringN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString8endsWithERK5QCharN2Qt15CaseSensitivityE() {} ;
void _ZNK7QString8endsWithERKS_N2Qt15CaseSensitivityE() {} ;
void _ZNK7QString8multiArgEiPPKS_() {} ;
void _ZNK7QString8toDoubleEPb() {} ;
void _ZNK7QString8toLatin1Ev() {} ;
void _ZNK7QString8toUShortEPbi() {} ;
void _ZNK7QStringeqERK13QLatin1String() {} ;
void _ZNK7QStringeqERKS_() {} ;
void _ZNK7QStringgtERK13QLatin1String() {} ;
void _ZNK7QStringltERK13QLatin1String() {} ;
void _ZNK7QStringltERKS_() {} ;
void _ZNK7QThread10isFinishedEv() {} ;
void _ZNK7QThread10metaObjectEv() {} ;
void _ZNK7QThread8priorityEv() {} ;
void _ZNK7QThread9isRunningEv() {} ;
void _ZNK7QThread9stackSizeEv() {} ;
void _ZNK8QLibrary10metaObjectEv() {} ;
void _ZNK8QLibrary11errorStringEv() {} ;
void _ZNK8QLibrary8fileNameEv() {} ;
void _ZNK8QLibrary8isLoadedEv() {} ;
void _ZNK8QLibrary9loadHintsEv() {} ;
void _ZNK8QProcess10exitStatusEv() {} ;
void _ZNK8QProcess10metaObjectEv() {} ;
void _ZNK8QProcess11canReadLineEv() {} ;
void _ZNK8QProcess11environmentEv() {} ;
void _ZNK8QProcess11readChannelEv() {} ;
void _ZNK8QProcess12bytesToWriteEv() {} ;
void _ZNK8QProcess12isSequentialEv() {} ;
void _ZNK8QProcess14bytesAvailableEv() {} ;
void _ZNK8QProcess15readChannelModeEv() {} ;
void _ZNK8QProcess16workingDirectoryEv() {} ;
void _ZNK8QProcess18processChannelModeEv() {} ;
void _ZNK8QProcess3pidEv() {} ;
void _ZNK8QProcess5atEndEv() {} ;
void _ZNK8QProcess5errorEv() {} ;
void _ZNK8QProcess5stateEv() {} ;
void _ZNK8QProcess8exitCodeEv() {} ;
void _ZNK8QVariant10canConvertENS_4TypeE() {} ;
void _ZNK8QVariant10toBitArrayEv() {} ;
void _ZNK8QVariant10toDateTimeEv() {} ;
void _ZNK8QVariant10toLongLongEPb() {} ;
void _ZNK8QVariant11toByteArrayEv() {} ;
void _ZNK8QVariant11toULongLongEPb() {} ;
void _ZNK8QVariant12toStringListEv() {} ;
void _ZNK8QVariant3cmpERKS_() {} ;
void _ZNK8QVariant4saveER11QDataStream() {} ;
void _ZNK8QVariant4typeEv() {} ;
void _ZNK8QVariant5toIntEPb() {} ;
void _ZNK8QVariant5toMapEv() {} ;
void _ZNK8QVariant5toUrlEv() {} ;
void _ZNK8QVariant6isNullEv() {} ;
void _ZNK8QVariant6toBoolEv() {} ;
void _ZNK8QVariant6toCharEv() {} ;
void _ZNK8QVariant6toDateEv() {} ;
void _ZNK8QVariant6toLineEv() {} ;
void _ZNK8QVariant6toListEv() {} ;
void _ZNK8QVariant6toRectEv() {} ;
void _ZNK8QVariant6toSizeEv() {} ;
void _ZNK8QVariant6toTimeEv() {} ;
void _ZNK8QVariant6toUIntEPb() {} ;
void _ZNK8QVariant7toLineFEv() {} ;
void _ZNK8QVariant7toPointEv() {} ;
void _ZNK8QVariant7toRectFEv() {} ;
void _ZNK8QVariant7toSizeFEv() {} ;
void _ZNK8QVariant8toDoubleEPb() {} ;
void _ZNK8QVariant8toLocaleEv() {} ;
void _ZNK8QVariant8toPointFEv() {} ;
void _ZNK8QVariant8toRegExpEv() {} ;
void _ZNK8QVariant8toStringEv() {} ;
void _ZNK8QVariant8typeNameEv() {} ;
void _ZNK8QVariant8userTypeEv() {} ;
void _ZNK8QVariant9constDataEv() {} ;
void _ZNK9QBitArray5countEb() {} ;
void _ZNK9QBitArraycoEv() {} ;
void _ZNK9QDateTime10toTimeSpecEN2Qt8TimeSpecE() {} ;
void _ZNK9QDateTime4dateEv() {} ;
void _ZNK9QDateTime4timeEv() {} ;
void _ZNK9QDateTime6daysToERKS_() {} ;
void _ZNK9QDateTime6isNullEv() {} ;
void _ZNK9QDateTime6secsToERKS_() {} ;
void _ZNK9QDateTime7addDaysEi() {} ;
void _ZNK9QDateTime7addSecsEi() {} ;
void _ZNK9QDateTime7isValidEv() {} ;
void _ZNK9QDateTime8addMSecsEx() {} ;
void _ZNK9QDateTime8addYearsEi() {} ;
void _ZNK9QDateTime8timeSpecEv() {} ;
void _ZNK9QDateTime8toStringEN2Qt10DateFormatE() {} ;
void _ZNK9QDateTime8toStringERK7QString() {} ;
void _ZNK9QDateTime8toTime_tEv() {} ;
void _ZNK9QDateTime9addMonthsEi() {} ;
void _ZNK9QDateTimeeqERKS_() {} ;
void _ZNK9QDateTimeltERKS_() {} ;
void _ZNK9QFileInfo10isReadableEv() {} ;
void _ZNK9QFileInfo10isRelativeEv() {} ;
void _ZNK9QFileInfo10isWritableEv() {} ;
void _ZNK9QFileInfo10permissionE6QFlagsIN5QFile10PermissionEE() {} ;
void _ZNK9QFileInfo11absoluteDirEv() {} ;
void _ZNK9QFileInfo11permissionsEv() {} ;
void _ZNK9QFileInfo12absolutePathEv() {} ;
void _ZNK9QFileInfo12isExecutableEv() {} ;
void _ZNK9QFileInfo12lastModifiedEv() {} ;
void _ZNK9QFileInfo13canonicalPathEv() {} ;
void _ZNK9QFileInfo14completeSuffixEv() {} ;
void _ZNK9QFileInfo16absoluteFilePathEv() {} ;
void _ZNK9QFileInfo16completeBaseNameEv() {} ;
void _ZNK9QFileInfo17canonicalFilePathEv() {} ;
void _ZNK9QFileInfo3dirEb() {} ;
void _ZNK9QFileInfo3dirEv() {} ;
void _ZNK9QFileInfo4pathEv() {} ;
void _ZNK9QFileInfo4sizeEv() {} ;
void _ZNK9QFileInfo5groupEv() {} ;
void _ZNK9QFileInfo5isDirEv() {} ;
void _ZNK9QFileInfo5ownerEv() {} ;
void _ZNK9QFileInfo6existsEv() {} ;
void _ZNK9QFileInfo6isFileEv() {} ;
void _ZNK9QFileInfo6isRootEv() {} ;
void _ZNK9QFileInfo6suffixEv() {} ;
void _ZNK9QFileInfo7cachingEv() {} ;
void _ZNK9QFileInfo7createdEv() {} ;
void _ZNK9QFileInfo7groupIdEv() {} ;
void _ZNK9QFileInfo7ownerIdEv() {} ;
void _ZNK9QFileInfo8baseNameEv() {} ;
void _ZNK9QFileInfo8fileNameEv() {} ;
void _ZNK9QFileInfo8filePathEv() {} ;
void _ZNK9QFileInfo8isHiddenEv() {} ;
void _ZNK9QFileInfo8lastReadEv() {} ;
void _ZNK9QFileInfo8readLinkEv() {} ;
void _ZNK9QFileInfo9isSymLinkEv() {} ;
void _ZNK9QFileInfoeqERKS_() {} ;
void _ZNK9QIODevice10isReadableEv() {} ;
void _ZNK9QIODevice10isWritableEv() {} ;
void _ZNK9QIODevice10metaObjectEv() {} ;
void _ZNK9QIODevice11canReadLineEv() {} ;
void _ZNK9QIODevice11errorStringEv() {} ;
void _ZNK9QIODevice12bytesToWriteEv() {} ;
void _ZNK9QIODevice12isSequentialEv() {} ;
void _ZNK9QIODevice14bytesAvailableEv() {} ;
void _ZNK9QIODevice17isTextModeEnabledEv() {} ;
void _ZNK9QIODevice3posEv() {} ;
void _ZNK9QIODevice4sizeEv() {} ;
void _ZNK9QIODevice5atEndEv() {} ;
void _ZNK9QIODevice6isOpenEv() {} ;
void _ZNK9QIODevice6statusEv() {} ;
void _ZNK9QIODevice8openModeEv() {} ;
void _ZNK9QMetaEnum10keyToValueEPKc() {} ;
void _ZNK9QMetaEnum10valueToKeyEi() {} ;
void _ZNK9QMetaEnum11keysToValueEPKc() {} ;
void _ZNK9QMetaEnum11valueToKeysEi() {} ;
void _ZNK9QMetaEnum3keyEi() {} ;
void _ZNK9QMetaEnum4nameEv() {} ;
void _ZNK9QMetaEnum5scopeEv() {} ;
void _ZNK9QMetaEnum5valueEi() {} ;
void _ZNK9QMetaEnum6isFlagEv() {} ;
void _ZNK9QMetaEnum8keyCountEv() {} ;
void _ZNK9QMimeData10metaObjectEv() {} ;
void _ZNK9QMimeData12retrieveDataERK7QStringN8QVariant4TypeE() {} ;
void _ZNK9QMimeData4dataERK7QString() {} ;
void _ZNK9QMimeData4htmlEv() {} ;
void _ZNK9QMimeData4textEv() {} ;
void _ZNK9QMimeData4urlsEv() {} ;
void _ZNK9QMimeData7formatsEv() {} ;
void _ZNK9QMimeData7hasHtmlEv() {} ;
void _ZNK9QMimeData7hasTextEv() {} ;
void _ZNK9QMimeData7hasUrlsEv() {} ;
void _ZNK9QMimeData8hasColorEv() {} ;
void _ZNK9QMimeData8hasImageEv() {} ;
void _ZNK9QMimeData9colorDataEv() {} ;
void _ZNK9QMimeData9hasFormatERK7QString() {} ;
void _ZNK9QMimeData9imageDataEv() {} ;
void _ZNK9QResource12isCompressedEv() {} ;
void _ZNK9QResource16absoluteFilePathEv() {} ;
void _ZNK9QResource4dataEv() {} ;
void _ZNK9QResource4sizeEv() {} ;
void _ZNK9QResource5isDirEv() {} ;
void _ZNK9QResource6localeEv() {} ;
void _ZNK9QResource7isValidEv() {} ;
void _ZNK9QResource8childrenEv() {} ;
void _ZNK9QResource8fileNameEv() {} ;
void _ZNK9QSettings10isWritableEv() {} ;
void _ZNK9QSettings10metaObjectEv() {} ;
void _ZNK9QSettings11childGroupsEv() {} ;
void _ZNK9QSettings16fallbacksEnabledEv() {} ;
void _ZNK9QSettings5groupEv() {} ;
void _ZNK9QSettings5valueERK7QStringRK8QVariant() {} ;
void _ZNK9QSettings6statusEv() {} ;
void _ZNK9QSettings7allKeysEv() {} ;
void _ZNK9QSettings8containsERK7QString() {} ;
void _ZNK9QSettings8fileNameEv() {} ;
void _ZNK9QSettings9childKeysEv() {} ;
void _ZNK9QTimeLine10curveShapeEv() {} ;
void _ZNK9QTimeLine10metaObjectEv() {} ;
void _ZNK9QTimeLine10startFrameEv() {} ;
void _ZNK9QTimeLine11currentTimeEv() {} ;
void _ZNK9QTimeLine12currentFrameEv() {} ;
void _ZNK9QTimeLine12currentValueEv() {} ;
void _ZNK9QTimeLine12frameForTimeEi() {} ;
void _ZNK9QTimeLine12valueForTimeEi() {} ;
void _ZNK9QTimeLine14updateIntervalEv() {} ;
void _ZNK9QTimeLine5stateEv() {} ;
void _ZNK9QTimeLine8durationEv() {} ;
void _ZNK9QTimeLine8endFrameEv() {} ;
void _ZNK9QTimeLine9directionEv() {} ;
void _ZNK9QTimeLine9loopCountEv() {} ;
void _ZThn16_N16QTextCodecPlugin6createERK7QString() {} ;
void _ZThn16_N16QTextCodecPluginD0Ev() {} ;
void _ZThn16_N16QTextCodecPluginD1Ev() {} ;
void _ZThn16_NK16QTextCodecPlugin4keysEv() {} ;
void _ZanRK9QBitArrayS1_() {} ;
void _ZeoRK9QBitArrayS1_() {} ;
void _Zls6QDebug6QFlagsIN9QIODevice12OpenModeFlagEE() {} ;
void _Zls6QDebugN8QVariant4TypeE() {} ;
void _Zls6QDebugPK7QObject() {} ;
void _Zls6QDebugRK11QModelIndex() {} ;
void _Zls6QDebugRK21QPersistentModelIndex() {} ;
void _Zls6QDebugRK4QUrl() {} ;
void _Zls6QDebugRK5QDate() {} ;
void _Zls6QDebugRK5QLine() {} ;
void _Zls6QDebugRK5QRect() {} ;
void _Zls6QDebugRK5QSize() {} ;
void _Zls6QDebugRK5QTime() {} ;
void _Zls6QDebugRK6QLineF() {} ;
void _Zls6QDebugRK6QPoint() {} ;
void _Zls6QDebugRK6QRectF() {} ;
void _Zls6QDebugRK6QSizeF() {} ;
void _Zls6QDebugRK7QPointF() {} ;
void _Zls6QDebugRK8QVariant() {} ;
void _Zls6QDebugRK9QDateTime() {} ;
void _ZlsR11QDataStreamN8QVariant4TypeE() {} ;
void _ZlsR11QDataStreamRK10QByteArray() {} ;
void _ZlsR11QDataStreamRK4QUrl() {} ;
void _ZlsR11QDataStreamRK5QChar() {} ;
void _ZlsR11QDataStreamRK5QDate() {} ;
void _ZlsR11QDataStreamRK5QLine() {} ;
void _ZlsR11QDataStreamRK5QRect() {} ;
void _ZlsR11QDataStreamRK5QSize() {} ;
void _ZlsR11QDataStreamRK5QTime() {} ;
void _ZlsR11QDataStreamRK5QUuid() {} ;
void _ZlsR11QDataStreamRK6QLineF() {} ;
void _ZlsR11QDataStreamRK6QPoint() {} ;
void _ZlsR11QDataStreamRK6QRectF() {} ;
void _ZlsR11QDataStreamRK6QSizeF() {} ;
void _ZlsR11QDataStreamRK7QLocale() {} ;
void _ZlsR11QDataStreamRK7QPointF() {} ;
void _ZlsR11QDataStreamRK7QRegExp() {} ;
void _ZlsR11QDataStreamRK7QString() {} ;
void _ZlsR11QDataStreamRK8QVariant() {} ;
void _ZlsR11QDataStreamRK9QBitArray() {} ;
void _ZlsR11QDataStreamRK9QDateTime() {} ;
void _ZorRK9QBitArrayS1_() {} ;
void _ZrsR11QDataStreamR10QByteArray() {} ;
void _ZrsR11QDataStreamR4QUrl() {} ;
void _ZrsR11QDataStreamR5QChar() {} ;
void _ZrsR11QDataStreamR5QDate() {} ;
void _ZrsR11QDataStreamR5QLine() {} ;
void _ZrsR11QDataStreamR5QRect() {} ;
void _ZrsR11QDataStreamR5QSize() {} ;
void _ZrsR11QDataStreamR5QTime() {} ;
void _ZrsR11QDataStreamR5QUuid() {} ;
void _ZrsR11QDataStreamR6QLineF() {} ;
void _ZrsR11QDataStreamR6QPoint() {} ;
void _ZrsR11QDataStreamR6QRectF() {} ;
void _ZrsR11QDataStreamR6QSizeF() {} ;
void _ZrsR11QDataStreamR7QLocale() {} ;
void _ZrsR11QDataStreamR7QPointF() {} ;
void _ZrsR11QDataStreamR7QRegExp() {} ;
void _ZrsR11QDataStreamR7QString() {} ;
void _ZrsR11QDataStreamR8QVariant() {} ;
void _ZrsR11QDataStreamR9QBitArray() {} ;
void _ZrsR11QDataStreamR9QDateTime() {} ;
void _ZrsR11QDataStreamRN8QVariant4TypeE() {} ;
__asm__(".globl _ZN10QByteArray11shared_nullE; .pushsection .data; .type _ZN10QByteArray11shared_nullE,@object; .size _ZN10QByteArray11shared_nullE, 32; _ZN10QByteArray11shared_nullE: .long 0; .popsection");
__asm__(".globl _ZN10QEventLoop16staticMetaObjectE; .pushsection .data; .type _ZN10QEventLoop16staticMetaObjectE,@object; .size _ZN10QEventLoop16staticMetaObjectE, 32; _ZN10QEventLoop16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN11QTranslator16staticMetaObjectE; .pushsection .data; .type _ZN11QTranslator16staticMetaObjectE,@object; .size _ZN11QTranslator16staticMetaObjectE, 32; _ZN11QTranslator16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN11QVectorData11shared_nullE; .pushsection .data; .type _ZN11QVectorData11shared_nullE,@object; .size _ZN11QVectorData11shared_nullE, 16; _ZN11QVectorData11shared_nullE: .long 0; .popsection");
__asm__(".globl _ZN13QPluginLoader16staticMetaObjectE; .pushsection .data; .type _ZN13QPluginLoader16staticMetaObjectE,@object; .size _ZN13QPluginLoader16staticMetaObjectE, 32; _ZN13QPluginLoader16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN13QSignalMapper16staticMetaObjectE; .pushsection .data; .type _ZN13QSignalMapper16staticMetaObjectE,@object; .size _ZN13QSignalMapper16staticMetaObjectE, 32; _ZN13QSignalMapper16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN14QTemporaryFile16staticMetaObjectE; .pushsection .data; .type _ZN14QTemporaryFile16staticMetaObjectE,@object; .size _ZN14QTemporaryFile16staticMetaObjectE, 32; _ZN14QTemporaryFile16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN15QLinkedListData11shared_nullE; .pushsection .data; .type _ZN15QLinkedListData11shared_nullE,@object; .size _ZN15QLinkedListData11shared_nullE, 32; _ZN15QLinkedListData11shared_nullE: .long 0; .popsection");
__asm__(".globl _ZN15QSocketNotifier16staticMetaObjectE; .pushsection .data; .type _ZN15QSocketNotifier16staticMetaObjectE,@object; .size _ZN15QSocketNotifier16staticMetaObjectE, 32; _ZN15QSocketNotifier16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN16QCoreApplication16staticMetaObjectE; .pushsection .data; .type _ZN16QCoreApplication16staticMetaObjectE,@object; .size _ZN16QCoreApplication16staticMetaObjectE, 32; _ZN16QCoreApplication16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN16QCoreApplication4selfE; .pushsection .data; .type _ZN16QCoreApplication4selfE,@object; .size _ZN16QCoreApplication4selfE, 8; _ZN16QCoreApplication4selfE: .long 0; .popsection");
__asm__(".globl _ZN16QTextCodecPlugin16staticMetaObjectE; .pushsection .data; .type _ZN16QTextCodecPlugin16staticMetaObjectE,@object; .size _ZN16QTextCodecPlugin16staticMetaObjectE, 32; _ZN16QTextCodecPlugin16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN18QAbstractItemModel16staticMetaObjectE; .pushsection .data; .type _ZN18QAbstractItemModel16staticMetaObjectE,@object; .size _ZN18QAbstractItemModel16staticMetaObjectE, 32; _ZN18QAbstractItemModel16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN18QAbstractListModel16staticMetaObjectE; .pushsection .data; .type _ZN18QAbstractListModel16staticMetaObjectE,@object; .size _ZN18QAbstractListModel16staticMetaObjectE, 32; _ZN18QAbstractListModel16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN18QFileSystemWatcher16staticMetaObjectE; .pushsection .data; .type _ZN18QFileSystemWatcher16staticMetaObjectE,@object; .size _ZN18QFileSystemWatcher16staticMetaObjectE, 32; _ZN18QFileSystemWatcher16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN19QAbstractTableModel16staticMetaObjectE; .pushsection .data; .type _ZN19QAbstractTableModel16staticMetaObjectE,@object; .size _ZN19QAbstractTableModel16staticMetaObjectE, 32; _ZN19QAbstractTableModel16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN21QObjectCleanupHandler16staticMetaObjectE; .pushsection .data; .type _ZN21QObjectCleanupHandler16staticMetaObjectE,@object; .size _ZN21QObjectCleanupHandler16staticMetaObjectE, 32; _ZN21QObjectCleanupHandler16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN24QAbstractEventDispatcher16staticMetaObjectE; .pushsection .data; .type _ZN24QAbstractEventDispatcher16staticMetaObjectE,@object; .size _ZN24QAbstractEventDispatcher16staticMetaObjectE, 32; _ZN24QAbstractEventDispatcher16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN5QFile16staticMetaObjectE; .pushsection .data; .type _ZN5QFile16staticMetaObjectE,@object; .size _ZN5QFile16staticMetaObjectE, 32; _ZN5QFile16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN6QTimer16staticMetaObjectE; .pushsection .data; .type _ZN6QTimer16staticMetaObjectE,@object; .size _ZN6QTimer16staticMetaObjectE, 32; _ZN6QTimer16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN7QBuffer16staticMetaObjectE; .pushsection .data; .type _ZN7QBuffer16staticMetaObjectE,@object; .size _ZN7QBuffer16staticMetaObjectE, 32; _ZN7QBuffer16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN7QObject16staticMetaObjectE; .pushsection .data; .type _ZN7QObject16staticMetaObjectE,@object; .size _ZN7QObject16staticMetaObjectE, 32; _ZN7QObject16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN7QObject18staticQtMetaObjectE; .pushsection .data; .type _ZN7QObject18staticQtMetaObjectE,@object; .size _ZN7QObject18staticQtMetaObjectE, 32; _ZN7QObject18staticQtMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN7QString11shared_nullE; .pushsection .data; .type _ZN7QString11shared_nullE,@object; .size _ZN7QString11shared_nullE, 32; _ZN7QString11shared_nullE: .long 0; .popsection");
__asm__(".globl _ZN7QString16codecForCStringsE; .pushsection .data; .type _ZN7QString16codecForCStringsE,@object; .size _ZN7QString16codecForCStringsE, 8; _ZN7QString16codecForCStringsE: .long 0; .popsection");
__asm__(".globl _ZN7QString4nullE; .pushsection .data; .type _ZN7QString4nullE,@object; .size _ZN7QString4nullE, 1; _ZN7QString4nullE: .long 0; .popsection");
__asm__(".globl _ZN7QThread16staticMetaObjectE; .pushsection .data; .type _ZN7QThread16staticMetaObjectE,@object; .size _ZN7QThread16staticMetaObjectE, 32; _ZN7QThread16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN8QLibrary16staticMetaObjectE; .pushsection .data; .type _ZN8QLibrary16staticMetaObjectE,@object; .size _ZN8QLibrary16staticMetaObjectE, 32; _ZN8QLibrary16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN8QMapData11shared_nullE; .pushsection .data; .type _ZN8QMapData11shared_nullE,@object; .size _ZN8QMapData11shared_nullE, 128; _ZN8QMapData11shared_nullE: .long 0; .popsection");
__asm__(".globl _ZN8QProcess16staticMetaObjectE; .pushsection .data; .type _ZN8QProcess16staticMetaObjectE,@object; .size _ZN8QProcess16staticMetaObjectE, 32; _ZN8QProcess16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN8QVariant7handlerE; .pushsection .data; .type _ZN8QVariant7handlerE,@object; .size _ZN8QVariant7handlerE, 8; _ZN8QVariant7handlerE: .long 0; .popsection");
__asm__(".globl _ZN9QHashData11shared_nullE; .pushsection .data; .type _ZN9QHashData11shared_nullE,@object; .size _ZN9QHashData11shared_nullE, 40; _ZN9QHashData11shared_nullE: .long 0; .popsection");
__asm__(".globl _ZN9QIODevice16staticMetaObjectE; .pushsection .data; .type _ZN9QIODevice16staticMetaObjectE,@object; .size _ZN9QIODevice16staticMetaObjectE, 32; _ZN9QIODevice16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN9QListData11shared_nullE; .pushsection .data; .type _ZN9QListData11shared_nullE,@object; .size _ZN9QListData11shared_nullE, 32; _ZN9QListData11shared_nullE: .long 0; .popsection");
__asm__(".globl _ZN9QMimeData16staticMetaObjectE; .pushsection .data; .type _ZN9QMimeData16staticMetaObjectE,@object; .size _ZN9QMimeData16staticMetaObjectE, 32; _ZN9QMimeData16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN9QSettings16staticMetaObjectE; .pushsection .data; .type _ZN9QSettings16staticMetaObjectE,@object; .size _ZN9QSettings16staticMetaObjectE, 32; _ZN9QSettings16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZN9QTimeLine16staticMetaObjectE; .pushsection .data; .type _ZN9QTimeLine16staticMetaObjectE,@object; .size _ZN9QTimeLine16staticMetaObjectE, 32; _ZN9QTimeLine16staticMetaObjectE: .long 0; .popsection");
__asm__(".globl _ZTI10QEventLoop; .pushsection .data; .type _ZTI10QEventLoop,@object; .size _ZTI10QEventLoop, 24; _ZTI10QEventLoop: .long 0; .popsection");
__asm__(".globl _ZTI10QTextCodec; .pushsection .data; .type _ZTI10QTextCodec,@object; .size _ZTI10QTextCodec, 16; _ZTI10QTextCodec: .long 0; .popsection");
__asm__(".globl _ZTI11QChildEvent; .pushsection .data; .type _ZTI11QChildEvent,@object; .size _ZTI11QChildEvent, 24; _ZTI11QChildEvent: .long 0; .popsection");
__asm__(".globl _ZTI11QDataStream; .pushsection .data; .type _ZTI11QDataStream,@object; .size _ZTI11QDataStream, 16; _ZTI11QDataStream: .long 0; .popsection");
__asm__(".globl _ZTI11QTextStream; .pushsection .data; .type _ZTI11QTextStream,@object; .size _ZTI11QTextStream, 16; _ZTI11QTextStream: .long 0; .popsection");
__asm__(".globl _ZTI11QTimerEvent; .pushsection .data; .type _ZTI11QTimerEvent,@object; .size _ZTI11QTimerEvent, 24; _ZTI11QTimerEvent: .long 0; .popsection");
__asm__(".globl _ZTI11QTranslator; .pushsection .data; .type _ZTI11QTranslator,@object; .size _ZTI11QTranslator, 24; _ZTI11QTranslator: .long 0; .popsection");
__asm__(".globl _ZTI12QCustomEvent; .pushsection .data; .type _ZTI12QCustomEvent,@object; .size _ZTI12QCustomEvent, 24; _ZTI12QCustomEvent: .long 0; .popsection");
__asm__(".globl _ZTI13QFSFileEngine; .pushsection .data; .type _ZTI13QFSFileEngine,@object; .size _ZTI13QFSFileEngine, 24; _ZTI13QFSFileEngine: .long 0; .popsection");
__asm__(".globl _ZTI13QFontLaoCodec; .pushsection .data; .type _ZTI13QFontLaoCodec,@object; .size _ZTI13QFontLaoCodec, 24; _ZTI13QFontLaoCodec: .long 0; .popsection");
__asm__(".globl _ZTI13QPluginLoader; .pushsection .data; .type _ZTI13QPluginLoader,@object; .size _ZTI13QPluginLoader, 24; _ZTI13QPluginLoader: .long 0; .popsection");
__asm__(".globl _ZTI13QSignalMapper; .pushsection .data; .type _ZTI13QSignalMapper,@object; .size _ZTI13QSignalMapper, 24; _ZTI13QSignalMapper: .long 0; .popsection");
__asm__(".globl _ZTI13QSystemLocale; .pushsection .data; .type _ZTI13QSystemLocale,@object; .size _ZTI13QSystemLocale, 16; _ZTI13QSystemLocale: .long 0; .popsection");
__asm__(".globl _ZTI14QFactoryLoader; .pushsection .data; .type _ZTI14QFactoryLoader,@object; .size _ZTI14QFactoryLoader, 24; _ZTI14QFactoryLoader: .long 0; .popsection");
__asm__(".globl _ZTI14QMetaCallEvent; .pushsection .data; .type _ZTI14QMetaCallEvent,@object; .size _ZTI14QMetaCallEvent, 24; _ZTI14QMetaCallEvent: .long 0; .popsection");
__asm__(".globl _ZTI14QObjectPrivate; .pushsection .data; .type _ZTI14QObjectPrivate,@object; .size _ZTI14QObjectPrivate, 24; _ZTI14QObjectPrivate: .long 0; .popsection");
__asm__(".globl _ZTI14QTemporaryFile; .pushsection .data; .type _ZTI14QTemporaryFile,@object; .size _ZTI14QTemporaryFile, 24; _ZTI14QTemporaryFile: .long 0; .popsection");
__asm__(".globl _ZTI15QDateTimeParser; .pushsection .data; .type _ZTI15QDateTimeParser,@object; .size _ZTI15QDateTimeParser, 16; _ZTI15QDateTimeParser: .long 0; .popsection");
__asm__(".globl _ZTI15QObjectUserData; .pushsection .data; .type _ZTI15QObjectUserData,@object; .size _ZTI15QObjectUserData, 16; _ZTI15QObjectUserData: .long 0; .popsection");
__asm__(".globl _ZTI15QSocketNotifier; .pushsection .data; .type _ZTI15QSocketNotifier,@object; .size _ZTI15QSocketNotifier, 24; _ZTI15QSocketNotifier: .long 0; .popsection");
__asm__(".globl _ZTI16QCoreApplication; .pushsection .data; .type _ZTI16QCoreApplication,@object; .size _ZTI16QCoreApplication, 24; _ZTI16QCoreApplication: .long 0; .popsection");
__asm__(".globl _ZTI16QIODevicePrivate; .pushsection .data; .type _ZTI16QIODevicePrivate,@object; .size _ZTI16QIODevicePrivate, 24; _ZTI16QIODevicePrivate: .long 0; .popsection");
__asm__(".globl _ZTI16QTextCodecPlugin; .pushsection .data; .type _ZTI16QTextCodecPlugin,@object; .size _ZTI16QTextCodecPlugin, 56; _ZTI16QTextCodecPlugin: .long 0; .popsection");
__asm__(".globl _ZTI17QFactoryInterface; .pushsection .data; .type _ZTI17QFactoryInterface,@object; .size _ZTI17QFactoryInterface, 16; _ZTI17QFactoryInterface: .long 0; .popsection");
__asm__(".globl _ZTI18QAbstractItemModel; .pushsection .data; .type _ZTI18QAbstractItemModel,@object; .size _ZTI18QAbstractItemModel, 24; _ZTI18QAbstractItemModel: .long 0; .popsection");
__asm__(".globl _ZTI18QAbstractListModel; .pushsection .data; .type _ZTI18QAbstractListModel,@object; .size _ZTI18QAbstractListModel, 24; _ZTI18QAbstractListModel: .long 0; .popsection");
__asm__(".globl _ZTI18QFileSystemWatcher; .pushsection .data; .type _ZTI18QFileSystemWatcher,@object; .size _ZTI18QFileSystemWatcher, 24; _ZTI18QFileSystemWatcher: .long 0; .popsection");
__asm__(".globl _ZTI19QAbstractFileEngine; .pushsection .data; .type _ZTI19QAbstractFileEngine,@object; .size _ZTI19QAbstractFileEngine, 16; _ZTI19QAbstractFileEngine: .long 0; .popsection");
__asm__(".globl _ZTI19QAbstractTableModel; .pushsection .data; .type _ZTI19QAbstractTableModel,@object; .size _ZTI19QAbstractTableModel, 24; _ZTI19QAbstractTableModel: .long 0; .popsection");
__asm__(".globl _ZTI20QEventDispatcherUNIX; .pushsection .data; .type _ZTI20QEventDispatcherUNIX,@object; .size _ZTI20QEventDispatcherUNIX, 24; _ZTI20QEventDispatcherUNIX: .long 0; .popsection");
__asm__(".globl _ZTI21QObjectCleanupHandler; .pushsection .data; .type _ZTI21QObjectCleanupHandler,@object; .size _ZTI21QObjectCleanupHandler, 24; _ZTI21QObjectCleanupHandler: .long 0; .popsection");
__asm__(".globl _ZTI23QCoreApplicationPrivate; .pushsection .data; .type _ZTI23QCoreApplicationPrivate,@object; .size _ZTI23QCoreApplicationPrivate, 24; _ZTI23QCoreApplicationPrivate: .long 0; .popsection");
__asm__(".globl _ZTI24QAbstractEventDispatcher; .pushsection .data; .type _ZTI24QAbstractEventDispatcher,@object; .size _ZTI24QAbstractEventDispatcher, 24; _ZTI24QAbstractEventDispatcher: .long 0; .popsection");
__asm__(".globl _ZTI26QAbstractFileEngineHandler; .pushsection .data; .type _ZTI26QAbstractFileEngineHandler,@object; .size _ZTI26QAbstractFileEngineHandler, 16; _ZTI26QAbstractFileEngineHandler: .long 0; .popsection");
__asm__(".globl _ZTI26QTextCodecFactoryInterface; .pushsection .data; .type _ZTI26QTextCodecFactoryInterface,@object; .size _ZTI26QTextCodecFactoryInterface, 24; _ZTI26QTextCodecFactoryInterface: .long 0; .popsection");
__asm__(".globl _ZTI27QDynamicPropertyChangeEvent; .pushsection .data; .type _ZTI27QDynamicPropertyChangeEvent,@object; .size _ZTI27QDynamicPropertyChangeEvent, 24; _ZTI27QDynamicPropertyChangeEvent: .long 0; .popsection");
__asm__(".globl _ZTI27QEventDispatcherUNIXPrivate; .pushsection .data; .type _ZTI27QEventDispatcherUNIXPrivate,@object; .size _ZTI27QEventDispatcherUNIXPrivate, 24; _ZTI27QEventDispatcherUNIXPrivate: .long 0; .popsection");
__asm__(".globl _ZTI5QFile; .pushsection .data; .type _ZTI5QFile,@object; .size _ZTI5QFile, 24; _ZTI5QFile: .long 0; .popsection");
__asm__(".globl _ZTI6QEvent; .pushsection .data; .type _ZTI6QEvent,@object; .size _ZTI6QEvent, 16; _ZTI6QEvent: .long 0; .popsection");
__asm__(".globl _ZTI6QTimer; .pushsection .data; .type _ZTI6QTimer,@object; .size _ZTI6QTimer, 24; _ZTI6QTimer: .long 0; .popsection");
__asm__(".globl _ZTI7QBuffer; .pushsection .data; .type _ZTI7QBuffer,@object; .size _ZTI7QBuffer, 24; _ZTI7QBuffer: .long 0; .popsection");
__asm__(".globl _ZTI7QObject; .pushsection .data; .type _ZTI7QObject,@object; .size _ZTI7QObject, 16; _ZTI7QObject: .long 0; .popsection");
__asm__(".globl _ZTI7QThread; .pushsection .data; .type _ZTI7QThread,@object; .size _ZTI7QThread, 24; _ZTI7QThread: .long 0; .popsection");
__asm__(".globl _ZTI8QLibrary; .pushsection .data; .type _ZTI8QLibrary,@object; .size _ZTI8QLibrary, 24; _ZTI8QLibrary: .long 0; .popsection");
__asm__(".globl _ZTI8QProcess; .pushsection .data; .type _ZTI8QProcess,@object; .size _ZTI8QProcess, 24; _ZTI8QProcess: .long 0; .popsection");
__asm__(".globl _ZTI9QIODevice; .pushsection .data; .type _ZTI9QIODevice,@object; .size _ZTI9QIODevice, 24; _ZTI9QIODevice: .long 0; .popsection");
__asm__(".globl _ZTI9QMimeData; .pushsection .data; .type _ZTI9QMimeData,@object; .size _ZTI9QMimeData, 24; _ZTI9QMimeData: .long 0; .popsection");
__asm__(".globl _ZTI9QSettings; .pushsection .data; .type _ZTI9QSettings,@object; .size _ZTI9QSettings, 24; _ZTI9QSettings: .long 0; .popsection");
__asm__(".globl _ZTI9QTimeLine; .pushsection .data; .type _ZTI9QTimeLine,@object; .size _ZTI9QTimeLine, 24; _ZTI9QTimeLine: .long 0; .popsection");
__asm__(".globl _ZTV10QEventLoop; .pushsection .data; .type _ZTV10QEventLoop,@object; .size _ZTV10QEventLoop, 112; _ZTV10QEventLoop: .long 0; .popsection");
__asm__(".globl _ZTV10QTextCodec; .pushsection .data; .type _ZTV10QTextCodec,@object; .size _ZTV10QTextCodec, 72; _ZTV10QTextCodec: .long 0; .popsection");
__asm__(".globl _ZTV11QChildEvent; .pushsection .data; .type _ZTV11QChildEvent,@object; .size _ZTV11QChildEvent, 32; _ZTV11QChildEvent: .long 0; .popsection");
__asm__(".globl _ZTV11QDataStream; .pushsection .data; .type _ZTV11QDataStream,@object; .size _ZTV11QDataStream, 32; _ZTV11QDataStream: .long 0; .popsection");
__asm__(".globl _ZTV11QTextStream; .pushsection .data; .type _ZTV11QTextStream,@object; .size _ZTV11QTextStream, 32; _ZTV11QTextStream: .long 0; .popsection");
__asm__(".globl _ZTV11QTimerEvent; .pushsection .data; .type _ZTV11QTimerEvent,@object; .size _ZTV11QTimerEvent, 32; _ZTV11QTimerEvent: .long 0; .popsection");
__asm__(".globl _ZTV11QTranslator; .pushsection .data; .type _ZTV11QTranslator,@object; .size _ZTV11QTranslator, 128; _ZTV11QTranslator: .long 0; .popsection");
__asm__(".globl _ZTV12QCustomEvent; .pushsection .data; .type _ZTV12QCustomEvent,@object; .size _ZTV12QCustomEvent, 32; _ZTV12QCustomEvent: .long 0; .popsection");
__asm__(".globl _ZTV13QFSFileEngine; .pushsection .data; .type _ZTV13QFSFileEngine,@object; .size _ZTV13QFSFileEngine, 288; _ZTV13QFSFileEngine: .long 0; .popsection");
__asm__(".globl _ZTV13QFontLaoCodec; .pushsection .data; .type _ZTV13QFontLaoCodec,@object; .size _ZTV13QFontLaoCodec, 72; _ZTV13QFontLaoCodec: .long 0; .popsection");
__asm__(".globl _ZTV13QPluginLoader; .pushsection .data; .type _ZTV13QPluginLoader,@object; .size _ZTV13QPluginLoader, 112; _ZTV13QPluginLoader: .long 0; .popsection");
__asm__(".globl _ZTV13QSignalMapper; .pushsection .data; .type _ZTV13QSignalMapper,@object; .size _ZTV13QSignalMapper, 112; _ZTV13QSignalMapper: .long 0; .popsection");
__asm__(".globl _ZTV13QSystemLocale; .pushsection .data; .type _ZTV13QSystemLocale,@object; .size _ZTV13QSystemLocale, 48; _ZTV13QSystemLocale: .long 0; .popsection");
__asm__(".globl _ZTV14QFactoryLoader; .pushsection .data; .type _ZTV14QFactoryLoader,@object; .size _ZTV14QFactoryLoader, 112; _ZTV14QFactoryLoader: .long 0; .popsection");
__asm__(".globl _ZTV14QMetaCallEvent; .pushsection .data; .type _ZTV14QMetaCallEvent,@object; .size _ZTV14QMetaCallEvent, 40; _ZTV14QMetaCallEvent: .long 0; .popsection");
__asm__(".globl _ZTV14QObjectPrivate; .pushsection .data; .type _ZTV14QObjectPrivate,@object; .size _ZTV14QObjectPrivate, 40; _ZTV14QObjectPrivate: .long 0; .popsection");
__asm__(".globl _ZTV14QTemporaryFile; .pushsection .data; .type _ZTV14QTemporaryFile,@object; .size _ZTV14QTemporaryFile, 248; _ZTV14QTemporaryFile: .long 0; .popsection");
__asm__(".globl _ZTV15QDateTimeParser; .pushsection .data; .type _ZTV15QDateTimeParser,@object; .size _ZTV15QDateTimeParser, 80; _ZTV15QDateTimeParser: .long 0; .popsection");
__asm__(".globl _ZTV15QObjectUserData; .pushsection .data; .type _ZTV15QObjectUserData,@object; .size _ZTV15QObjectUserData, 32; _ZTV15QObjectUserData: .long 0; .popsection");
__asm__(".globl _ZTV15QSocketNotifier; .pushsection .data; .type _ZTV15QSocketNotifier,@object; .size _ZTV15QSocketNotifier, 112; _ZTV15QSocketNotifier: .long 0; .popsection");
__asm__(".globl _ZTV16QCoreApplication; .pushsection .data; .type _ZTV16QCoreApplication,@object; .size _ZTV16QCoreApplication, 128; _ZTV16QCoreApplication: .long 0; .popsection");
__asm__(".globl _ZTV16QIODevicePrivate; .pushsection .data; .type _ZTV16QIODevicePrivate,@object; .size _ZTV16QIODevicePrivate, 48; _ZTV16QIODevicePrivate: .long 0; .popsection");
__asm__(".globl _ZTV16QTextCodecPlugin; .pushsection .data; .type _ZTV16QTextCodecPlugin,@object; .size _ZTV16QTextCodecPlugin, 216; _ZTV16QTextCodecPlugin: .long 0; .popsection");
__asm__(".globl _ZTV17QFactoryInterface; .pushsection .data; .type _ZTV17QFactoryInterface,@object; .size _ZTV17QFactoryInterface, 40; _ZTV17QFactoryInterface: .long 0; .popsection");
__asm__(".globl _ZTV18QAbstractItemModel; .pushsection .data; .type _ZTV18QAbstractItemModel,@object; .size _ZTV18QAbstractItemModel, 336; _ZTV18QAbstractItemModel: .long 0; .popsection");
__asm__(".globl _ZTV18QAbstractListModel; .pushsection .data; .type _ZTV18QAbstractListModel,@object; .size _ZTV18QAbstractListModel, 336; _ZTV18QAbstractListModel: .long 0; .popsection");
__asm__(".globl _ZTV18QFileSystemWatcher; .pushsection .data; .type _ZTV18QFileSystemWatcher,@object; .size _ZTV18QFileSystemWatcher, 112; _ZTV18QFileSystemWatcher: .long 0; .popsection");
__asm__(".globl _ZTV19QAbstractFileEngine; .pushsection .data; .type _ZTV19QAbstractFileEngine,@object; .size _ZTV19QAbstractFileEngine, 288; _ZTV19QAbstractFileEngine: .long 0; .popsection");
__asm__(".globl _ZTV19QAbstractTableModel; .pushsection .data; .type _ZTV19QAbstractTableModel,@object; .size _ZTV19QAbstractTableModel, 336; _ZTV19QAbstractTableModel: .long 0; .popsection");
__asm__(".globl _ZTV20QEventDispatcherUNIX; .pushsection .data; .type _ZTV20QEventDispatcherUNIX,@object; .size _ZTV20QEventDispatcherUNIX, 224; _ZTV20QEventDispatcherUNIX: .long 0; .popsection");
__asm__(".globl _ZTV21QObjectCleanupHandler; .pushsection .data; .type _ZTV21QObjectCleanupHandler,@object; .size _ZTV21QObjectCleanupHandler, 112; _ZTV21QObjectCleanupHandler: .long 0; .popsection");
__asm__(".globl _ZTV23QCoreApplicationPrivate; .pushsection .data; .type _ZTV23QCoreApplicationPrivate,@object; .size _ZTV23QCoreApplicationPrivate, 56; _ZTV23QCoreApplicationPrivate: .long 0; .popsection");
__asm__(".globl _ZTV24QAbstractEventDispatcher; .pushsection .data; .type _ZTV24QAbstractEventDispatcher,@object; .size _ZTV24QAbstractEventDispatcher, 216; _ZTV24QAbstractEventDispatcher: .long 0; .popsection");
__asm__(".globl _ZTV26QAbstractFileEngineHandler; .pushsection .data; .type _ZTV26QAbstractFileEngineHandler,@object; .size _ZTV26QAbstractFileEngineHandler, 40; _ZTV26QAbstractFileEngineHandler: .long 0; .popsection");
__asm__(".globl _ZTV26QTextCodecFactoryInterface; .pushsection .data; .type _ZTV26QTextCodecFactoryInterface,@object; .size _ZTV26QTextCodecFactoryInterface, 48; _ZTV26QTextCodecFactoryInterface: .long 0; .popsection");
__asm__(".globl _ZTV27QDynamicPropertyChangeEvent; .pushsection .data; .type _ZTV27QDynamicPropertyChangeEvent,@object; .size _ZTV27QDynamicPropertyChangeEvent, 32; _ZTV27QDynamicPropertyChangeEvent: .long 0; .popsection");
__asm__(".globl _ZTV27QEventDispatcherUNIXPrivate; .pushsection .data; .type _ZTV27QEventDispatcherUNIXPrivate,@object; .size _ZTV27QEventDispatcherUNIXPrivate, 40; _ZTV27QEventDispatcherUNIXPrivate: .long 0; .popsection");
__asm__(".globl _ZTV5QFile; .pushsection .data; .type _ZTV5QFile,@object; .size _ZTV5QFile, 248; _ZTV5QFile: .long 0; .popsection");
__asm__(".globl _ZTV6QEvent; .pushsection .data; .type _ZTV6QEvent,@object; .size _ZTV6QEvent, 32; _ZTV6QEvent: .long 0; .popsection");
__asm__(".globl _ZTV6QTimer; .pushsection .data; .type _ZTV6QTimer,@object; .size _ZTV6QTimer, 112; _ZTV6QTimer: .long 0; .popsection");
__asm__(".globl _ZTV7QBuffer; .pushsection .data; .type _ZTV7QBuffer,@object; .size _ZTV7QBuffer, 240; _ZTV7QBuffer: .long 0; .popsection");
__asm__(".globl _ZTV7QObject; .pushsection .data; .type _ZTV7QObject,@object; .size _ZTV7QObject, 112; _ZTV7QObject: .long 0; .popsection");
__asm__(".globl _ZTV7QThread; .pushsection .data; .type _ZTV7QThread,@object; .size _ZTV7QThread, 120; _ZTV7QThread: .long 0; .popsection");
__asm__(".globl _ZTV8QLibrary; .pushsection .data; .type _ZTV8QLibrary,@object; .size _ZTV8QLibrary, 112; _ZTV8QLibrary: .long 0; .popsection");
__asm__(".globl _ZTV8QProcess; .pushsection .data; .type _ZTV8QProcess,@object; .size _ZTV8QProcess, 248; _ZTV8QProcess: .long 0; .popsection");
__asm__(".globl _ZTV9QIODevice; .pushsection .data; .type _ZTV9QIODevice,@object; .size _ZTV9QIODevice, 240; _ZTV9QIODevice: .long 0; .popsection");
__asm__(".globl _ZTV9QMimeData; .pushsection .data; .type _ZTV9QMimeData,@object; .size _ZTV9QMimeData, 136; _ZTV9QMimeData: .long 0; .popsection");
__asm__(".globl _ZTV9QSettings; .pushsection .data; .type _ZTV9QSettings,@object; .size _ZTV9QSettings, 112; _ZTV9QSettings: .long 0; .popsection");
__asm__(".globl _ZTV9QTimeLine; .pushsection .data; .type _ZTV9QTimeLine,@object; .size _ZTV9QTimeLine, 120; _ZTV9QTimeLine: .long 0; .popsection");
|
the_stack_data/92669.c | /*
* Copyright (c) 2010, Mariano Alvira <mar@devl.org> and other contributors
* to the MC1322x project (http://mc1322x.devl.org) and Contiki.
*
* 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 Institute 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 INSTITUTE 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 INSTITUTE 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.
*
* This file is part of the Contiki OS.
*
*
*/
int (*uart1_input_handler)(unsigned char c) = 0;
void
uart1_set_input(int (*input)(unsigned char c))
{
uart1_input_handler = input;
}
|
the_stack_data/134812.c | /*
* Copyright (c) 2005 Jakub Jermar
* All rights reserved.
*
* 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 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 AUTHOR ``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 AUTHOR 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.
*/
/** @addtogroup generic
* @{
*/
/**
* @file
* @brief Generic IPI interface.
*/
#ifdef CONFIG_SMP
#include <smp/ipi.h>
#include <config.h>
/** Broadcast IPI message
*
* Broadcast IPI message to all CPUs.
*
* @param ipi Message to broadcast.
*
*/
void ipi_broadcast(int ipi)
{
/*
* Provisions must be made to avoid sending IPI:
* - before all CPU's were configured to accept the IPI
* - if there is only one CPU but the kernel was compiled with CONFIG_SMP
*/
if (config.cpu_count > 1)
ipi_broadcast_arch(ipi);
}
#endif /* CONFIG_SMP */
/** @}
*/
|
the_stack_data/55469.c | #include <stdio.h>
unsigned int Factorial(unsigned int n){
if (n == 0) {
return 1; // f(0) = 1
} else {
return n * Factorial(n - 1); // f(n) = nf(n-1)
}
}
unsigned int FactorialByIteration(unsigned int n){
unsigned int result = 1;
for (unsigned int i = n; i > 0; --i) {
result *= i;
}
return result;
}
unsigned int Fibonacci(unsigned int n) {
if(n == 1 || n == 0) {
return n;// f(0) = 0, f(1) = 1
} else {
return Fibonacci(n - 1) + Fibonacci(n - 2);// f(n) = f(n-1) + f(n - 2)
}
}
unsigned int FibonacciByIteration(unsigned int n) {
if(n == 1 || n == 0) {
return n;// f(0) = 0, f(1) = 1
}
unsigned int last = 0;
unsigned int current = 1;
for (int i = 0; i <= n - 2; ++i) {
unsigned int temp = current;
current += last;
last = temp;
}
return current;
}
/**
* 函数的递归
* @return
*/
int main(void) {
printf("3!: %d\n", Factorial(3));
printf("3!: %d\n", FactorialByIteration(3));
printf("Fibonacci(3): %d\n", Fibonacci(3));
printf("Fibonacci(3): %d\n", FibonacciByIteration(3));
return 0;
}
|
the_stack_data/176705017.c | #ifdef WIN32
#include <windows.h>
#include <shobjidl.h>
#include <combaseapi.h>
#include <stdio.h>
void *revery_getIconHandle_win32() {
ITaskbarList3 *tbl;
CoCreateInstance(&CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER,
&IID_ITaskbarList3, (void**)&tbl);
return (void *)tbl;
}
void revery_setIconProgress_win32(void *win, void *ih, float progress) {
HWND window = (HWND)win;
ITaskbarList3 *iconHandle = (ITaskbarList3 *)ih;
iconHandle->lpVtbl->SetProgressState(iconHandle, window, TBPF_NORMAL);
iconHandle->lpVtbl->SetProgressValue(iconHandle, window, progress * 100, 100);
}
void revery_setIconProgressIndeterminate_win32(void *win, void *ih) {
HWND window = (HWND)win;
ITaskbarList3 *iconHandle = (ITaskbarList3 *)ih;
iconHandle->lpVtbl->SetProgressState(iconHandle, window, TBPF_INDETERMINATE);
}
void revery_hideIconProgress_win32(void *win, void *ih) {
HWND window = (HWND)win;
ITaskbarList3 *iconHandle = (ITaskbarList3 *)ih;
iconHandle->lpVtbl->SetProgressState(iconHandle, window, TBPF_NOPROGRESS);
}
#endif
|
the_stack_data/70450150.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 */
typedef int /*<<< orphan*/ u_int32_t ;
struct sockaddr_in6 {int sin6_family; int /*<<< orphan*/ sin6_addr; void* sin6_port; } ;
struct TYPE_2__ {int /*<<< orphan*/ s_addr; } ;
struct sockaddr_in {int sin_family; TYPE_1__ sin_addr; void* sin_port; } ;
struct sockaddr {int ai_family; struct sockaddr* ai_addr; int /*<<< orphan*/ sa_len; void* ai_addrlen; int /*<<< orphan*/ ai_protocol; int /*<<< orphan*/ ai_flags; int /*<<< orphan*/ ai_socktype; } ;
struct netconfig {scalar_t__ nc_semantics; int /*<<< orphan*/ nc_netid; } ;
struct addrinfo {int ai_family; struct addrinfo* ai_addr; int /*<<< orphan*/ sa_len; void* ai_addrlen; int /*<<< orphan*/ ai_protocol; int /*<<< orphan*/ ai_flags; int /*<<< orphan*/ ai_socktype; } ;
struct __rpc_sockinfo {int si_af; int /*<<< orphan*/ si_proto; int /*<<< orphan*/ si_socktype; } ;
typedef void* socklen_t ;
/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
int /*<<< orphan*/ AI_NUMERICHOST ;
int /*<<< orphan*/ AI_PASSIVE ;
scalar_t__ EADDRINUSE ;
scalar_t__ EAFNOSUPPORT ;
int /*<<< orphan*/ INADDR_ANY ;
int /*<<< orphan*/ IPPROTO_IPV6 ;
int /*<<< orphan*/ IPV6_V6ONLY ;
int /*<<< orphan*/ LOG_DEBUG ;
int /*<<< orphan*/ LOG_ERR ;
scalar_t__ NC_TPI_CLTS ;
scalar_t__ NC_TPI_COTS ;
scalar_t__ NC_TPI_COTS_ORD ;
int /*<<< orphan*/ NI_MAXHOST ;
int NI_MAXSERV ;
int NI_NUMERICHOST ;
int NI_NUMERICSERV ;
int __rpc_nconf2fd (struct netconfig*) ;
int /*<<< orphan*/ __rpc_nconf2sockinfo (struct netconfig*,struct __rpc_sockinfo*) ;
int bindresvport_sa (int,struct sockaddr*) ;
int /*<<< orphan*/ close (int) ;
scalar_t__ errno ;
int /*<<< orphan*/ errx (int,char*) ;
int /*<<< orphan*/ exit (int) ;
int /*<<< orphan*/ free (struct sockaddr*) ;
int /*<<< orphan*/ freeaddrinfo (struct sockaddr*) ;
int /*<<< orphan*/ gai_strerror (int) ;
int getaddrinfo (int /*<<< orphan*/ *,int /*<<< orphan*/ *,struct sockaddr*,struct sockaddr**) ;
scalar_t__ getnameinfo (struct sockaddr*,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int,int) ;
int /*<<< orphan*/ ** hosts ;
int /*<<< orphan*/ htonl (int /*<<< orphan*/ ) ;
void* htons (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ in6addr_any ;
int inet_pton (int const,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
void* malloc (int) ;
int mallocd_svcport ;
int /*<<< orphan*/ memset (struct sockaddr*,int /*<<< orphan*/ ,int) ;
int nhosts ;
int /*<<< orphan*/ out_of_mem () ;
int* realloc (int*,int) ;
int /*<<< orphan*/ setsockopt (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int*,int) ;
int* sock_fd ;
int sock_fdcnt ;
scalar_t__ strcmp (char*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ * svcport_str ;
int /*<<< orphan*/ syslog (int /*<<< orphan*/ ,char*,...) ;
__attribute__((used)) static int
create_service(struct netconfig *nconf)
{
struct addrinfo hints, *res = NULL;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
struct __rpc_sockinfo si;
int aicode;
int fd;
int nhostsbak;
int one = 1;
int r;
u_int32_t host_addr[4]; /* IPv4 or IPv6 */
int mallocd_res;
if ((nconf->nc_semantics != NC_TPI_CLTS) &&
(nconf->nc_semantics != NC_TPI_COTS) &&
(nconf->nc_semantics != NC_TPI_COTS_ORD))
return (1); /* not my type */
/*
* XXX - using RPC library internal functions.
*/
if (!__rpc_nconf2sockinfo(nconf, &si)) {
syslog(LOG_ERR, "cannot get information for %s",
nconf->nc_netid);
return (1);
}
/* Get mountd's address on this transport */
memset(&hints, 0, sizeof hints);
hints.ai_family = si.si_af;
hints.ai_socktype = si.si_socktype;
hints.ai_protocol = si.si_proto;
/*
* Bind to specific IPs if asked to
*/
nhostsbak = nhosts;
while (nhostsbak > 0) {
--nhostsbak;
sock_fd = realloc(sock_fd, (sock_fdcnt + 1) * sizeof(int));
if (sock_fd == NULL)
out_of_mem();
sock_fd[sock_fdcnt++] = -1; /* Set invalid for now. */
mallocd_res = 0;
hints.ai_flags = AI_PASSIVE;
/*
* XXX - using RPC library internal functions.
*/
if ((fd = __rpc_nconf2fd(nconf)) < 0) {
int non_fatal = 0;
if (errno == EAFNOSUPPORT &&
nconf->nc_semantics != NC_TPI_CLTS)
non_fatal = 1;
syslog(non_fatal ? LOG_DEBUG : LOG_ERR,
"cannot create socket for %s", nconf->nc_netid);
if (non_fatal != 0)
continue;
exit(1);
}
switch (hints.ai_family) {
case AF_INET:
if (inet_pton(AF_INET, hosts[nhostsbak],
host_addr) == 1) {
hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET6 address.
*/
if (inet_pton(AF_INET6, hosts[nhostsbak],
host_addr) == 1) {
close(fd);
continue;
}
}
break;
case AF_INET6:
if (inet_pton(AF_INET6, hosts[nhostsbak],
host_addr) == 1) {
hints.ai_flags |= AI_NUMERICHOST;
} else {
/*
* Skip if we have an AF_INET address.
*/
if (inet_pton(AF_INET, hosts[nhostsbak],
host_addr) == 1) {
close(fd);
continue;
}
}
/*
* We're doing host-based access checks here, so don't
* allow v4-in-v6 to confuse things. The kernel will
* disable it by default on NFS sockets too.
*/
if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &one,
sizeof one) < 0) {
syslog(LOG_ERR,
"can't disable v4-in-v6 on IPv6 socket");
exit(1);
}
break;
default:
break;
}
/*
* If no hosts were specified, just bind to INADDR_ANY
*/
if (strcmp("*", hosts[nhostsbak]) == 0) {
if (svcport_str == NULL) {
res = malloc(sizeof(struct addrinfo));
if (res == NULL)
out_of_mem();
mallocd_res = 1;
res->ai_flags = hints.ai_flags;
res->ai_family = hints.ai_family;
res->ai_protocol = hints.ai_protocol;
switch (res->ai_family) {
case AF_INET:
sin = malloc(sizeof(struct sockaddr_in));
if (sin == NULL)
out_of_mem();
sin->sin_family = AF_INET;
sin->sin_port = htons(0);
sin->sin_addr.s_addr = htonl(INADDR_ANY);
res->ai_addr = (struct sockaddr*) sin;
res->ai_addrlen = (socklen_t)
sizeof(struct sockaddr_in);
break;
case AF_INET6:
sin6 = malloc(sizeof(struct sockaddr_in6));
if (sin6 == NULL)
out_of_mem();
sin6->sin6_family = AF_INET6;
sin6->sin6_port = htons(0);
sin6->sin6_addr = in6addr_any;
res->ai_addr = (struct sockaddr*) sin6;
res->ai_addrlen = (socklen_t)
sizeof(struct sockaddr_in6);
break;
default:
syslog(LOG_ERR, "bad addr fam %d",
res->ai_family);
exit(1);
}
} else {
if ((aicode = getaddrinfo(NULL, svcport_str,
&hints, &res)) != 0) {
syslog(LOG_ERR,
"cannot get local address for %s: %s",
nconf->nc_netid,
gai_strerror(aicode));
close(fd);
continue;
}
}
} else {
if ((aicode = getaddrinfo(hosts[nhostsbak], svcport_str,
&hints, &res)) != 0) {
syslog(LOG_ERR,
"cannot get local address for %s: %s",
nconf->nc_netid, gai_strerror(aicode));
close(fd);
continue;
}
}
/* Store the fd. */
sock_fd[sock_fdcnt - 1] = fd;
/* Now, attempt the bind. */
r = bindresvport_sa(fd, res->ai_addr);
if (r != 0) {
if (errno == EADDRINUSE && mallocd_svcport != 0) {
if (mallocd_res != 0) {
free(res->ai_addr);
free(res);
} else
freeaddrinfo(res);
return (-1);
}
syslog(LOG_ERR, "bindresvport_sa: %m");
exit(1);
}
if (svcport_str == NULL) {
svcport_str = malloc(NI_MAXSERV * sizeof(char));
if (svcport_str == NULL)
out_of_mem();
mallocd_svcport = 1;
if (getnameinfo(res->ai_addr,
res->ai_addr->sa_len, NULL, NI_MAXHOST,
svcport_str, NI_MAXSERV * sizeof(char),
NI_NUMERICHOST | NI_NUMERICSERV))
errx(1, "Cannot get port number");
}
if (mallocd_res != 0) {
free(res->ai_addr);
free(res);
} else
freeaddrinfo(res);
res = NULL;
}
return (0);
} |
the_stack_data/2578.c | struct {
int x;
_Alignas(32) char s[32];
} s = {123, "abc"};
|
the_stack_data/192331924.c | /* Exercise 1 - Calculations
Write a C program to input marks of two subjects. Calculate and print the average of the two marks. */
#include <stdio.h>
int main() {
int mark1, mark2;
float average;
printf("Enter the subject 1 mark : ");
scanf("%d",&mark1);
printf("Enter the subject 2 mark : ");
scanf("%d",&mark2);
average = (mark1+mark2)/2.0;
printf("Average of two marks : %.2f ",average);
return 0;
}
|
the_stack_data/57950457.c | // Check to make sure clang is somewhat picky about -g options.
// rdar://10383444
// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \
| FileCheck -check-prefix=G %s
// RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \
| FileCheck -check-prefix=G %s
// RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \
| FileCheck -check-prefix=G %s
// RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \
| FileCheck -check-prefix=G %s
// RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \
| FileCheck -check-prefix=G %s
// RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \
| FileCheck -check-prefix=G %s
// RUN: %clang -### -c -g %s -target x86_64-apple-darwin 2>&1 \
| FileCheck -check-prefix=G_DARWIN %s
// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin 2>&1 \
| FileCheck -check-prefix=G_DARWIN %s
// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin 2>&1 \
| FileCheck -check-prefix=G_DARWIN %s
// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin 2>&1 \
| FileCheck -check-prefix=G_DARWIN %s
// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin 2>&1 \
| FileCheck -check-prefix=G_DARWIN %s
// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin 2>&1 \
| FileCheck -check-prefix=G_DARWIN %s
// RUN: %clang -### -c -gdwarf-2 %s 2>&1 | FileCheck -check-prefix=G_D2 %s
//
// RUN: %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_NO %s
// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
// RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s
//
// RUN: %clang -### -c -gmlt %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
// RUN: %clang -### -c -gline-tables-only %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s
// RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only %s -target i686-pc-openbsd 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only %s -target x86_64-pc-freebsd10.0 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY %s
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
// RUN: | FileCheck -check-prefix=GLTO_NO %s
//
// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches \
// RUN: -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \
// RUN: | FileCheck -check-prefix=GIGNORE %s
//
// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GOPT %s
//
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s
//
// RUN: %clang -### -fdebug-types-section %s 2>&1 \
// RUN: | FileCheck -check-prefix=FDTS %s
//
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section %s 2>&1 \
// RUN: | FileCheck -check-prefix=NOFDTS %s
//
// RUN: %clang -### -g -gno-column-info %s 2>&1 \
// RUN: | FileCheck -check-prefix=NOCI %s
//
// RUN: %clang -### -g %s 2>&1 | FileCheck -check-prefix=CI %s
//
// G: "-cc1"
// G: "-g"
//
// G_DARWIN: "-cc1"
// G_DARWIN: "-gdwarf-2"
//
// G_D2: "-cc1"
// G_D2: "-gdwarf-2"
//
// G_NO: "-cc1"
// G_NO-NOT: "-g"
//
// GLTO_ONLY: "-cc1"
// GLTO_ONLY-NOT: "-g"
// GLTO_ONLY: "-gline-tables-only"
// GLTO_ONLY-NOT: "-g"
//
// GLTO_ONLY_DWARF2: "-cc1"
// GLTO_ONLY_DWARF2-NOT: "-g"
// GLTO_ONLY_DWARF2: "-gline-tables-only"
// GLTO_ONLY_DWARF2: "-gdwarf-2"
// GLTO_ONLY_DWARF2-NOT: "-g"
//
// G_ONLY: "-cc1"
// G_ONLY-NOT: "-gline-tables-only"
// G_ONLY: "-g"
// G_ONLY-NOT: "-gline-tables-only"
//
// G_ONLY_DWARF2: "-cc1"
// G_ONLY_DWARF2-NOT: "-gline-tables-only"
// G_ONLY_DWARF2: "-gdwarf-2"
// G_ONLY_DWARF2-NOT: "-gline-tables-only"
//
// GLTO_NO: "-cc1"
// GLTO_NO-NOT: "-gline-tables-only"
//
// GIGNORE-NOT: "argument unused during compilation"
//
// GOPT: -generate-gnu-dwarf-pub-sections
//
// GARANGE: -generate-arange-section
//
// FDTS: "-backend-option" "-generate-type-units"
//
// NOFDTS-NOT: "-backend-option" "-generate-type-units"
//
// CI: "-dwarf-column-info"
//
// NOCI-NOT: "-dwarf-column-info"
|
the_stack_data/153246.c | /*************************************************************************
> File Name: best-time-to-buy-and-sell-stock-ii.c
# File Name: best-time-to-buy-and-sell-stock-ii.c
# Author: mist-river
# https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/
# Created Time: 2021年04月21日 星期三 20时19分34秒
************************************************************************/
#include <stdio.h>
int maxProfit(int* prices, int pricesSize){
int i;
int ret = 0;
for(i=0; i<pricesSize-1; i++) {
if (prices[i] < prices[i+1]) {
ret += prices[i+1] - prices[i];
}
}
return ret;
}
void main() {
int arr[6] = {7,1,5,3,6,4};
int ret = maxProfit(arr, 6);
printf("%d\n", ret);
}
|
the_stack_data/755538.c | /* +++Date last modified: 05-Jul-1997 */
/*
** Bit counter by Ratko Tomic
*/
#include <stdio.h>
int bitcount(long i)
{
i = ((i & 0xAAAAAAAAL) >> 1) + (i & 0x55555555L);
i = ((i & 0xCCCCCCCCL) >> 2) + (i & 0x33333333L);
i = ((i & 0xF0F0F0F0L) >> 4) + (i & 0x0F0F0F0FL);
i = ((i & 0xFF00FF00L) >> 8) + (i & 0x00FF00FFL);
i = ((i & 0xFFFF0000L) >> 16) + (i & 0x0000FFFFL);
return (int)i;
}
int main(int argc, char *argv[])
{
long n = 0;
while(scanf("%d", &n)==1)
{
int i = bitcount(n);
printf("%ld contains %d bit set\n", n, i);
}
return 0;
}
|
the_stack_data/193892273.c | int main()
{
char a[2] = {2, 3};
a[1] *= a[0];
assert(a[0] == 2, "a[0] must be 2");
assert(a[1] == 6, "a[1] must be 6");
return 0;
}
|
the_stack_data/54825127.c | #include <stdio.h>
#define VUOTO 0
#define CELL 3
#define N 9
#define MINVAL 1
#define MAXVAL 9
#define MAXFN 50
#define INVALID -1
/*
ES3 - Si vuole realizzare un programma che verifica se una griglia
di un Sudoku (https://it.wikipedia.org/wiki/Sudoku), anche
parzialmente riempita, sia valida o meno. In breve una griglia di un
Sudoku è una matrice 9x9 di interi e ciascuna posizione può
contenere un valore da 1 a 9 o esser vuota se la griglia non è stata
ancora completata. Una griglia, anche parzialmente, è valida se si
verificano tutte le seguenti condizioni:
* in ciascuna riga della matrice non si presenta alcuna ripetizione
dei numeri validi (da 1 a 9)
* in ciascuna colonna della matrice non si presenta alcuna
ripetizione dei numeri validi (da 1 a 9)
* dividendo la matrice 9x9 in 9 sottomatrici 3x3 non sovrapposte,
ciascuna sottomatrice non contiene alcuna ripetizione dei numeri
validi (da 1 a 9).
Realizzare il programma come segue:
- definire una costante VUOTO contenente il valore 0.
- definire un sottoprogramma "stampa_sudoku" che riceva come
argomento una matrice definita con 9 colonne e la stampi a video. Si
utilizzi uno spazio per indicare le celle vuote; opzionale:
disegnare le righe orizzontali e verticali che contornano l'intera
griglia e le 9 sottogriglie come da esempio:
+-------+-------+-------+
| 9 | | 4 |
| 8 5 | 4 | 1 |
| 4 | 6 8 1 | 5 3 9 |
+-------+-------+-------+
| 8 | 4 9 | 7 3 |
| 7 | 6 | 4 8 |
| 4 1 | 8 3 | 6 |
+-------+-------+-------+
| 3 5 | 4 | 2 9 1 |
| 9 2 | 1 3 | 7 6 |
| 1 | 6 | 5 4 |
+-------+-------+-------+
- definire un sottoprogramma "leggi" che riceve come argomento il
nome di un file di testo e una matrice di interi dichiarata con 9
colonne. Il sottoprogramma apre il file di testo, contenente 9x9
valori interi, e popola la matrice con i dati letti da file. Il
sottoprogramma restituisce 1 se l'operazione è andata a buon fine
altrimenti 0. Si noti che si potrebbe verificare un errore di
apertura del file o il numero di valori letti potrebbe essere
erroneamente minore di 81 o un dato valore potrebbe essere al di
fuori dell'intervallo [1,9] o diversa da VUOTO. Il sottoprogramma
prima di ritornare stampa a video la causa dell'eventuale errore
riscontrato.
- definire un sottoprogramma "verifica_sudoku" che riceva come
argomento una matrice di interi dichiarata con 9 colonne e verifichi
che il sudoku associato sia valido. Il sottoprogramma restituisce 1
in caso affermativo; in alternativa stampa a video un messaggio per
ciascun errore riscontrato (cioè indici di riga o colonna o
quadrante che violano le regole) e restituisce 0.
- Scrivere un programma chiede all'utente il nome del file (una
stringa di al massimo 50 caratteri). Mediante l'ausilio dei
sottoprogrammi sopra definiti, il programma legge la matrice dal
file, la stampa a video e verifica se la griglia è valida, stampando
a video il responso. Gestire opportunamente gli eventuali errori.
*/
void stampa_sudoku(int m[][N], int dim);
void stampa_sep_riga(int dim);
int leggi(char fn[], int m[][N], int dim);
int verifica_sudoku(int m[][N], int dim);
int main() {
char fn[MAXFN];
int m[N][N], ok;
scanf("%s", fn);
ok = leggi(fn, m, N);
if (ok) {
stampa_sudoku(m, N);
ok = verifica_sudoku(m, N);
printf("Valido: %d\n", ok);
}
return 0;
}
void stampa_sudoku(int m[][N], int dim) {
int i, j, k;
for (i = 0; i < dim; i++) {
if (i % CELL == 0)
stampa_sep_riga(dim);
for (j = 0; j < dim; j++) {
if (j % CELL == 0)
printf("| ");
if (m[i][j] == VUOTO)
printf(" ");
else
printf("%d ", m[i][j]);
}
printf("|\n");
}
stampa_sep_riga(dim);
}
void stampa_sep_riga(int dim) {
int i;
for (i = 0; i < dim; i++) {
if (i % CELL == 0)
printf("+-");
printf("--");
}
printf("+\n");
}
int leggi(char fn[], int m[][N], int dim) {
FILE *fp;
int ok, i, j;
ok = 1;
fp = fopen(fn, "r");
if (fp) {
for (i = 0; i < dim && ok; i++) {
for (j = 0; j < dim && ok; j++) {
m[i][j] = INVALID;
fscanf(fp, "%d", &m[i][j]);
if ((feof(fp) && !(i == dim - 1 && j == dim - 1)) ||
m[i][j] == INVALID) {
printf("Errore: il file contiene meno elementi di quelli attesi.\n");
ok = 0;
} else if (!((m[i][j] >= MINVAL && m[i][j] <= MAXVAL) ||
m[i][j] == VUOTO)) {
printf("Errore: il valore [%d][%d] non è valido.\n", i, j);
ok = 0;
}
}
}
fclose(fp);
} else {
printf("Errore di apertura del file.\n");
ok = 0;
}
return ok;
}
int verifica_sudoku(int m[][N], int dim) {
int valido, n, i, j, count, ii, jj;
valido = 1;
for (i = 0; i < dim && valido; i++) {
for (n = MINVAL; n <= MAXVAL && valido; n++) {
count = 0;
for (j = 0; j < dim; j++) {
if (m[i][j] == n)
count++;
}
if (count > 1) {
printf("Riga %d: il numero %d appare %d volte.\n", i, n, count);
valido = 0;
}
}
}
for (i = 0; i < dim && valido; i++) {
for (n = MINVAL; n <= MAXVAL && valido; n++) {
count = 0;
for (j = 0; j < dim; j++) {
if (m[j][i] == n)
count++;
}
if (count > 1) {
printf("Colonna %d: il numero %d appare %d volte.\n", i, n, count);
valido = 0;
}
}
}
for (i = 0; i < dim && valido; i += CELL) {
for (j = 0; j < dim && valido; j += CELL) {
for (n = MINVAL; n <= MAXVAL && valido; n++) {
count = 0;
for (ii = 0; ii < CELL; ii++) {
for (jj = 0; jj < CELL; jj++) {
if (m[i + ii][j + jj] == n)
count++;
}
}
if (count > 1) {
printf("Cella [%d][%d]: il numero %d appare %d volte\n", i / CELL,
j / CELL, n, count);
valido = 0;
}
}
}
}
return valido;
}
|
the_stack_data/45533.c | #include <stdio.h>
int checkPrime(int n);
int main(void) {
int n, i, flag=0;
printf("Enter the integer: ");
scanf("%d", &n);
for (i=2; i<=n; ++i) {
if (checkPrime(i)==1) {
if (checkPrime(n-i)==1) {
printf("%d = %d + %d \n", n, i, n-i);
flag = 1;
}
}
}
if (flag==0) {
printf("%d Cannot be decomposed into two prime numbers", n);
}
return 0;
}
int checkPrime(int n) {
int i, isPrime=1;
for (i=2; i<=n/2; ++i) {
if (n%i==0) {
isPrime=0;
break;
}
}
return isPrime;
} |
the_stack_data/642789.c | #include <stdio.h>
int main ()
{
int n;
scanf("%d", &n);
if(n % 10 != 0 && n % (n / 10) == 0) printf("SIM\n");
else printf("NAO\n");
return 0;
}
|
the_stack_data/73575868.c | //#include <stdio.h>
// This code is licensed under the New BSD license.
// See LICENSE.txt for more details.
int i = 4;
extern int j;
typedef int footype;
int main()
{
typedef unsigned long bartype;
printf("Hello World\n");
return 0;
}
|
the_stack_data/62275.c | /* { dg-do run } */
/* { dg-options "-O2" } */
extern void abort (void);
struct S {
int *i[4];
int *p1;
int *p2;
int *p3;
int *p4;
int **x;
};
int **b;
int main()
{
int i = 1;
struct S s;
s.p3 = &i;
int **p;
if (b)
p = b;
else
p = &s.i[2];
p += 4;
/* prevert fowrprop from creating an offsetted sd constraint and
preserve the pointer offsetting constraint. */
s.x = p;
p = s.x;
if (!b)
{
int *z = *p;
/* z should point to i (and non-local/escaped). */
*z = 0;
}
if (i != 0)
abort ();
return i;
}
|
the_stack_data/162642948.c | /**~classification~
* StructuralFeature [Abstract Class]
*
* Description
*
* A StructuralFeature is a typed feature of a Classifier
* that specifies the structure of instances of the Classifier.
*
* Diagrams
*
* Features, Properties,
* Instances,
* Structural Feature Actions
*
* Generalizations
*
* MultiplicityElement,
* TypedElement, Feature
*
* Specializations
*
* Property
*
* Attributes
*
* isReadOnly : Boolean [1..1] = false
*
* If isReadOnly is true, the StructuralFeature
* may not be written to after initialization.
**/ |
the_stack_data/124948.c | #include "syscall.h"
int main()
{
Exec("test/testLongLoop");
Exec("test/testAnotherLongLoop");
}
|
the_stack_data/705970.c | #include <stdio.h>
int main()
{
int x, y; scanf("%d %d", &x, &y);
if (x == 0 && y == 0)
{
printf("origem\n");
}
else if (x == 0)
{
printf("eixo y\n");
}
else if (y == 0)
{
printf("eixo x\n");
}
else if (x > 0 && y > 0)
{
printf("primeiro\n");
}
else if (x < 0 && y > 0)
{
printf("segundo\n");
}
else if (x < 0 & y < 0)
{
printf("terceiro\n");
}
else if (x > 0 && y < 0)
{
printf("quarto\n");
}
return(0);
}
|
the_stack_data/154832129.c | #include <stdbool.h>
bool mx_isdigit(int c);
bool mx_isspace(int c);
int mx_atoi(const char *str);
int mx_atoi(const char *str){
char minus = 0;
char start = 0;
int a = -1;
int b = -1;
int dec = 1;
for(int i = 0; str[i] != '\0'; i++){
if(!start){
if(str[i] == '-'){
minus = 1;
start = 1;
}
else if(mx_isdigit(str[i])){
a = i;
b = i;
start = 1;
minus = 0;
}
else if(!mx_isspace(str[i]))
return 0;
}
else{
if(mx_isdigit(str[i])){
if(a == -1)
a = i;
b = i;
dec *= 10;
}
else
break;
}
}
if(a == -1 && b == -1)
return 0;
int num = 0;
if(minus)
dec /= 10;
for(int i = a; i <= b; i++){
num += dec * (str[i] - '0');
dec /= 10;
}
if(minus == 1)
num *= -1;
return num;
}
|
the_stack_data/1052964.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Prototypes.
int is_anagram(char *string1, char *string2);
// Driver Function.
int main(void)
{
char string1[20], string2[20];
printf("Enter first word: ");
if(scanf(" %s", string1) == 0)
{
printf("Invalid Input :(\n");
exit(EXIT_FAILURE);
}
printf("Enter second word: ");
if(scanf(" %s", string2) == 0)
{
printf("Invalid Input :(\n");
exit(EXIT_FAILURE);
}
if(is_anagram(string1, string2)) // Strings Outputed In Sorted Form On Purpose. Creating String Copies Will Change That.
printf("\"%s\" and \"%s\" are anagrams.\n", string1, string2);
else
printf("\"%s\" and \"%s\" are not anagrams.\n", string1, string2);
return (0);
}
// Is Anagram Function.
int is_anagram(char *string1, char *string2)
{
char temp;
if(strlen(string1) != strlen(string2))
return(0);
else
// Sort Characters In String1.
for(int i = 0; i < string1[i]; i++)
for(int j = i + 1; string1[j]; j++)
{
if(string1[j] < string1[i])
{
temp = string1[j];
string1[j] = string1[i];
string1[i] = temp;
}
}
// Sort Characters In String2.
for(int i = 0; i < string2[i]; i++)
for(int j = i + 1; string2[j]; j++)
{
if(string2[j] < string2[i])
{
temp = string2[j];
string2[j] = string2[i];
string2[i] = temp;
}
}
// Comparing Results.
for(int i = 0; string1[i] != '\0'; i++)
if(string1[i] != string2[i])
return (0);
return (1);
}
|
the_stack_data/82733.c | #include <stdio.h>
char flag[] = "GG{Th3t_W4S_3A5Y}";
void print_flag(){
printf("%s\n", flag);
}
int main(int argc, char **argv){
int check=0;
char buffer[32];
gets(buffer);
if(check == 0x63996123) {
print_flag();
}
}
|
the_stack_data/643401.c | unsigned getbits(unsigned x, int p, int n)
{
return (x >> (p+1-n)) & ~(~0<<n);
}
|
the_stack_data/115765313.c | #include <stdio.h>
#include <stdlib.h>
int begin[2000][4];
int fila[1001][2];
int sorting(const void* a, const void* b)
{
return (*(int*)a - *(int*)b);
}
int main()
{
int i = 0, j = 0, ant, k, area = 0, alt = 0, per = 0, alta, aux1, aux2, aux3, aux4;
while (scanf("%d %d %d %d", &begin[i][0], &begin[i][1], &begin[i][2], &begin[i][3]) != EOF){
i++;
begin[i][0] = begin[i - 1][2];
begin[i][1] = begin[i - 1][3];
begin[i][2] = begin[i - 1][0];
begin[i][3] = begin[i - 1][1];
i++;
}
qsort(begin, i, 4 * sizeof (int), sorting);
fila[0][0] = begin[0][1];
fila[0][1] = begin[0][3];
for (j = 1;j < i;j++){
alta = alt;
alt = fila[0][1] - fila[0][0];
k = 1;
ant = 0;
while (fila[k][0] != 0){
if (fila[k][0] < fila[ant][1] && fila[k][1] > fila[ant][1]) {
alt += (fila[k][1] - fila[ant][1]);
ant = k;
}else
if (fila[k][0] > fila[ant][1]) {
alt += (fila[k][1] - fila[k][0]);
ant = k;
per += 2 * (begin[j][0] - begin[j - 1][0]);
}
k++;
}
if (alta < alt)
per += (2 * (alt - alta));
area = area + ((begin[j][0] - begin[j - 1][0]) * (alt));
per += 2 * (begin[j][0] - begin[j - 1][0]);
if (begin[j][0] < begin[j][2]) {
k = 0;
while (fila[k][0] != 0 && fila[k][0] < begin[j][1])
k++;
aux1 = fila[k][0];
aux2 = fila[k][1];
fila[k][0] = begin[j][1];
fila[k][1] = begin[j][3];
while (fila[++k][0] != 0){
aux3 = fila[k][0];
aux4 = fila[k][1];
fila[k][0] = aux1;
fila[k][1] = aux2;
aux1 = aux3;
aux2 = aux4;
}
fila[k][0] = aux1;
fila[k][1] = aux2;
}else{
k = 0;
while ((fila[k][1] != begin[j][1] && fila[k][0] != begin[j][3]) && fila[k][0] != 0)
k++;
while (fila[k][0] != 0){
fila[k][0] = fila[k + 1][0];
fila[k][1] = fila[k + 1][1];
k++;
}
}
}
printf("%d %d\n", area, per);
return 0;
}
|
the_stack_data/122016731.c | #include<stdio.h>
#include<string.h>
struct tree
{
char data;
struct tree *right;
struct tree *left;
};
struct tree *stack[20];
int top=-1;
struct tree *newnode()
{
return (struct tree*)malloc(sizeof(struct tree));
};
void push(struct tree* p)
{
stack[++top]=p;
}
struct tree *pop()
{
return(stack[top--]);
};
int checkoperator(char ch)
{
if(ch=='+'||ch=='-'||ch=='/'||ch=='*'||ch=='^')
return 2;
else
return 1;
}
void operand(char s)
{
struct tree *node=newnode();
node->data=s;
node->left=NULL;
node->right=NULL;
push(node);
}
void operators(char s)
{
struct tree *node=newnode();
node->data=s;
node->right=pop();
node->left=pop();
push(node);
}
void display(struct tree *x,int i)
{
int j;
if(x==NULL)
{
return;
}
display(x->right,i+1);
for(j=0;j<i;j++)
{
printf("\t");
}
printf("%c",x->data);
printf("\n\n");
display(x->left,i+1);
}
void inorder(struct tree *node)
{
if(node!=NULL)
{
inorder(node->left);
printf("%c",node->data);
inorder(node->right);
}
}
int main()
{
int i;
char s[20];
printf("enter the postfix expression : ");
gets(s);
for(i=0;i<strlen(s);i++)
{
if(checkoperator(s[i])==1)
{
operand(s[i]);
}
else
{
operators(s[i]);
}
}
printf("the tree is as follows : \n\n");
struct tree *root;
root=stack[top];
display(root,0);
printf("\nThe inorder traversal of the tree is \n");
inorder(stack[top]);
}
|
the_stack_data/1077371.c | /*
* Copyright (C) 2018 Jonas Zeiger <jonas.zeiger@talpidae.net>
*
* 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.
*
*/
/**
* allocate-port.c - Simple dynamic port allocation helper
*
* Lets the kernel allocate a dynamic TCP listen port, outputs it and exits.
*
* USAGE:
*
* allocate-port ADDRESS
*
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <stdint.h>
#include <inttypes.h>
#include <time.h>
#include <errno.h>
#include <ifaddrs.h>
/* UNIX platform stuff */
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <poll.h>
#include <fcntl.h>
static int resolve_host_port(struct sockaddr_in *address, const char *host, uint_fast16_t port)
{
struct hostent *host_entity = gethostbyname(host);
h_errno = 0;
if (host_entity == NULL)
{
(void) fprintf(stderr, "Error: gethostbyname(): %s\n", hstrerror(h_errno));
return -1;
}
memset(address, 0, sizeof(struct sockaddr_in));
address->sin_family = AF_INET;
memcpy((char *)&address->sin_addr.s_addr, (char *)host_entity->h_addr, host_entity->h_length);
address->sin_port = htons(port);
return 0;
}
/*
static int resolve_primary_address(struct sockaddr *primary_address, int primary_address_size)
{
struct ifaddrs *if_addresses;
if (getifaddrs(&if_addresses))
{
perror("getifaddrs()");
return -1;
}
for (struct ifaddr *ifa = if_addresses; ifa != NULL; ifa = ifa->ifa_next)
{
if (ifa->ifa_addr == NULL)
continue;
int family, s;
if((strcmp(ifa->ifa_name,"wlan0")==0)&&(ifa->ifa_addr->sa_family==AF_INET))
{
if (s != 0)
{
printf("getnameinfo() failed: %s\n", gai_strerror(s));
exit(EXIT_FAILURE);
}
printf("\tInterface : <%s>\n",ifa->ifa_name );
printf("\t Address : <%s>\n", host);
}
}
freeifaddrs(ifaddr);
return 0;
}
*/
/**
* Create an outgoing UDP socket (to a test address) and return its local IP.
*/
static int resolve_primary_address(const char *reachable_ipv4, struct sockaddr_in *primary_address, socklen_t primary_address_size)
{
errno = 0;
const int sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (sock < 0)
{
perror("resolve_primary_address: socket()");
return -1;
}
/* use TEST-NET-1 IP (reserved by IANA for documentation purposes) as a fallback */
const char* test_ip = "192.0.2.1";
if (reachable_ipv4 != NULL && strlen(reachable_ipv4) > 0)
{
test_ip = reachable_ipv4;
}
const uint16_t dns_port = 53; /* whatever */
struct sockaddr_in test_address;
memset(&test_address, 0, sizeof(test_address));
test_address.sin_family = AF_INET;
test_address.sin_port = htons(dns_port);
if (!inet_aton(test_ip, &test_address.sin_addr))
{
(void) fprintf(stderr, "error: invalid IPv4 address: %s\n", test_ip);
return -1;
}
errno = 0;
if (connect(sock, (const struct sockaddr*) &test_address, sizeof(test_address)))
{
perror("resolve_primary_address: connect()");
return -1;
}
errno = 0;
if (getsockname(sock, (struct sockaddr*) primary_address, &primary_address_size))
{
perror("resolve_primary_address: getsockname()");
return -1;
}
errno = 0;
if (close(sock))
{
perror("resolve_primary_address: close()");
return -1;
}
return 0;
}
/** Allocate a dynamic listen TCP (IPv4) port and immediately close the socket.
*
* @return 0 if bound_address has been filled with the outgoing address and an allocated TCP port
* or -1 if any error occured
*/
static int allocate_port(const char *bind_host, uint16_t bind_port, struct sockaddr_in *bound_address, const char *reachable_ipv4)
{
errno = 0;
const int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0)
{
perror("socket()");
return -1;
}
errno = 0;
int enable = 1;
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)))
{
perror("setsockopt()");
return -1;
}
errno = 0;
struct sockaddr_in bind_address;
if (resolve_host_port(&bind_address, bind_host, bind_port))
{
return -1;
}
errno = 0;
if (bind(sock, (const struct sockaddr *)&bind_address, sizeof(bind_address)))
{
perror("bind()");
return -1;
}
socklen_t bound_address_size = sizeof(*bound_address);
memset(bound_address, 0, bound_address_size);
errno = 0;
if (getsockname(sock, (struct sockaddr *) bound_address, &bound_address_size))
{
perror("getsockname()");
return -1;
}
errno = 0;
if (close(sock))
{
perror("close()");
return -1;
}
/** INADDR_ANY (0.0.0.0) ? */
if (bound_address->sin_addr.s_addr == 0)
{
const uint16_t port = bound_address->sin_port;
if (resolve_primary_address(reachable_ipv4, bound_address, bound_address_size))
{
(void) fprintf(stderr, "error: failed to resolve primary address\n");
return -1;
}
bound_address->sin_port = port;
}
return 0;
}
int main(int argc, char **argv)
{
if (argc < 2)
{
(void) fprintf(stderr, "error: no bind address specified\n");
return 1;
}
else if (argc > 3)
{
(void) fprintf(stderr, "error: superfluous arguments specified\n");
return 1;
}
struct sockaddr_in bound_address = { 0 };
if (allocate_port(argv[1], 0, &bound_address, (argc == 3) ? argv[2] : NULL))
{
(void) fprintf(stderr, "error: failed to allocate port\n");
return 1;
}
(void) printf("%s\t%hu\n", inet_ntoa(bound_address.sin_addr), ntohs(bound_address.sin_port));
return 0;
}
|
the_stack_data/400888.c | #include<stdio.h>
int main(){
//taking input
int n;
scanf("%d", &n);
int arr[100000];
for(int i=0;i<n;i++){
scanf("%d", &arr[i]);
}
//storing index
int idx=-1;
//if size of array is only 1 then return idx 0
if(n==1){
idx=0;
}
//if first index is local minima
else if(arr[1]>=arr[0]){
idx=0;
}
//if last index is local minima
else if(arr[n-2]>=arr[n-1]){
idx=n-1;
}
//if local minima lies between 1 to n
else{
for(int i=1;i<n-1;i++){
if(arr[i-1]>= arr[i] && arr[i+1]>=arr[i]){
idx=i;
break;
}
}
}
//printing local minima
printf("%d", idx);
} |
the_stack_data/387087.c | // ----------------------------------------------------------------------------
// Copyright 2019-2020 ARM Ltd.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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.
// ----------------------------------------------------------------------------
#ifdef MBED_CONF_APP_SECURE_ELEMENT_ATCA_SUPPORT
#include "mcc_atca_credentials_init.h"
#include "mbedtls/x509.h"
#include "mbedtls/x509_crt.h"
#include "mbedtls/oid.h"
#include "mbed-trace/mbed_trace.h"
#include "tng_root_cert.h"
#include "key_config_manager.h"
#include "atcacert.h"
#include "atca_status.h"
#include "tng_atca.h"
#include "atcacert_def.h"
#include "atcacert_client.h"
#include "atca_basic.h"
#include "atca_helpers.h"
#include "storage_kcm.h"
#include "fcc_defs.h"
#include "atecc608a_se.h"
#include "cust_def_1_signer.h"
#include "cust_def_2_device.h"
#include "tngtls_cert_def_1_signer.h"
#include "tngtls_cert_def_2_device.h"
#include "tnglora_cert_def_1_signer.h"
#include "tnglora_cert_def_2_device.h"
#define TRACE_GROUP "atml"
/*Global certificate structure pointers, should be set during mcc_atca_init
according to credentials and device types*/
atcacert_def_t *g_mcc_cert_def_1_signer = NULL;
atcacert_def_t *g_mcc_cert_def_2_device = NULL;
const uint8_t *g_mcc_cert_ca_public_key_1_signer = NULL;
/* This file implements SE device certificate decompression.
The decompression steps are:
- Read the signer certificate data from SE using direct atca APIs
- Read the device certificate data from SE using direct atca APIs
- Retrieve the CN attribute of the device certificate and save it as Endpoint name in the device storage by using KCM functionality.
- Create device certificate chain and save it to the device storage by using KCM functionally.*/
/*******************************************************************************
* Definitions
******************************************************************************/
/* === Definitions and Prototypes === */
/*ATCA certificate chain size*/
#define MCC_ATCA_SIGNER_CHAIN_DEPTH 2
/*Signer public key size*/
#define SIGNER_PUBLIC_KEY_MAX_LEN 64
/*******************************************************************************
* Static functions
******************************************************************************/
/*Reads signer certificate from the device*/
static int mcc_atca_read_signer_cert(uint8_t *cert, size_t *cert_size_out)
{
//read signer cert
int atca_status = atcacert_read_cert((const atcacert_def_t*)g_mcc_cert_def_1_signer, g_mcc_cert_ca_public_key_1_signer, cert, cert_size_out);
if (atca_status != ATCACERT_E_SUCCESS) {
tr_error("atcacert_read_cert error (%" PRIu32 ")", (uint32_t)atca_status);
return -1;
}
tr_debug("Read of signer certificate finished");
return 0;
}
/*Get CN attribute of the certificate*/
static int mcc_atca_get_cn(const uint8_t *cert, size_t cert_size, uint8_t **cn_out, size_t *cn_size_out)
{
uint8_t *cert_cn_data = NULL;
int res = 0;
char *cn_attribute_name = "CN";
size_t cn_attribute_name_size = strlen(cn_attribute_name);
mbedtls_x509_name *asn1_subject = NULL;
const char *shortName = NULL;
mbedtls_x509_crt *cert_handler = NULL;
//Allocate mbedtls x509 certificate handler
cert_handler = (mbedtls_x509_crt*)malloc(sizeof(mbedtls_x509_crt));
if (cert_handler == NULL) {
tr_error("failed to allocate mbedtls_x509_crt ");
res = -1;
goto Exit;
}
//Initialize certificate handler
mbedtls_x509_crt_init(cert_handler);
//Parse certificate
res = mbedtls_x509_crt_parse_der(cert_handler, (const unsigned char*)cert, cert_size);
if (res != 0) {
tr_error("mbedtls_x509_crt_parse_der error (%" PRIu32 ")", (uint32_t)res);
res = -1;
goto Exit;
}
//Set certificate subject pointer
asn1_subject = &cert_handler->subject;
//Read the "CN" attribute
while (asn1_subject) {
//Get next oid field
res = mbedtls_oid_get_attr_short_name(&asn1_subject->oid, &shortName);
if (res != 0) {
tr_error("mbedtls_oid_get_attr_short_name error (%" PRIu32 ")", (uint32_t)res);
res = -1;
goto Exit;
}
//Compare the name of the field to "CN" attribute name
if (strncmp(shortName, cn_attribute_name, cn_attribute_name_size) == 0) {
//Allocate memory for certificate attribute
cert_cn_data = malloc(asn1_subject->val.len);
if (cert_cn_data == NULL) {
tr_error("Failed to allocate memory to accommodate CN attribute");
res = -1;
goto Exit;
}
//Copy the attribute data to allocated buffer
memcpy(cert_cn_data, asn1_subject->val.p, asn1_subject->val.len);
//Set output parameters
*cn_size_out = asn1_subject->val.len;
*cn_out = cert_cn_data;
break;
}
//Get pointer of the next field
asn1_subject = asn1_subject->next;
}
Exit:
if (res != 0) {
free(cert_cn_data);
}
//Free allocated certificate handler internal data
mbedtls_x509_crt_free(cert_handler);
//Free allocated certificate header
free(cert_handler);
return res;
}
/*The function reads CN attribute of the device certificate and stores it to the device storage as endpoint item */
static int mcc_store_device_cert_cn(const uint8_t *device_cert, size_t device_cert_size)
{
kcm_status_e kcm_status = KCM_STATUS_SUCCESS;
uint8_t *device_cn = NULL;
size_t device_cn_size = 0;
int res = 0;
//Read cn attribute of the device certificate
res = mcc_atca_get_cn(device_cert, device_cert_size, &device_cn, &device_cn_size);
if (res != 0) {
tr_error("psa_drv_atca_get_cn error (%" PRIu32 ")", (uint32_t)kcm_status);
return -1;
}
// store the device certificate CN as a endpoint name config param that is not allowed for deleting
kcm_status = storage_item_store((const uint8_t *)g_fcc_endpoint_parameter_name, strlen(g_fcc_endpoint_parameter_name),
KCM_CONFIG_ITEM, true, STORAGE_ITEM_PREFIX_KCM, device_cn, device_cn_size, false);
/*Free memory that was allocated for CN data*/
free(device_cn); // caller must evacuate this buffer
if (kcm_status != KCM_STATUS_SUCCESS) {
tr_error("kcm_item_store error (%" PRIu32 ")", (uint32_t)kcm_status);
return -1;
}
tr_debug("Store of endpoint name finished");
return 0;
}
/* Read device certificate*/
static int mcc_atca_read_device_cert(const uint8_t *signer_certificate, size_t signer_certificate_size, uint8_t *device_certificate, size_t *device_certificate_size_out)
{
int atca_status = ATCACERT_E_SUCCESS;
uint8_t signer_public_key[SIGNER_PUBLIC_KEY_MAX_LEN];
//Read signer public key
atca_status = atcacert_get_subj_public_key((const atcacert_def_t*)g_mcc_cert_def_1_signer, signer_certificate, signer_certificate_size, signer_public_key);
if (atca_status != ATCACERT_E_SUCCESS) {
tr_error("atcacert_get_subj_public_key error (%" PRIu32 ")", (uint32_t)atca_status);
return -1;
}
// read device certificate using signer public key
atca_status = atcacert_read_cert((const atcacert_def_t*)g_mcc_cert_def_2_device, signer_public_key, device_certificate, device_certificate_size_out);
if (atca_status != ATCACERT_E_SUCCESS) {
tr_error("atcacert_read_cert error (%" PRIu32 ")", (uint32_t)atca_status);
return -1;
}
tr_debug("Read of device certificated finished");
return 0;
}
/*Get max size of the certificate*/
static int mcc_atca_get_max_cert_size(const atcacert_def_t* cert_def, size_t *max_cert_size_out)
{
int atca_status = ATCACERT_E_SUCCESS;
// Get signer certificate
atca_status = atcacert_max_cert_size((const atcacert_def_t*)cert_def, max_cert_size_out);
if (atca_status != ATCA_SUCCESS) {
tr_error("atcacert_max_cert_size error (%" PRIu32 ")", (uint32_t)atca_status);
return -1;
}
tr_debug("certificate size is (%" PRIu32 ")", (uint32_t)max_cert_size_out);
return 0;
}
/*Initialize atca resources */
static int mcc_atca_init(void)
{
tng_type_t type;
//Initialize atca driver
ATCA_STATUS atca_status = atecc608a_init();
if (atca_status != ATCA_SUCCESS) {
tr_error("atcab_init error (%" PRIu32 ")", (uint32_t)atca_status);
return -1;
}
/*Initialize atca credentials templates
If the device is set to default MCHP credentials, the global credential variables should use default templates according to
the device type, otherwise - use custom credentials templates*/
if (g_cert_def_2_device.cert_template == NULL && g_cert_def_1_signer.cert_template == NULL) { //Default credentials
/*Default credentials : check tng type and set template pointers according to the type
Get TNG type*/
atca_status = tng_get_type(&type);
if (atca_status != ATCA_SUCCESS) {
tr_error("tng_get_type error (%" PRIu32 ")", (uint32_t)atca_status);
return -1;
}
//Set CA public key of the signer, use cryptoauth define
g_mcc_cert_ca_public_key_1_signer = &g_cryptoauth_root_ca_002_cert[CRYPTOAUTH_ROOT_CA_002_PUBLIC_KEY_OFFSET];
if (type == TNGTYPE_LORA) {//TNGTYPE_LORA - use g_tnglora_*** structures
g_mcc_cert_def_1_signer = (atcacert_def_t *)&g_tnglora_cert_def_1_signer;
g_mcc_cert_def_2_device = (atcacert_def_t *)&g_tnglora_cert_def_2_device;
} else {//TNGTYPE_22- use g_tng2_*** structures
g_mcc_cert_def_1_signer = (atcacert_def_t *)&g_tngtls_cert_def_1_signer;
g_mcc_cert_def_2_device = (atcacert_def_t *)&g_tngtls_cert_def_2_device;
}
} else { //Customer credentials - use custom templates
g_mcc_cert_def_1_signer = (atcacert_def_t *)&g_cert_def_1_signer;
g_mcc_cert_def_2_device = (atcacert_def_t *)&g_cert_def_2_device;
//Set CA public key of the signer, use custom define
g_mcc_cert_ca_public_key_1_signer = (const uint8_t*)&g_cert_ca_public_key_1_signer;
}
return 0;
}
void mcc_atca_release(void)
{
//Release allocated resources
ATCA_STATUS atca_status = atecc608a_deinit();
if (atca_status != ATCA_SUCCESS) {
tr_error("Failed to releasing Atmel's secure element (%" PRIu32 ")", (uint32_t)atca_status);
}
}
static int mcc_decompress_device_cert_chain(void)
{
kcm_status_e kcm_status = KCM_STATUS_SUCCESS, close_chain_status = KCM_STATUS_SUCCESS;
kcm_cert_chain_handle cert_chain_h = NULL;
size_t device_cert_size = 0, signer_cert_size = 0;
uint8_t *signer_certificate_buffer = NULL;
uint8_t *device_certificate_buffer = NULL;
int res = 0;
// Create chain for device and signer certificate.
kcm_status = storage_cert_chain_create(&cert_chain_h, (uint8_t *)g_fcc_bootstrap_device_certificate_name, strlen(g_fcc_bootstrap_device_certificate_name), MCC_ATCA_SIGNER_CHAIN_DEPTH, true, STORAGE_ITEM_PREFIX_KCM);
if (kcm_status == KCM_STATUS_FILE_EXIST) {
// Already exist. Skip read and store.
return 0;
}
if (kcm_status != KCM_STATUS_SUCCESS) {
tr_error("kcm_cert_chain_create failed (%" PRIu32 ")", (uint32_t)kcm_status);
return -1;
}
/*Initialize atca resources*/
res = mcc_atca_init();
if (res != 0) {
tr_error("mcc_atca_init failed");
goto Exit;
}
// query device cert size
res = mcc_atca_get_max_cert_size(g_mcc_cert_def_2_device, &device_cert_size);
if (res != 0) {
tr_error("mcc_atca_get_max_device_cert_size failed");
goto Exit;
}
// query signer cert size
res = mcc_atca_get_max_cert_size(g_mcc_cert_def_1_signer, &signer_cert_size);
if (res != 0) {
tr_error("mcc_atca_get_max_signer_cert_size failed");
goto Exit;
}
// allocate buffers to hold the device and signer certificates
signer_certificate_buffer = malloc(signer_cert_size);
if (signer_certificate_buffer == NULL) {
tr_error("Failed to allocate signer certificate buffer");
res = -1;
goto Exit;
}
device_certificate_buffer = malloc(signer_cert_size);
if (device_certificate_buffer == NULL) {
tr_error("Failed to allocate device certificate buffer");
res = -1;
goto Exit;
}
// read the signer certificate (signer certificate is the actual device certificate CA)
res = mcc_atca_read_signer_cert(signer_certificate_buffer, &signer_cert_size);
if (res != 0) {
tr_error("mcc_atca_read_signer_cert failed");
goto Exit;
}
// read the device certificate using signer certificate
res = mcc_atca_read_device_cert(signer_certificate_buffer, signer_cert_size, device_certificate_buffer, &device_cert_size);
if (res != 0) {
tr_error("mcc_atca_read_device_cert failed");
goto Exit;
}
// read and store the CN of the device X509 certificate
res = mcc_store_device_cert_cn(device_certificate_buffer, device_cert_size);
if (res != 0) {
tr_error("mcc_store_device_cert_cn failed");
goto Exit;
}
// Store the device and signer certificate as KCM chain that is not allowed for deleting
// start with the leaf - add device certificate
kcm_status = storage_cert_chain_add_next(cert_chain_h, device_certificate_buffer, device_cert_size, STORAGE_ITEM_PREFIX_KCM, false);
if (kcm_status != KCM_STATUS_SUCCESS) {
tr_error("Failed to add Atmel's device certificate (%" PRIu32 ")", (uint32_t)kcm_status);
res = -1;
goto Exit;
}
//add signer certificate
kcm_status = storage_cert_chain_add_next(cert_chain_h, signer_certificate_buffer, signer_cert_size, STORAGE_ITEM_PREFIX_KCM, false);
if (kcm_status != KCM_STATUS_SUCCESS) {
tr_error("Failed to add Atmel's signer certificate (%" PRIu32 ")", (uint32_t)kcm_status);
res = -1;
}
Exit:
mcc_atca_release();
free(device_certificate_buffer);
free(signer_certificate_buffer);
close_chain_status = storage_cert_chain_close(cert_chain_h, STORAGE_ITEM_PREFIX_KCM);
if (close_chain_status != KCM_STATUS_SUCCESS) {
tr_error("Failed closing certificate chain error (%u)", close_chain_status);
// modify return status only if function succeed but we failed for storage_cert_chain_close
res = -1;
}
return res;
}
/*******************************************************************************
* Code
******************************************************************************/
int mcc_atca_credentials_init(void)
{
int res = 0;
/*The function decompresses SE device certificate chain and stores is to the device storage.*/
res = mcc_decompress_device_cert_chain();
if (res != 0) {
tr_error("mcc_decompress_device_cert_chain failed");
}
return res;
}
#endif // MBED_CONF_APP_SECURE_ELEMENT_ATCA_SUPPORT
|
the_stack_data/47860.c | #include <stdio.h>
#include <assert.h>
// SCALE 16
// 1010 1010 1010 1010 . 1010 1010 1010 1010
//
// SCALE 8
// 1010 1010 1010 1010 1010 1010 . 1010 1010
//
// SCALE 24
// 1010 1010 . 1010 1010 1010 1010 1010 1010
#define SCALE 16
#define FRACTION_MASK (0xffffffff >> (32 - SCALE))
#define WHOLE_MASK (0xffffffff ^ FRACTION_MASK)
int double_to_fixed(double x) {
return (x * (double)(1 << SCALE));
}
double fixed_to_double(int x) {
return ((double)x / (double)(1 << SCALE));
}
int int_to_fixed(int x) {
return x << SCALE;
}
int fixed_to_int(int x) {
return x >> SCALE;
}
int fraction_part(int x) {
assert(x >= 0);
return x & FRACTION_MASK;
}
int whole_part(int x) {
assert(x >= 0);
return x & WHOLE_MASK;
}
int main() {
int f1 = double_to_fixed(5.6);
int f2 = double_to_fixed(7.9);
int f3 = double_to_fixed(27.6789);
printf("%lf + %lf = %lf\n", fixed_to_double(f1), fixed_to_double(f2), fixed_to_double(f1 + f2));
printf("%lf - %lf = %lf\n", fixed_to_double(f1), fixed_to_double(f2), fixed_to_double(f1 - f2));
printf("Fractional Part: %lf\n", fixed_to_double(fraction_part(f1)));
printf("Fractional Part: %lf\n", fixed_to_double(fraction_part(f3)));
printf("Whole Part: %lf\n", fixed_to_double(whole_part(f3)));
printf("Min Number: %lf\n", fixed_to_double(1));
}
|
the_stack_data/100141793.c |
#include<stdio.h>
#include<math.h>
int main()
{
float a, b, c, discriminant, real;
double r1, r2, imag;
printf("Enter coefficients a, b and c: ");
scanf("%f%f%f", &a, &b, &c);
discriminant = b * b - 4 * a * c;
if (discriminant > 0)
{
r1 = (-b + sqrt(discriminant)) / (2 * a);
r2 = (-b - sqrt(discriminant)) / (2 * a);
printf("Roots are: %.2f and %.2f", r1, r2);
}
else if (discriminant == 0)
{
r1 = r2 = -b / (2 * a);
printf("Roots are: %.2f and %.2f",r1, r2);
}
else
{
real = -b / (2 * a);
imag = sqrt(-discriminant) / (2 * a);
printf("Roots : %.2f+%.2fi and %.2f-%.2fi", real, imag, real, imag);
}
return 0;
}
/*Program to find the roots of a quadratic equation.
if else
day_12*/
|
the_stack_data/145452536.c | /****************************************************************
Copyright (C) 1997 Lucent Technologies
All Rights Reserved
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 Lucent or any of its entities
not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES 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.
****************************************************************/
#include <stdio.h>
FILE *Stderr = 0;
#ifdef __cplusplus
extern "C" void Stderr_init_ASL(void);
#endif
#ifdef _WIN32
/* In the MS Windows world, we must jump through */
/* extra hoops in case we're just in a .dll, e.g., */
/* if we're used in a MATLAB mex function. */
#include <windows.h>
#include <io.h> /* for _open_osfhandle() */
#include <fcntl.h> /* for _O_TEXT */
#include "arith.h" /* for LONG_LONG_POINTERS */
#ifdef LONG_LONG_POINTERS
#define Long long long
#else
#define Long long
#endif
void
Stderr_init_ASL(void)
{
HANDLE h;
int ih;
AllocConsole(); /* fails if unnecessary */
h = GetStdHandle(STD_OUTPUT_HANDLE);
ih = _open_osfhandle((Long)h, _O_TEXT);
if (ih == -1)
Stderr = fopen("con","w");
else
Stderr = _fdopen(ih, "w");
}
#else /*!_WIN32*/
#ifndef STDERR
#define STDERR stderr
#endif
#ifdef __cplusplus
extern "C" void Stderr_init_ASL(void);
#endif
void
Stderr_init_ASL(void)
{ Stderr = STDERR; }
#endif /*WIN32*/
|
the_stack_data/234517444.c | #include <stdio.h>
int main()
{
int a, n, l, i, j, temp, min, t;
scanf("%d %d", &n, &l);
int ara[n];
for(i=0; i<n; i++)
{
scanf(" %d", &ara[i]);
}
for(i=0; i<n; i++)
{
min=ara[i];
a=i;
for(j=i+1; j<n; j++)
{
if(ara[j]<min)
{
min=ara[j];
a=j;
}
}
temp = ara[i];
ara[i]=ara[a];
ara[a]=temp;
}
t=0;
if(2*ara[0]>t) t=2*ara[0];
if(2*(l-ara[n-1])> t) t= 2*(l-ara[n-1]);
for(i=0; i<n-1; i++)
{
if((ara[i+1]-ara[i])>t) t=(ara[i+1]-ara[i]);
}
printf("%.9f\n", (double)t/2.0);
return 0;
}
|
the_stack_data/641952.c | #include <stdlib.h>
extern char _bssend[];
static char *sbrk_ptr = _bssend;
void *
malloc(size_t sz)
{
void *r;
r = sbrk_ptr;
sz = (sz + 15) & ~15; // round up
sbrk_ptr += sz;
return r;
}
|
the_stack_data/190769047.c | /*
* An implementation of key value pair (KVP) functionality for Linux.
*
* Linux on Hyper-V and Azure Test Code, ver. 1.0.0
* Copyright (c) Microsoft Corporation
*
* All rights reserved.
* 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
*
* THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
* ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR
* PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*
* Authors:
* K. Y. Srinivasan <kys@microsoft.com>
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/poll.h>
#include <sys/utsname.h>
#include <linux/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <arpa/inet.h>
//#include <linux/connector.h>
//#include "../include/linux/hyperv.h"
#include <linux/netlink.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <syslog.h>
#include <sys/stat.h>
#include <fcntl.h>
#define HV_KVP_EXCHANGE_MAX_KEY_SIZE 512
#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE 2048
struct kvp_record {
__u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
__u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
};
static void kvp_acquire_lock(int fd)
{
struct flock fl = {F_RDLCK, SEEK_SET, 0, 0, 0};
fl.l_pid = getpid();
if (fcntl(fd, F_SETLKW, &fl) == -1) {
perror("fcntl lock");
exit(-1);
}
}
static void kvp_release_lock(int fd)
{
struct flock fl = {F_UNLCK, SEEK_SET, 0, 0, 0};
fl.l_pid = getpid();
if (fcntl(fd, F_SETLK, &fl) == -1) {
perror("fcntl unlock");
exit(-1);
}
}
/*
* Retrieve the records from a specific pool.
*
* pool: specific pool to extract the records from.
* buffer: Client allocated memory for reading the records to.
* num_records: On entry specifies the size of the buffer; on exit this will
* have the number of records retrieved.
* more_records: set to non-zero to indicate that there are more records in the pool
* than could be retrieved. This indicates that the buffer was too small to
* retrieve all the records.
*/
int kvp_read_records(int pool, struct kvp_record *buffer, int *num_records,
int *more_records)
{
int fd;
int error = 0;
FILE *filep;
size_t records_read;
__u8 fname[50];
sprintf(fname, "/var/lib/hyperv/.kvp_pool_%d", pool);
fd = open(fname, S_IRUSR);
if (fd == -1) {
perror("Open failed");
return 1;
}
filep = fopen(fname, "r");
if (!filep) {
close (fd);
perror("fopen failed");
return 1;
}
kvp_acquire_lock(fd);
records_read = fread(buffer, sizeof(struct kvp_record),
*num_records,
filep);
kvp_release_lock(fd);
if (ferror(filep)) {
error = 1;
goto done;
}
if (!feof(filep))
*more_records = 1;
*num_records = records_read;
done:
close (fd);
fclose(filep);
return error;
}
/*
* Append a record to a specific pool.
*
* pool: specific pool to append the record to.
*
* key: key in the record
* key_size: size of the key
*
* value: value in the record
* value_size: size of the value string
*/
int kvp_append_record(int pool, __u8 *key, int key_size,
__u8 *value, int value_size)
{
int fd;
FILE *filep;
__u8 fname[50];
struct kvp_record write_buffer;
memcpy(write_buffer.key, key, key_size);
memcpy(write_buffer.value, value, value_size);
sprintf(fname, "/var/lib/hyperv/.kvp_pool_%d", pool);
fd = open(fname, S_IRUSR);
if (fd == -1) {
perror("Open failed");
return 1;
}
filep = fopen(fname, "a");
if (!filep) {
close (fd);
perror("fopen failed");
return 1;
}
kvp_acquire_lock(fd);
fwrite(&write_buffer, sizeof(struct kvp_record),
1, filep);
kvp_release_lock(fd);
close (fd);
fclose(filep);
return 0;
}
/*
* Delete a record from a specific pool.
*
* pool: specific pool to delete the record from.
* key: key in the record
*
*/
int kvp_delete_record(int pool, __u8 *key)
{
int fd;
FILE *filep;
__u8 fname[50];
int i;
int more;
int num_records = 200;
struct kvp_record my_records[200];
if (kvp_key_exists(pool, key) != 0) {
return 0;
}
if (kvp_read_records(pool, my_records, &num_records, &more)) {
printf("kvp_read_records failed\n");
exit(-1);
}
sprintf(fname, "/var/lib/hyperv/.kvp_pool_%d", pool);
fd = open(fname, S_IRUSR);
if (fd == -1) {
perror("Open failed");
return 1;
}
kvp_acquire_lock(fd);
filep = fopen(fname, "w");
if (!filep) {
close (fd);
perror("fopen failed");
return 1;
}
kvp_release_lock(fd);
close (fd);
fclose(filep);
for (i = 0; i < num_records; i++) {
if (strcmp(my_records[i].key, key) != 0) {
kvp_append_record(pool, my_records[i].key, strlen(my_records[i].key),
my_records[i].value, strlen(my_records[i].value));
}
}
/* Fixme: should check "more" and append additional if needed */
return 0;
}
/*
* Confirm a record exists in a specific pool.
*
* pool: specific pool to delete the record from.
* key: key in the record
*
*/
int kvp_key_exists(int pool, __u8 *key)
{
int i;
int more;
int num_records = 200;
struct kvp_record my_records[200];
if (kvp_read_records(pool, my_records, &num_records, &more)) {
printf("kvp_read_records failed\n");
exit(-1);
}
for (i = 0; i < num_records; i++) {
if (strcmp(my_records[i].key, key) == 0) {
return 0;
}
}
/* Fixme: should check "more" */
return 1;
}
struct kvp_record my_records[200];
main(int argc, char *argv[])
{
int error;
int more;
int i, j;
int num_records = 200;
int pool = 0;
char *key, *value;
if (argc > 1 && strcmp(argv[1], "append") == 0) { /* Append a key-value */
if (argc < 5) {
printf("Usage: %s append <pool> <key> <value>\n", argv[0]);
exit(0);
}
pool = atoi(argv[2]);
key = argv[3];
value = argv[4];
if (kvp_key_exists(pool, key) == 0) {
kvp_delete_record(pool, key);
}
if (kvp_append_record(pool, key, strlen(key)+1,
value, strlen(value)+1) != 0) {
printf("Error: kvp_append_record() returned non-zero\n");
}
}
else {
for (i = 0; i < 5; i++) {
if (argc > 1) {
pool = atoi(argv[1]);
if (i != pool) {
continue;
}
}
num_records = 200;
if (kvp_read_records(i, my_records, &num_records, &more)) {
printf("kvp_read_records failed\n");
exit(-1);
}
printf("Pool is %d\n", i);
printf("Num records is %d\n", num_records);
if (more)
printf("More records available\n");
for (j = 0; j < num_records; j++)
printf("Key: %s; Value: %s\n", my_records[j].key, my_records[j].value);
}
}
}
|
the_stack_data/92324479.c | //------------------------------------------------------------------------------
// Simple JITing of code into memory.
//
// This example doesn't actually use libjit - it's much more basic.
//
// Eli Bendersky (eliben@gmail.com)
// This code is in the public domain
//------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
// Allocates RWX memory of given size and returns a pointer to it. On failure,
// prints out the error and returns NULL.
void* alloc_executable_memory(size_t size) {
void* ptr = mmap(0, size,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (ptr == (void*)-1) {
perror("mmap");
return NULL;
}
return ptr;
}
// Allocates RW memory of given size and returns a pointer to it. On failure,
// prints out the error and returns NULL. mmap is used to allocate, so
// deallocation has to be done with munmap, and the memory is allocated
// on a page boundary so it's suitable for calling mprotect.
void* alloc_writable_memory(size_t size) {
void* ptr = mmap(0, size,
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (ptr == (void*)-1) {
perror("mmap");
return NULL;
}
return ptr;
}
// Sets a RX permission on the given memory, which must be page-aligned. Returns
// 0 on success. On failure, prints out the error and returns -1.
int make_memory_executable(void* m, size_t size) {
if (mprotect(m, size, PROT_READ | PROT_EXEC) == -1) {
perror("mprotect");
return -1;
}
return 0;
}
// Emits code into the given memory, assuming enough was allocated. Returns the
// number of bytes emitted.
size_t emit_code_into_memory(unsigned char* m) {
unsigned char code[] = {
0x48, 0x89, 0xf8, // mov %rdi, %rax
0x48, 0x83, 0xc0, 0x04, // add $4, %rax
0xc3 // ret
};
memcpy(m, code, sizeof(code));
return sizeof(code);
}
const size_t SIZE = 1024;
typedef long (*JittedFunc)(long);
// Allocates RWX memory directly.
void run_from_rwx() {
void* m = alloc_executable_memory(SIZE);
size_t n = emit_code_into_memory(m);
const char* filename = "/tmp/jitout.bin";
FILE* outfile = fopen(filename, "wb");
if (outfile) {
if (fwrite(m, 1, n, outfile) == n) {
printf("Successfully emitted binary to %s\n", filename);
}
fclose(outfile);
}
JittedFunc func = m;
int result = func(2);
printf("result = %d\n", result);
}
// Allocates RW memory, emits the code into it and sets it to RX before
// executing.
void emit_to_rw_run_from_rx() {
void* m = alloc_writable_memory(SIZE);
emit_code_into_memory(m);
make_memory_executable(m, SIZE);
JittedFunc func = m;
int result = func(2);
printf("result = %d\n", result);
}
int main(int argc, char** argv) {
run_from_rwx();
emit_to_rw_run_from_rx();
return 0;
}
|
the_stack_data/127793.c | /*
*
* Jesse Deaton
*
* Be free of petty math problems:
* use this to reduce fractions.
*
* September, 2015
*
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if(argc < 3){
printf("Usage: %s [numerator] [denominator]\n", argv[0]);
return EXIT_FAILURE;
}
int num = atoi(argv[1]);
int denom = atoi(argv[2]);
for(int i = 2; i <= num; i++)
if(num % i == 0 && denom % i == 0){
num = num / i;
denom = denom / i;
i = 2;
}
printf(" %d\n---\n %d\n", num, denom);
return 0;
}
|
the_stack_data/148579344.c | #include <stdio.h>
#include <spawn.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
int main()
{
int ret_err = 0;
pid_t pid_child;
char buf_err[64];
posix_spawn_file_actions_t posix_faction;
char *argv_child[] = { "forkexec_child", NULL };
printf("Parent[%d]: Start\n", getpid());
if ((ret_err = posix_spawn_file_actions_init(&posix_faction)) != 0)
{
strerror_r(ret_err, buf_err, sizeof(buf_err));
fprintf(stderr, "Fail: file_actions_addopen: %s\n", buf_err);
exit(EXIT_FAILURE);
}
if ((ret_err = posix_spawn_file_actions_addopen(&posix_faction,
3, "pspawn.log", O_WRONLY | O_CREAT | O_APPEND, 0664)) != 0)
{
strerror_r(ret_err, buf_err, sizeof(buf_err));
fprintf(stderr, "Fail: file_actions_addopen: %s\n", buf_err);
exit(EXIT_FAILURE);
}
ret_err = posix_spawn( &pid_child,
argv_child[0],
&posix_faction,
NULL,
argv_child,
NULL);
if ((ret_err = posix_spawn_file_actions_destroy(&posix_faction)) != 0)
{
strerror_r(ret_err, buf_err, sizeof(buf_err));
fprintf(stderr, "Fail: file_actions_destroy: %s\n", buf_err);
exit(EXIT_FAILURE);
}
printf("Parent[%d]: Wait for child(%d) \n", getpid(), (int)pid_child);
(void)wait(NULL);
printf("Parent[%d]: Exit\n", getpid());
return 0;
}
|
the_stack_data/82949798.c | /**
* @file pivotFirst.c Code to select leftmost element as pivot index
* @brief
* Given array vals[left,right] select left as the pivot index.
*
*
* @author George Heineman
* @date 6/15/08
*/
/**
* Select pivot index to use in partition. Select the leftmost one.
*
* \param vals the array of elements.
* \param left the left end of the subarray range
* \param right the right end of the subarray range
* \return int in the range [left, right] to use in partition.
*/
int selectPivotIndex (void **vals, int left, int right) {
return left;
}
|
the_stack_data/139557.c | // filename : main.c
// 参考:http://blog.sina.com.cn/s/blog_40ac9d43010179iq.html
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int GetPidByCmdline(const char *cmd)
{
DIR *dir;
struct dirent *ptr;
FILE *fp;
//大小随意,能装下cmdline文件的路径即可, 但是最好超过270,否则编译第31行会有警告。
char filepath[270];
//大小随意,能装下要识别的命令行文本即可
char filetext[256];
dir = opendir("/proc"); //打开路径
if (NULL != dir) {
//循环读取路径下的每一个文件/文件夹
while ((ptr = readdir(dir)) != NULL) {
//如果读取到的是"."或者".."则跳过
if ((strcmp(ptr->d_name, ".") == 0) ||
(strcmp(ptr->d_name, "..") == 0))
continue;
//读取到的不是文件夹名字也跳过
if (DT_DIR != ptr->d_type)
continue;
//生成要读取的文件的路径
sprintf(filepath, "/proc/%s/cmdline", ptr->d_name);
fp = fopen(filepath, "r"); //打开文件
if (NULL != fp) {
fread(filetext, 1, 50, fp); //读取文件
//给读出的内容加上字符串结束符
filetext[255] = '\0';
//如果文件内容满足要求则打印路径的名字(即进程的PID)
if (filetext == strstr(filetext, cmd)) {
int pid = atoi(ptr->d_name);
printf("cmd:\'%s\', PID:%d\n", cmd, pid);
return pid;
}
fclose(fp);
}
}
}
printf("cmd:\'%s\', no such process.\n", cmd);
return 0;
}
void main()
{
char cmd[] = "./test";
int pid = GetPidByCmdline(cmd);
} |
the_stack_data/1161248.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <regex.h>
#include <math.h>
#include <float.h>
#include <stdbool.h>
#include <ctype.h>
#define STATUS_OK 0
#define STATUS_ERROR 1
#define STATUS_EMPTY_LINE 2
#define STATUS_EOF 3
#define LINE_BUF_SIZE 20480
struct SOM {
int rows;
int cols;
int input_dims;
float * data;
};
struct SOMTrainingParams {
int iterations;
float learn_rate_initial;
float learn_rate_final;
float n_radius_initial;
float n_radius_final;
};
struct SOM create_SOM(int rows, int cols, int input_dims) {
struct SOM result;
result.rows = rows;
result.cols = cols;
result.input_dims = input_dims;
result.data = (float *)malloc(sizeof(float) * input_dims * rows * cols);
return result;
}
struct SOMTrainingParams create_SOMTrainingParams() {
struct SOMTrainingParams result;
result.iterations = 1000;
result.learn_rate_initial = 0.10;
result.learn_rate_final = 0.01;
result.n_radius_initial = 5.0;
result.n_radius_final = 2.0;
return result;
}
void free_SOM(struct SOM som) {
free(som.data);
}
int get_num_weight_elements(struct SOM som) {
return som.rows * som.cols * som.input_dims;
}
// Returns a pointer to the start of a particular neuron's weight vector
float * get_neuron_weight_vector(struct SOM som, int index) {
return &som.data[index * som.input_dims];
}
int save_SOM(struct SOM som, char* filepath) {
FILE *f = fopen(filepath, "w");
if (f == NULL) {
printf("Error opening file: %s\n", filepath);
return STATUS_ERROR;
}
fprintf(f, "%d,%d,%d\n", som.rows, som.cols, som.input_dims);
for (int i=0; i < get_num_weight_elements(som); ++i) {
fprintf(f, "%f", som.data[i]);
// Each neuron's weight matrix on a new line
if ((i+1) % som.input_dims == 0)
fprintf(f, "\n");
else
fprintf(f, ",");
}
printf("Saved SOM to \"%s\"\n", filepath);
fclose(f);
return STATUS_OK;
}
int load_SOM(struct SOM * som, char* filepath) {
FILE *f = fopen(filepath, "r");
if (f == NULL) {
printf("Error opening file: %s\n", filepath);
return STATUS_ERROR;
}
// Treat first line separately
char c;
char buf[100];
int ptr = 0;
while ((c = fgetc(f)) != '\n') {
buf[ptr++] = c;
}
buf[ptr] = '\0';
sscanf(buf, "%d,%d,%d", &(som->rows), &(som->cols), &(som->input_dims));
// Rest of file is just weight element data
ptr = 0;
int weight_element_ptr = 0;
while ((c = fgetc(f)) != EOF) {
//printf("%c", c);
if (weight_element_ptr >= get_num_weight_elements(*som)) {
printf("ERROR: number of weight elements exceeds expected amount\n");
return STATUS_ERROR;
}
if (c == ',' || c == '\n') {
buf[ptr] = '\0';
ptr = 0;
sscanf(buf, "%f", &(som->data[weight_element_ptr++]));
}
else {
buf[ptr++] = c;
}
}
if (weight_element_ptr != get_num_weight_elements(*som)) {
printf("ERROR: wrong number of weight elements\n");
return STATUS_ERROR;
}
fclose(f);
return STATUS_OK;
}
bool is_line_empty(const char *s) {
while (*s != '\0') {
if (!isspace((unsigned char)*s))
return false;
s++;
}
return true;
}
int read_input_file_line(FILE *fp, char * line) {
size_t buf_size = LINE_BUF_SIZE;
ssize_t num_chars_read = getline(&line, &buf_size, fp);
if (num_chars_read == -1) {
return STATUS_EOF;
}
else if (is_line_empty(line)) {
return STATUS_EMPTY_LINE;
}
else {
return STATUS_OK;
}
}
int parse_input_line(char * line, int class_index, float * vector, int dims) {
char * token = strtok(line, ",");
int token_index = 0;
int vec_index = 0;
while(token != NULL) {
//printf("index %d, token: %s\n", token_index, token);
if (token_index != class_index) {
vector[vec_index++] = atof(token);
}
token = strtok(NULL, ",");
token_index++;
}
return STATUS_OK;;
}
float euclidean_distance(float * vec_a, float * vec_b, int dims) {
float sum_of_squares = 0;
for (int i=0; i < dims; ++i) {
sum_of_squares += powf(vec_a[i] - vec_b[i], 2.0);
}
return sqrtf(sum_of_squares);
}
// Computes b - a as vectors
void calc_vector_difference(float * a, float * b, float * out, int len) {
for (int i=0; i < len; ++i) {
out[i] = b[i] - a[i];
}
}
void do_vector_add(float * a, float * b, float * out, int len) {
for (int i=0; i < len; ++i) {
out[i] = a[i] + b[i];
}
}
void do_scalar_vector_mul(float c, float * vec, float * out, int len) {
for (int i=0; i < len; ++i) {
out[i] = c * vec[i];
}
}
int find_bmu(struct SOM som, float * input_vec) {
int num_neurons = som.rows * som.cols;
int best_match = 0;
float best_dist = FLT_MAX;
for (int i=0; i < num_neurons; ++i) {
float dist = euclidean_distance(input_vec, get_neuron_weight_vector(som, i), som.input_dims);
//printf("neuron %d, dist %f\n", i, dist);
if (dist < best_dist) {
best_dist = dist;
best_match = i;
}
}
//printf("bmu is %d\n", best_match);
//printf("best dist is %f\n", best_dist);
return best_match;
}
float neighbourhood_function(float dist, float r) {
float e = (float)M_E;
return powf(e, -0.5 * powf(dist / r, 2));
}
float neuron_distance(struct SOM som, int n1, int n2) {
int n1_row = n1 / som.cols;
int n1_col = n1 % som.cols;
int n2_row = n2 / som.cols;
int n2_col = n2 % som.cols;
float n1_coords[2] = {n1_row, n1_col};
float n2_coords[2] = {n2_row, n2_col};
return euclidean_distance(n1_coords, n2_coords, 2);
}
float neuron_neighbourhood_function(struct SOM som, int n1, int n2, float n_radius) {
float dist = neuron_distance(som, n1, n2);
return neighbourhood_function(dist, n_radius);
}
float linear_blend(float start, float end, float pct) {
return start + (end - start) * pct;
}
float get_linear_blend(float start, float end, float middle) {
return (middle - start) / (end - start);
}
// Adds vec * scalar to the given neuron's weight matrix
void adjust_neuron_weight_vector(struct SOM som, int neuron, float * vec, float scalar) {
float vec_scaled[som.input_dims];
float * weight_vec = get_neuron_weight_vector(som, neuron);
do_scalar_vector_mul(scalar, vec, vec_scaled, som.input_dims);
do_vector_add(weight_vec, vec_scaled, weight_vec, som.input_dims);
}
void adjust_weights(struct SOM som, float * input_vec, int bmu, float learn_rate, float n_radius) {
int num_neurons = som.rows * som.cols;
float neighbour_value;
float delta_vec[som.input_dims];
float * bmu_vec = get_neuron_weight_vector(som, bmu);
float * other_vec;
calc_vector_difference(bmu_vec, input_vec, delta_vec, som.input_dims);
for (int neuron=0; neuron < num_neurons; neuron++) {
neighbour_value = neuron_neighbourhood_function(som, bmu, neuron, n_radius);
// TODO: neighbour value cutoff?
adjust_neuron_weight_vector(som, neuron, delta_vec, learn_rate * neighbour_value);
}
}
void find_normalize_minima_maxima(
char * train_file,
int train_file_class_index,
int input_dims,
float * normalize_minima,
float * normalize_maxima
) {
printf("find_normalize_minima_maxima %s, %d, %d", train_file, train_file_class_index, input_dims);
FILE *fp = fopen(train_file, "r");
if (fp == NULL) {
printf("Error opening file: %s\n", train_file);
return;
}
for (int i = 0; i < input_dims; i++) {
normalize_minima[i] = FLT_MAX;
normalize_maxima[i] = -FLT_MAX;
}
int status;
float input_vector[input_dims];
while (true) {
char * input_line_buf = (char *)malloc(LINE_BUF_SIZE);
status = read_input_file_line(fp, input_line_buf);
if (status == STATUS_EMPTY_LINE) {
printf("WARNING empty line\n");
continue;
}
else if (status == STATUS_EOF)
break;
else {
parse_input_line(input_line_buf, train_file_class_index, input_vector, input_dims);
for (int i = 0; i < input_dims; i++) {
if (input_vector[i] < normalize_minima[i])
normalize_minima[i] = input_vector[i];
else if (input_vector[i] > normalize_maxima[i])
normalize_maxima[i] = input_vector[i];
}
}
free(input_line_buf);
}
}
void normalize_input_vector(int dims, float * input_vector, float * normalize_minima, float * normalize_maxima) {
for (int i=0; i < dims; ++i) {
float min = normalize_minima[i];
float max = normalize_maxima[i];
if (min == max)
input_vector[i] = min;
else
input_vector[i] = get_linear_blend(min, max, input_vector[i]);
}
}
void denormalize_neuron_weight_vector(
struct SOM som,
int neuron,
float * normalize_minima,
float * normalize_maxima
) {
float * weight_vec = get_neuron_weight_vector(som, neuron);
for (int i = 0; i < som.input_dims; i++) {
float min = normalize_minima[i];
float max = normalize_maxima[i];
weight_vec[i] = linear_blend(min, max, weight_vec[i]);
}
}
void denormalize_som(struct SOM som, float * normalize_minima, float * normalize_maxima) {
int num_neurons = som.rows * som.cols;
for (int i = 0; i < num_neurons; i++) {
denormalize_neuron_weight_vector(som, i, normalize_minima, normalize_maxima);
}
}
// Expects CSV of floats as file format
// If classes are included then the index can be specified and it will be ignored
void train_SOM(
struct SOM som,
struct SOMTrainingParams params,
int phase,
char * train_filepath,
int train_file_class_index,
bool normalize_inputs,
float * normalize_minima, // min values of each input dimension
float * normalize_maxima // max values of each input dimension
)
{
printf("===== TRAINING Phase %d =====\n", phase);
FILE *fp = fopen(train_filepath, "r");
if (fp == NULL) {
printf("Error opening file: %s\n", train_filepath);
return;
}
float input_vector[som.input_dims];
char * input_line_buf = (char *)malloc(LINE_BUF_SIZE);
int iteration = 0;
int file_rewinds = 0;
for (int i=0; (iteration = i-file_rewinds) < params.iterations; ++i) {
float progress;
if (params.iterations == 1)
progress = 0;
else
progress = iteration/(float)(params.iterations-1);
int status = read_input_file_line(fp, input_line_buf);
if (status == STATUS_ERROR) {
printf("ERROR: Could not read input file\n");
break;
}
else if (status == STATUS_EMPTY_LINE) {
printf("Skipping empty line in input file...\n");
continue;
}
else if (status == STATUS_EOF) {
// If we get to the end of the input file then cycle back to the beginning and read a new line
rewind(fp);
file_rewinds++;
//printf("Rewinding input file...\n");
continue;
}
assert(status == STATUS_OK);
parse_input_line(input_line_buf, train_file_class_index, input_vector, som.input_dims);
if (normalize_inputs)
normalize_input_vector(som.input_dims, input_vector, normalize_minima, normalize_maxima);
float learn_rate = linear_blend(params.learn_rate_initial,
params.learn_rate_final, progress);
float n_radius = linear_blend(params.n_radius_initial,
params.n_radius_final, progress);
if (iteration % 100 == 0)
printf("Progress: %0.1f%%, Iteration %d, learn_rate %f, n_radius %f\r",
progress*100, iteration, learn_rate, n_radius);
int bmu = find_bmu(som, input_vector);
adjust_weights(som, input_vector, bmu, learn_rate, n_radius);
}
free(input_line_buf);
fclose(fp);
printf("\n\n");
}
float rand_float_range(float min, float max) {
float scale = rand() / (float) RAND_MAX; /* [0, 1.0] */
return min + scale * (max - min); /* [min, max] */
}
void randomize_weight_vectors(struct SOM som, float min, float max) {
for (int i=0; i < get_num_weight_elements(som); ++i) {
som.data[i] = rand_float_range(min, max);
}
}
void equalize_weight_vectors(struct SOM som, float value) {
for (int i=0; i < get_num_weight_elements(som); ++i) {
som.data[i] = value;
}
}
// Distribute each weight linearly across the range of inputs for each dimension
void intelligently_randomize_weight_vectors(
struct SOM som,
char * input_file,
int input_file_class_index)
{
FILE *fp = fopen(input_file, "r");
if (fp == NULL) {
printf("Error opening file: %s\n", input_file);
return;
}
float min_values[som.input_dims];
float max_values[som.input_dims];
for (int i=0; i < som.input_dims; ++i) {
min_values[i] = FLT_MAX;
max_values[i] = FLT_MIN;
}
float input_vector[som.input_dims];
char * input_line_buf = (char *)malloc(LINE_BUF_SIZE);
int status;
while ((status = read_input_file_line(fp, input_line_buf)) == STATUS_OK) {
parse_input_line(input_line_buf, input_file_class_index, input_vector, som.input_dims);
for (int i=0; i < som.input_dims; ++i) {
float x = input_vector[i];
if (x < min_values[i]) {
min_values[i] = x;
}
if (x > max_values[i]) {
max_values[i] = x;
}
}
}
int num_neurons = som.rows * som.cols;
for (int n=0; n < num_neurons; ++n) {
float * weight_vector = get_neuron_weight_vector(som, n);
for (int i=0; i < som.input_dims; ++i) {
weight_vector[i] = rand_float_range(min_values[i], max_values[i]);
}
}
free(input_line_buf);
fclose(fp);
}
void print_neuron_weights(struct SOM som, int neuron) {
float * weight_vec = get_neuron_weight_vector(som, neuron);
for (int i=0; i < som.input_dims; ++i) {
printf("%f, ", weight_vec[i]);
}
printf("\n");
}
void print_vector(float * vec, int dims) {
printf("(");
for (int i = 0; i < dims; i++) {
printf("%.2f", vec[i]);
if (i != dims - 1) {
printf(", ");
}
}
printf(")");
}
int main(int argc, char** argv) {
int opt_rows = 10;
int opt_cols = 10;
int opt_input_dims = 3;
int opt_train_file_class_index = -1; // the index of the class for each pattern, if used
char opt_train_file[128] = "data/default_train_file.txt";
char opt_save_file[128] = "trained/default_save_file.som";
char opt_weight_init_method[128] = "intelligent";
float opt_weight_equalize_val = 0.0;
float opt_weight_randomize_min = -1.0;
float opt_weight_randomize_max = 1.0;
bool opt_normalize_inputs = false;
// Training happens in two phases, p1 is loose and p2 is tight
struct SOMTrainingParams p1_params = create_SOMTrainingParams();
struct SOMTrainingParams p2_params = create_SOMTrainingParams();
for (int i=0; i < argc; ++i) {
char * opt = argv[i];
char * arg;
if (opt[0] == '-' && opt[1] == '-') {
// It's an option so it must be followed by an argument
assert(argc > i);
}
if (i + 1 < argc) {
arg = argv[i+1];
}
if (strcmp(opt, "--rows") == 0) {
opt_rows = atoi(arg);
}
else if (strcmp(opt, "--cols") == 0) {
opt_cols = atoi(arg);
}
else if (strcmp(opt, "--input-dims") == 0) {
opt_input_dims = atoi(arg);
}
else if (strcmp(opt, "--train") == 0) {
strcpy(opt_train_file, arg);
}
else if (strcmp(opt, "--train-file-class-index") == 0) {
opt_train_file_class_index = atoi(arg);
}
else if (strcmp(opt, "--save") == 0) {
strcpy(opt_save_file, arg);
}
else if (strcmp(opt, "--weight-init-method") == 0) {
strcpy(opt_weight_init_method, arg);
}
else if (strcmp(opt, "--weight-equalize-val") == 0) {
opt_weight_equalize_val = atof(arg);
}
else if (strcmp(opt, "--weight-randomize-min") == 0) {
opt_weight_randomize_min = atof(arg);
}
else if (strcmp(opt, "--weight-randomize-max") == 0) {
opt_weight_randomize_max = atof(arg);
}
else if (strcmp(opt, "--normalize-inputs") == 0) {
opt_normalize_inputs = true;
}
else if (strcmp(opt, "--p1-iterations") == 0) {
p1_params.iterations = atoi(arg);
}
else if (strcmp(opt, "--p2-iterations") == 0) {
p2_params.iterations = atoi(arg);
}
else if (strcmp(opt, "--p1-learn-rate-initial") == 0) {
p1_params.learn_rate_initial = atof(arg);
}
else if (strcmp(opt, "--p2-learn-rate-initial") == 0) {
p2_params.learn_rate_initial = atof(arg);
}
else if (strcmp(opt, "--p1-learn-rate-final") == 0) {
p1_params.learn_rate_final = atof(arg);
}
else if (strcmp(opt, "--p2-learn-rate-final") == 0) {
p2_params.learn_rate_final = atof(arg);
}
else if (strcmp(opt, "--p1-n-radius-initial") == 0) {
p1_params.n_radius_initial = atof(arg);
}
else if (strcmp(opt, "--p2-n-radius-initial") == 0) {
p2_params.n_radius_initial = atof(arg);
}
else if (strcmp(opt, "--p1-n-radius-final") == 0) {
p1_params.n_radius_final = atof(arg);
}
else if (strcmp(opt, "--p2-n-radius-final") == 0) {
p2_params.n_radius_final = atof(arg);
}
}
printf("Set rows: %d\n", opt_rows);
printf("Set input_dims: %d\n", opt_input_dims);
printf("Set cols: %d\n", opt_cols);
printf("Set train file: \"%s\"\n", opt_train_file);
printf("Set train file class index to: %d\n", opt_train_file_class_index);
printf("Set save file: \"%s\"\n", opt_save_file);
printf("Set weight init method: %s\n", opt_weight_init_method);
printf("Set weight equalize val: %f\n", opt_weight_equalize_val);
printf("Set weight randomize min: %f\n", opt_weight_randomize_min);
printf("Set weight randomize max: %f\n", opt_weight_randomize_max);
printf("Set p1 iterations: %d\n", p1_params.iterations);
printf("Set p2 iterations: %d\n", p2_params.iterations);
printf("Set p1 learn_rate_initial: %f\n", p1_params.learn_rate_initial);
printf("Set p2 learn_rate_initial: %f\n", p2_params.learn_rate_initial);
printf("Set p1 learn_rate_final: %f\n", p1_params.learn_rate_final);
printf("Set p2 learn_rate_final: %f\n", p2_params.learn_rate_final);
printf("Set p1 n_radius_initial: %f\n", p1_params.n_radius_initial);
printf("Set p2 n_radius_initial: %f\n", p2_params.n_radius_initial);
printf("Set p1 n_radius_final: %f\n", p1_params.n_radius_final);
printf("Set p2 n_radius_final: %f\n", p2_params.n_radius_final);
printf("Set normalize inputs: %d\n", opt_normalize_inputs);
printf("\n");
struct SOM som = create_SOM(opt_rows, opt_cols, opt_input_dims);
if (strcmp(opt_weight_init_method, "intelligent") == 0) {
intelligently_randomize_weight_vectors(som, opt_train_file, opt_train_file_class_index);
}
else if (strcmp(opt_weight_init_method, "randomize") == 0) {
randomize_weight_vectors(som, opt_weight_randomize_min, opt_weight_randomize_max);
}
else if (strcmp(opt_weight_init_method, "equalize") == 0) {
equalize_weight_vectors(som, opt_weight_equalize_val);
}
float normalize_minima[opt_input_dims];
float normalize_maxima[opt_input_dims];
if (opt_normalize_inputs) {
find_normalize_minima_maxima(opt_train_file, opt_train_file_class_index, opt_input_dims,
normalize_minima, normalize_maxima);
printf("Normalize minima: ");
print_vector(normalize_minima, opt_input_dims);
printf("\n");
printf("Normalize maxima: ");
print_vector(normalize_maxima, opt_input_dims);
printf("\n");
}
train_SOM(som, p1_params, 1, opt_train_file, opt_train_file_class_index,
opt_normalize_inputs, normalize_minima, normalize_maxima);
train_SOM(som, p2_params, 2, opt_train_file, opt_train_file_class_index,
opt_normalize_inputs, normalize_minima, normalize_maxima);
if (opt_normalize_inputs) {
denormalize_som(som, normalize_minima, normalize_maxima);
}
save_SOM(som, opt_save_file);
return 0;
}
|
the_stack_data/247019259.c | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 100000
int total;
int data[MAX];
int table[27] = {2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,0,7,7,8,8,8,9,9,9,0};
int comp(const void *a, const void *b) {
return (*(int*)a) - (*(int*)b);
}
int mapping(char *s) {
int result, i;
int len = strlen(s);
result = 0;
for (i = 0; i < len; i++) {
if (s[i] == '-' ) continue;
if ('0' <= s[i] && s[i] <= '9')
result = result * 10 + s[i] - '0';
else
result = result * 10 + table[s[i] - 'A'];
}
return result;
}
int main() {
char buf[30];
int cnt, i, nodup;
scanf("%d", &total);
for (i = 0; i < total; i++) {
scanf("%s", buf);
data[i] = mapping(buf);
}
qsort((void*)data, total, sizeof(data[0]),comp);
cnt = 1;
nodup = 1;
for (i = 0; i < total - 1; i++) {
if( data[i] == data[i + 1] )
cnt++;
else {
if ( cnt > 1 ) {
printf("%03d-%04d %d\n", data[i] / 10000, data[i] % 10000, cnt);
nodup = 0;
}
cnt = 1;
}
}
if (nodup)
printf("No duplicates.\n");
return 0;
} |
the_stack_data/17428.c | #include<stdio.h>
int max(int a,int b)
{
return a>b?a:b;
}
int sol(char* s1,char* s2,int n,int m)
{
int dp[n+1][m+1];
for(int i=0;i<=n;i++)
{
for(int j=0;j<=m;j++)
dp[i][j]=0;
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
if(s1[i-1]==s2[j-1])
dp[i][j]=1+dp[i-1][j-1];
else
dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
}
}
return dp[n][m];
}
int main() {
int t;
scanf("%d",&t);
while(t--){
char s1[101],s2[101];
scanf("%s",&s1);
scanf("%s",&s2);
// printf("%s %s\n",s1,s2);
int n=strlen(s1),m=strlen(s2);
int ans=sol(s1,s2,n,m);
printf("%d\n",n+m-ans);
}
return 0;
}
|
the_stack_data/34511715.c | /**
* @file vendor_data.c
*
* @brief Implementation of vendor-specific data handling
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* 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 Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
/*
* Copyright (c) 2014, Atmel Corporation All rights reserved.
*
* Licensed under Atmel's Limited License Agreement --> EULA.txt
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifdef VENDOR_DATA
/* === INCLUDES ============================================================ */
#include <stdio.h>
#include "rf4ce.h"
#include "zrc.h"
#include "vendor_data.h"
/* === MACROS ============================================================== */
/* === EXTERNALS =========================================================== */
FLASH_EXTERN(uint16_t VendorIdentifier);
#ifdef RF4CE_TARGET
extern void vendor_data_confirm(nwk_enum_t Status, uint8_t PairingRef,
profile_id_t ProfileId,
uint8_t Handle
);
#else /* RF4CE_TARGET */
extern void nlme_rx_enable_confirm(nwk_enum_t Status);
static void vendor_data_confirm(nwk_enum_t Status, uint8_t PairingRef,
profile_id_t ProfileId,
uint8_t Handle
);
void vendor_data_ind(uint8_t PairingRef, uint16_t VendorId,
uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality,
uint8_t RxFlags);
#endif /* RF4CE_TARGET */
/* === IMPLEMENTATION ====================================================== */
bool vendor_data_request(uint8_t PairingRef, profile_id_t ProfileId,
uint16_t VendorId, uint8_t nsduLength, uint8_t *nsdu,
uint8_t TxOptions)
{
/* Keep compiler happy */
ProfileId = ProfileId;
return nlde_data_request(PairingRef, PROFILE_ID_ZRC, VendorId,
nsduLength, nsdu, TxOptions,
1,
(FUNC_PTR)vendor_data_confirm
);
}
#ifndef RF4CE_TARGET
void vendor_data_ind(uint8_t PairingRef, uint16_t VendorId,
uint8_t nsduLength, uint8_t *nsdu, uint8_t RxLinkQuality,
uint8_t RxFlags)
{
/* Check if vendor id matches.
* Handle here only vendor data from same vendor */
uint16_t v_id = PGM_READ_WORD(&VendorIdentifier);
if ((VendorId == v_id) && (RxFlags & RX_FLAG_WITH_SEC)) {
switch (nsdu[0]) { /* vendor-specific command id */
case BATTERY_STATUS_REQ:
{
uint16_t voltage = get_batmon_voltage();
nsdu[0] = BATTERY_STATUS_RESP;
nsdu[1] = (uint8_t)voltage; /* LSB */
nsdu[2] = (uint8_t)(voltage >> 8); /* MSB */
nsduLength = 3;
}
break;
case ALIVE_REQ: /* Alive request */
vendor_app_alive_req();
/* Send alive response */
nsdu[0] = ALIVE_RESP;
nsduLength = 1;
break;
case FW_VERSION_REQ:
{
/* Send alive response */
nsdu[0] = FW_VERSION_RESP;
nsdu[1] = FW_VERSION_MAJOR; /* major version number */
nsdu[2] = FW_VERSION_MINOR; /* minor version number */
nsdu[3] = FW_VERSION_REV; /* revision version number */
nsduLength = 4;
}
break;
case RX_ON_REQ:
{
uint32_t duration = 0;
memcpy(&duration, &nsdu[1], 3);
if (!nlme_rx_enable_request(duration,
(FUNC_PTR)nlme_rx_enable_confirm
)) {
/*
* RX enable could not been added to the queue.
* Therefore do not send response message.
*/
return;
}
/* Send response */
nsdu[0] = RX_ON_RESP;
nsduLength = 1;
}
break;
default:
{
/* Send response */
nsdu[0] = FW_DATA_RESP;
nsdu[1] = VD_NOT_SUPPORTED_ATTRIBUTE;
nsduLength = 2;
}
break;
}
/* Transmit response message */
nlde_data_request(PairingRef, PROFILE_ID_ZRC, VendorId,
nsduLength, nsdu,
TXO_UNICAST | TXO_DST_ADDR_NET | TXO_ACK_REQ | TXO_SEC_REQ | TXO_MULTI_CH | TXO_CH_NOT_SPEC | TXO_VEND_SPEC,
1,
(FUNC_PTR)vendor_data_confirm
);
/* Keep compiler happy */
RxLinkQuality = RxLinkQuality;
RxFlags = RxFlags;
}
}
#endif /* #ifndef RF4CE_TARGET */
#ifndef RF4CE_TARGET
static void vendor_data_confirm(nwk_enum_t Status, uint8_t PairingRef,
profile_id_t ProfileId,
uint8_t Handle
)
{
/* Keep compiler happy */
Status = Status;
PairingRef = PairingRef;
Handle = Handle;
ProfileId = ProfileId;
}
#endif
#endif /* #ifdef VENDOR_DATA */
|
the_stack_data/57951694.c | #if __i386__ // Tutto questo file va compilato solo se siamo su architettura x86_32!
#include <string.h>
#include <math.h>
#include <sys/mman.h>
#include "expreval_internal.h"
#include "arch/x86.h"
typedef unsigned long long int uint64;
extern unsigned int cpu_features();
static void *create_executable_code_x86_linux(char *machine_code, int size);
#define ERROR(a,b) do { compiler_SetError(c, a, b); return NULL; } while(0)
/* Definisco istruzioni fittizie pushq e popq:
pushq XMMn:
sub esp, 8
movq [esp], XMMn
popq XMMn:
movq XMMn, [esp]
add esp, 8
I registri XMM sono a 128 bit, ma qui noi siamo interessati
solo a 64 bit (che sono quelli effettivamente spostati dalla
movq) quindi modifico esp solo di 8 */
#define PUSH_Q(n) do { SUB_imm(ESP, 8); MOVQ(_ESP_(0), n); } while(0)
#define POP_Q(n) do { MOVQ(n, _ESP_(0)); ADD_imm(ESP, 8); } while(0)
/* Definisco istruzione fittizia per chiamata a funzione (ind. assoluto)
ATTENZIONE CHE SPORCA EAX
*/
#define CALL_FUN(f) do { MOV_imm(EAX, f); CALL(EAX); } while(0)
/*
Questa funzione si occupa della compilazione vera e propria.
Riceve come parametri:
-L'oggetto compiler
-Il primo token della linked list rappresentante l'espressione
(già convertita in RPN mediante l'algoritmo shunting-yard)
-Un puntatore a un valore intero che alla fine conterrà
la lunghezza del codice macchina generato (se il puntatore
è NULL viene semplicemente ignorato).
*/
void *compile_function_internal(compiler c, token first_token, int *size)
{
/* Queste 5 variabili sono tutte usate dalle macro di compilazione e non possono essere rinominate */
unsigned char code[MAX_CODE_LEN], sib = 0;
int i = 0, disp = 0, flag = 0;
token t;
int stack_size = 0;
int j;
// Prelevo gli argomenti dallo stack
for(j = 0; j < c->arg_count; j++)
MOVQ(XMM(j), _ESP_(4 + 8 * j)); // movq xmm{j}, [esp + {4 + 8 * j}]
// Salvo EBP ci copio lo stack pointer
PUSH(EBP); // push ebp
// Alloco 8 bytes nello stack (li uso per operazioni varie)
SUB_imm(ESP, 8); // sub esp, 0x8
MOV(EBP, ESP); // mov ebp, esp
t = first_token;
do
{
/* Se il token è un numero */
if(t->type == TOKEN_NUMBER)
{
/* Visto che a quanto pare non esiste una mov
per inserire direttamente un valore immediato
in un registro XMM, faccio questo rigiro
strano (uso la 32 bit per volta per inserire
il valore double a 64 bit negli 8 byte allocati
inizialmente nello stack per poi portarlo
nel registro XMM7.
Sicuramente è migliorabile.
*/
uint64 v;
v=*((uint64*)&(t->number_value));
MOV_imm(ECX, (unsigned int)(v & 0xffffffff)); // mov ecx, {v & 0xffffffff}
MOV(_EBP_(0), ECX); // mov [ebp], ecx
MOV_imm(ECX, (unsigned int)(v >> 32)); // mov ecx, {v >> 32}
MOV(_EBP_(4), ECX); // mov [ebp+0x4], ecx
MOVQ(XMM7, _EBP_(0)); // movq xmm7, [ebp]
/* E inserito nello stack */
PUSH_Q(XMM7); // pushq xmm7 ; In realtà questa istruzione non esiste (compilata come 2)
stack_size++;
}
/* Se è una variabile */
else if(t->type == TOKEN_VARIABLE)
{
/* Se la variabile è mappata come argomento */
int arg_index = compiler_GetArgumentIndex(c, t->text);
double constant_value;
if(arg_index >= 0)
{
PUSH_Q(XMM(arg_index)); // pushq xmm{arg_index}
stack_size++;
}
/* Se è una costante faccio come se fosse TOKEN_NUMBER */
else if(parser_GetVariable(c->p, t->text, &constant_value))
{
// Vedi sopra (TOKEN_NUMBER)
uint64 v;
v=*((uint64*)&(constant_value));
MOV_imm(ECX, (unsigned int)(v & 0xffffffff)); // mov ecx, {v & 0xffffffff}
MOV(_EBP_(0), ECX); // mov [ebp], ecx
MOV_imm(ECX, (unsigned int)(v >> 32)); // mov ecx, {v >> 32}
MOV(_EBP_(4), ECX); // mov [ebp+0x4], ecx
MOVQ(XMM7, _EBP_(0)); // movq xmm7, [ebp]
/* E inserito nello stack */
PUSH_Q(XMM7); // pushq xmm7 ; In realtà questa istruzione non esiste (compilata come 2)
stack_size++;
}
else /* Se non è definita */
ERROR(ERROR_UNDEFINED_VAR, t);
}
else if(t->type == TOKEN_OPERATOR && op_args[t->op] == 2)
{
if(stack_size < 2)
ERROR(ERROR_UNKNOWN, NULL);
POP_Q(XMM7); // popq xmm7
POP_Q(XMM6); // popq xmm6
stack_size -= 2;
switch(t->op)
{
case OP_ADD:
ADDSD(XMM6, XMM7); // addsd xmm6, xmm7
break;
case OP_SUB:
SUBSD(XMM6, XMM7); // subsd xmm6, xmm7
break;
case OP_MUL:
MULSD(XMM6, XMM7); // mulsd xmm6, xmm7
break;
case OP_DIV:
DIVSD(XMM6, XMM7); // divsd xmm6, xmm7
break;
case OP_MOD:
CVTTSD2SI(ECX, XMM7); // cvttsd2si ebx, xmm7
CVTTSD2SI(EAX, XMM6); // cvttsd2si eax, xmm6
CDQ; // cdq
IDIV(ECX); // idiv ebx ; Qui intendo proprio ecx, non ecx (anche su x86_64)
CVTSI2SD(XMM6, EDX); // cvtsi2sd xmm6, edx
break;
case OP_PWR:
PUSH_Q(XMM7); // pushq xmm7
PUSH_Q(XMM6); // popq xmm6
CALL_FUN(pow); // call pow
ADD_imm(ESP, 0x10); // add esp, 0x10 ; 0x10 == 16
FSTP(_EBP_(0)); // fstp [ebp]
MOVQ(XMM6, _EBP_(0)); // movq xmm6, [ebp]
break;
}
PUSH_Q(XMM6); // pushq xmm6
stack_size += 1;
}
else if(t->type == TOKEN_OPERATOR && op_args[t->op] == 1)
{
/* Nei valori double (standard IEEE 754) il bit 63
indica il segno, per cambiare il segno di un
double quindi basta fare un bitwise xor un valore
avente tutti i bit a 0 e tranne quello più
significativo */
uint64 v = 1ULL << 63;
/* Operatore unario, deve esserci almeno un valore
nello stack */
if(stack_size < 1)
ERROR(ERROR_UNKNOWN, NULL);
switch(t->op)
{
case OP_NEG:
POP_Q(XMM6); // popq xmm6
stack_size--;
/* Vedi sopra (TOKEN_NUMBER), l'unica
differenza è che ora v non rappresenta
più un valore double ma 10000[...] */
MOV_imm(ECX, (unsigned int)(v & 0xffffffff));// mov ecx, {v & 0xffffffff}
MOV(_EBP_(0), ECX); // mov [ebp], ecx
MOV_imm(ECX, (unsigned int)(v >> 32)); // mov ecx, {v >> 32}
MOV(_EBP_(4), ECX); // mov [ebp+0x4], ecx
MOVQ(XMM7, _EBP_(0)); // movq xmm7, [ebp]
XORPD(XMM6, XMM7); // xorpd xmm6, xmm7
PUSH_Q(XMM6); // pushq xmm6
stack_size++;
break;
/* In caso di "+" non bisogna fare proprio
niente, anche per questo ho messo la pop
e la push dentro a OP_NEG (-), qui faremmo
pop e push dello stesso valore */
case OP_POS:
break;
}
}
else if(t->type == TOKEN_FUNCTION)
{
function f = parser_GetFunction(c->p, t->text);
/* Non dovrebbe succedere mai: se una funzione non è definita
non viene neanche considerata una funzione dal parser e
viene trattata come una variabile */
if(f == NULL)
ERROR(ERROR_UNKNOWN, t);
if(stack_size < f->num_args)
ERROR(ERROR_ARGS, t);
/* xmm{0-3} contengono i parametri
dell'espressione, quindi non possiamo toccarli!
Faccio POP in altri registri (xmm{4-7}) */
for(j = f->num_args - 1; j >= 0; j--)
POP_Q(XMM(j + 4)); // popq xmm{j + 4}
stack_size -= f->num_args;
/* Salvo nello stack i parametri dell'espressione
che potrebbero essere sovrascritti durante la
chiamata */
for(j = 0; j < c->arg_count; j++)
PUSH_Q(XMM(j)); // pushq xmm{j}
/* Faccio push degli argomenti della funzione:
prima erano già nello stack ma in ordine inverso */
for(j = f->num_args - 1; j >= 0; j--)
PUSH_Q(XMM(j + 4)); // pushq xmm{j + 4}
/* Chiamo la funzione e salvo il risultato in XMM6 */
CALL_FUN(f->ptr); // call {f->ptr}
FSTP(_EBP_(0)); // fstp [ebp]
MOVQ(XMM6, _EBP_(0)); // movq xmm6, [ebp]
ADD_imm(ESP, 8 * f->num_args); // add esp, {8 * f->num_args}
/* Recupero dallo stack i parametri dell'espressione
che potrebbero essere stati sovrascritti durante la chiamata */
for(j = c->arg_count - 1; j >= 0; j--)
POP_Q(XMM(j)); // popq xmm{j}
/* Push nello stack del risultato */
PUSH_Q(XMM6); // push xmm6
stack_size++;
}
} while((t = t->next) != NULL);
/* Lo stack dei valori alla fine deve contenere
un solo numero. */
if(stack_size != 1)
ERROR(ERROR_UNKNOWN, NULL);
else
POP_Q(XMM0); /* Valore che viene restituito */ // popq xmm0
MOVQ(_EBP_(0), XMM0); // movw [ebp], xmm0
FLD(_EBP_(0)); // fld [ebp]
ADD_imm(ESP, 8); // add esp, 0x8
POP(EBP); // pop ebp
RET; // ret
if(size != NULL)
*size = i;
void *executable = create_executable_code_x86_linux(code, i);
if(executable == NULL)
ERROR(ERROR_SYSTEM, NULL);
return executable;
}
/*
Attraverso opportune chiamate al kernel alloca un vettore della dimensione adatta che contenga
il codice appena compilato, vi copia il codice e lo rende eseguibile (avendo cura di renderlo
non scrivibile, visto che è bene che la memoria non sia mai scrivibile ed eseguibile nello
stesso momento.
*/
static void *create_executable_code_x86_linux(char *machine_code, int size)
{
/* Memoria rw- */
void *mem = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if(mem == MAP_FAILED)
return NULL;
/* Scrivo il codice */
memcpy(mem, machine_code, size);
/* Inibisco la scrittura e consento l'esecuzione (r-x) */
if(mprotect(mem, size, PROT_READ | PROT_EXEC) < 0)
{
munmap(mem, size);
return NULL;
}
return mem;
}
/*
Restituisce 1 se la CPU supporta il set di istruzioni SSE2, 0 altrimenti
*/
static int supported_sse2()
{
/* cpu_features() è definita in cpu_id.asm e funziona eseguendo
l'istruzione CPUID.
Il supporto a SSE2 è indicato dal bit 26 del valore che si
trova in EDX dopo CPUID (che è restituito da cpu_features()
https://en.wikipedia.org/wiki/CPUID#EAX.3D1:_Processor_Info_and_Feature_Bits
*/
return (cpu_features() >> 26) & 1;
}
/*
Verifica il supporto del sistema corrente, nello specifico verificando
che il set di istruzioni SSE2 sia supportato.
*/
int check_system_support(compiler c)
{
/* Queste macro verificano il supporto in fase di compilazione della libreria,
avrei potuto infilarle più o meno ovunque ma qui mi è sembrato più
pertinente.
*/
#ifndef __linux__
#warning Only Linux is supported!
#ifdef _WIN32
#error Microsoft Windows is not supported!
#endif
#endif
if(!supported_sse2())
{
compiler_SetError(c, ERROR_UNSUPPORTED_SYS, NULL);
return 0;
}
return 1;
}
#endif
|
the_stack_data/193892338.c | /*
* getresgid() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <sys/syscall.h>
#ifdef __USE_GNU
#include <unistd.h>
#if defined(__NR_getresgid32)
# undef __NR_getresgid
# define __NR_getresgid __NR_getresgid32
_syscall3(int, getresgid, gid_t *, rgid, gid_t *, egid, gid_t *, sgid)
#elif defined(__NR_getresgid)
# define __NR___syscall_getresgid __NR_getresgid
static __inline__ _syscall3(int, __syscall_getresgid, __kernel_gid_t *, rgid,
__kernel_gid_t *, egid, __kernel_gid_t *, sgid)
int getresgid(gid_t * rgid, gid_t * egid, gid_t * sgid)
{
int result;
__kernel_gid_t k_rgid, k_egid, k_sgid;
result = __syscall_getresgid(&k_rgid, &k_egid, &k_sgid);
if (result == 0) {
*rgid = (gid_t) k_rgid;
*egid = (gid_t) k_egid;
*sgid = (gid_t) k_sgid;
}
return result;
}
#endif
#endif
|
the_stack_data/15830.c | /* Generated by re2c */
#line 1 "repeater.re"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define RET(n) return n
int scan(const char *s, int l){
const char *p = s;
const char *q;
#define YYCTYPE char
#define YYCURSOR p
#define YYLIMIT (s+l)
#define YYMARKER q
#define YYFILL(n)
#line 19 "<stdout>"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
yych = *YYCURSOR;
switch (yych) {
case '\n':
case 'q': goto yy7;
case 'A': goto yy2;
case 'a': goto yy4;
default: goto yy6;
}
yy2:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
case '\n': goto yy10;
case 'A':
case 'a': goto yy8;
default: goto yy3;
}
yy3:
#line 22 "repeater.re"
{RET(5);}
#line 45 "<stdout>"
yy4:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
switch (yych) {
case '\n': goto yy10;
case 'A':
case 'a': goto yy8;
default: goto yy5;
}
yy5:
#line 23 "repeater.re"
{RET(0);}
#line 58 "<stdout>"
yy6:
yych = *++YYCURSOR;
goto yy3;
yy7:
yych = *++YYCURSOR;
goto yy5;
yy8:
yych = *++YYCURSOR;
switch (yych) {
case '\n': goto yy13;
case 'A':
case 'a': goto yy12;
default: goto yy9;
}
yy9:
YYCURSOR = YYMARKER;
switch (yyaccept) {
case 0: goto yy3;
case 1: goto yy5;
}
yy10:
++YYCURSOR;
#line 18 "repeater.re"
{RET(1);}
#line 83 "<stdout>"
yy12:
yych = *++YYCURSOR;
switch (yych) {
case '\n': goto yy13;
case 'A':
case 'a': goto yy15;
default: goto yy9;
}
yy13:
++YYCURSOR;
#line 19 "repeater.re"
{RET(2);}
#line 96 "<stdout>"
yy15:
yych = *++YYCURSOR;
switch (yych) {
case '\n': goto yy17;
case 'A':
case 'a': goto yy16;
default: goto yy9;
}
yy16:
yych = *++YYCURSOR;
switch (yych) {
case '\n': goto yy17;
case 'A':
case 'a': goto yy19;
default: goto yy9;
}
yy17:
++YYCURSOR;
#line 21 "repeater.re"
{RET(4);}
#line 117 "<stdout>"
yy19:
yych = *++YYCURSOR;
switch (yych) {
case '\n': goto yy20;
default: goto yy23;
}
yy20:
++YYCURSOR;
#line 20 "repeater.re"
{RET(3);}
#line 128 "<stdout>"
yy22:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
yy23:
switch (yych) {
case '\n': goto yy17;
case 'A':
case 'a': goto yy22;
default: goto yy9;
}
}
#line 24 "repeater.re"
}
void _do_scan(int exp, const char * str, int len)
{
int ret = scan(str, len);
printf("%d %s %d\n", exp, exp == ret ? "==" : "!=", ret);
}
#define do_scan(exp, str) _do_scan(exp, str, sizeof(str) - 1)
main()
{
do_scan(1, "a\n");
do_scan(2, "aa\n");
do_scan(2, "aaa\n");
do_scan(4, "aaaa\n");
do_scan(0, "q");
do_scan(0, "a");
do_scan(1, "A\n");
do_scan(2, "AA\n");
do_scan(2, "aAa\n");
do_scan(4, "AaaA\n");
do_scan(5, "Q");
do_scan(4, "AaaAa\n");
do_scan(3, "AaaAaA\n");
do_scan(5, "A");
do_scan(0, "\n");
do_scan(5, "0");
do_scan(0, "a");
do_scan(0, "q");
do_scan(5, "x");
}
|
the_stack_data/12638204.c | #include <stdio.h>
int main()
{
int n, i, j;
char interior, exterior;
scanf("%c\n%c\n%d", &interior, &exterior, &n);
for (i = 0; i < n; i++)
{
for (j = 1; j <= n - i; j++)
printf(" ");
for (j = 1; j <= i * 2; j++)
printf("%c", interior);
for (j = 1; j <= n - i; j++)
printf(" ");
printf("\n");
}
for (i = n - 1; i >= 0; i--)
{
for (j = 1; j <= n - i; j++)
printf(" ");
for (j = 1; j <= i * 2; j++)
printf("%c", interior);
for (j = 1; j <= n - i; j++)
printf(" ");
printf("\n");
}
printf("\n");
for (i = 0; i < n; i++)
{
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
for (j = 1; j <= i * 2; j++)
printf(" ");
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
printf("\n");
}
for (i = n - 1; i >= 0; i--)
{
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
for (j = 1; j <= i * 2; j++)
printf(" ");
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
printf("\n");
}
printf("\n");
for (i = 0; i < n; i++)
{
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
for (j = 1; j <= i * 2; j++)
printf("%c", interior);
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
printf("\n");
}
for (i = n - 1; i >= 0; i--)
{
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
for (j = 1; j <= i * 2; j++)
printf("%c", interior);
for (j = 1; j <= n - i; j++)
printf("%c", exterior);
printf("\n");
}
return 0;
} |
the_stack_data/70451393.c | #include<stdio.h>
void main()
{
int X,Y,i;
printf("Enter first number X : ");
scanf("%d",&X);
printf("Enter second number Y : ");
scanf("%d",&Y);
printf("The common factors are : ");
for(i=2;i<X;i++)
{
if(X%i==0 && Y%i==0)
{
printf("%d\t",i);
}
}
}
|
the_stack_data/29825166.c | // RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
// This test case was reported in <rdar:problem/6080742>.
// It tests path-sensitivity with respect to '!(cfstring != 0)' (negation of inequality).
int printf(const char *restrict,...);
typedef unsigned long UInt32;
typedef signed long SInt32;
typedef SInt32 OSStatus;
typedef unsigned char Boolean;
enum { noErr = 0};
typedef const void *CFTypeRef;
typedef const struct __CFString *CFStringRef;
typedef const struct __CFAllocator *CFAllocatorRef;
extern void CFRelease(CFTypeRef cf);
typedef UInt32 CFStringEncoding;
enum { kCFStringEncodingMacRoman = 0, kCFStringEncodingWindowsLatin1 = 0x0500,
kCFStringEncodingISOLatin1 = 0x0201, kCFStringEncodingNextStepLatin = 0x0B01,
kCFStringEncodingASCII = 0x0600, kCFStringEncodingUnicode = 0x0100,
kCFStringEncodingUTF8 = 0x08000100, kCFStringEncodingNonLossyASCII = 0x0BFF,
kCFStringEncodingUTF16 = 0x0100, kCFStringEncodingUTF16BE = 0x10000100,
kCFStringEncodingUTF16LE = 0x14000100, kCFStringEncodingUTF32 = 0x0c000100,
kCFStringEncodingUTF32BE = 0x18000100, kCFStringEncodingUTF32LE = 0x1c000100};
extern CFStringRef CFStringCreateWithCString(CFAllocatorRef alloc, const char *cStr, CFStringEncoding encoding);
enum { memROZWarn = -99, memROZError = -99, memROZErr = -99, memFullErr = -108,
nilHandleErr = -109, memWZErr = -111, memPurErr = -112, memAdrErr = -110,
memAZErr = -113, memPCErr = -114, memBCErr = -115, memSCErr = -116, memLockedErr = -117};
#define DEBUG1
void DebugStop(const char *format,...);
void DebugTraceIf(unsigned int condition, const char *format,...);
Boolean DebugDisplayOSStatusMsg(OSStatus status, const char *statusStr, const char *fileName, unsigned long lineNumber);
#define Assert(condition)if (!(condition)) { DebugStop("Assertion failure: %s [File: %s, Line: %lu]", #condition, __FILE__, __LINE__); }
#define AssertMsg(condition, message)if (!(condition)) { DebugStop("Assertion failure: %s (%s) [File: %s, Line: %lu]", #condition, message, __FILE__, __LINE__); }
#define Require(condition)if (!(condition)) { DebugStop("Assertion failure: %s [File: %s, Line: %lu]", #condition, __FILE__, __LINE__); }
#define RequireAction(condition, action)if (!(condition)) { DebugStop("Assertion failure: %s [File: %s, Line: %lu]", #condition, __FILE__, __LINE__); action }
#define RequireActionSilent(condition, action)if (!(condition)) { action }
#define AssertNoErr(err){ DebugDisplayOSStatusMsg((err), #err, __FILE__, __LINE__); }
#define RequireNoErr(err, action){ if( DebugDisplayOSStatusMsg((err), #err, __FILE__, __LINE__) ) { action }}
void DebugStop(const char *format,...); /* Not an abort function. */
int main(int argc, char *argv[]) {
CFStringRef cfString;
OSStatus status = noErr;
cfString = CFStringCreateWithCString(0, "hello", kCFStringEncodingUTF8);
RequireAction(cfString != 0, return memFullErr;) //no - warning
printf("cfstring %p\n", cfString);
Exit:
CFRelease(cfString);
return 0;
}
|
the_stack_data/152085.c |
void foo(void);
void foo(void)
{
char c = 0;
c = 1 && 2;
}
|
the_stack_data/2433.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Chiffre qui est chaîné à au poids le plus fort
typedef struct cell{ char chiffre; struct cell *suivant; } cell;
// Structure d'un nombre
typedef struct num{ int compteurRef; int negatif; struct cell *chiffres; } num;
/* Noeud appartenant à une pile. Contient un pointeur noeud sur le noeud le précédant dans la pile
afin de pouvoir effectuer des recherches de nombre dans la pile. */
typedef struct node {num *nombre; struct node *suivant;} node;
/* Une structure de pile classique, mais qui ne contient pas de taille maximale prédéfinie afin
d'optimiser l'utilisation mémoire à l'aide de malloc. */
typedef struct pile {int length; struct node *top;} pile;
/*
Une structure mémoire afin de pouvoir conserver les variables déjà affectées
Le buffer qui utilisera les valeurs actuellement affectées par l'expression permet de protéger la mémoire en cas d'erreurs lors de l'évaluation
de l'expression postfixe. La mémoire est une liste chaînée également. */
typedef struct memoire {struct variable *tete; } memoire;
// var est une case mémoire qui contiendra la variable et le nombre auquel elles est associée.
typedef struct variable {char var; struct num *nombre; struct variable *suivant; } variable;
/* OPÉRATIONS MÉMOIRE */
//Ajoute la variable dans la mémoire, et décrémente le compteur de référence.
int affecterVal(memoire *mem, char var, num* nombre);
// Rétablis les valeurs du buffer dans la mémoire. S'effectue après une expression postfixe entièrement valide.
int retablirValeurs(memoire *mem, memoire* buf);
/*
Efface tous les variables d'une mémoire. Détruit les nombres/objets dont les compteurs de référence sont à 0 0, sauf
pour le nombre passé en paramètre qui sera détruit éventuellement plus tard */
void deleteMem(memoire *mem, num *nombre);
// Vérifie qu'un nombre n'est pas déjà présent en mémoire.
num* checkMem(num *nombre, memoire *mem);
// Retourne un pointeur sur la variable recherchée en memoire (ou buffer) sinon NULL si absente.
variable* rechercherVar(memoire *mem, char var);
/* OPÉRATIONS D'ÉVALUATION D'EXPRESSION. */
// Transforme une string en nombre.
num* transformationStructure(memoire *buffer, memoire *mem, pile *stack, char *str);
/* Retourne 0 si out of memory, 1 si tout s'est bien passé pour l'évaluation du mot dans une expression postfixe,
et 2 s'il y a une erreur de syntaxe. */
int postfixeEvaluation(memoire *buffer, memoire *mem, pile *stack, char *mot);
// Retourne le nombre calculé par l'opération binaire.
num* evaluerOpBin(num *nombre1, num *nombre2, char operator);
// Retourne le nombre calculé par l'opération unaire.
num* evaluerOpUn(memoire *buffer, memoire *mem, pile *stack, num *nombre, char *opun);
// Retourne 1 si la chaîne de cractères est un literal: a,...,z et les nombres sans 0 en poids forts.
int validLiteral(char *literal);
// Retourne 1 si la chaîne de cacactères est un opérateur binaire (+, -, *), 0 sinon.
int validOpBin(char *opbin);
// Retourne 1 si la chaîne de caractères est un opérateur unaire (=a , ?) valide, 0 sinon.
int validOpUn(char *opun);
/* OPÉRATIONS AVEC LES NOMBRES */
// Renvoie le résultat de l'addtion d'un nombre1 avec un nombre2. Pour les nombres négatifs, peut faire appel à soustraction
num* addition(num *nombre1, num *nombre2);
// Renvoie le résultat de la soustraction d'un nombre1 avec un nombre2. Peut faire appel à l'addition.
num* soustraction(num *nombre1,num *nombre2);
// Renvoie le résultat de la multiplication d'un nombre1 avec un nombre2. Fait appel à des additions successives.
num* multiplication(num *nombre1,num *nombre2);
// Permet d'enlever les poids les plus forts qui ont la valeur 0
void enleverPoidsForts0(num *nombre);
/* PRINT NOMBRES */
// Méthode récursive afin d'imprimer un nombre du bits de poids le plus fort au plus faible (ex: 10000)
void printRev(cell *chiffre);
// Imprimer un nombre avec son signe (+ ou -) et du poids le plus fort au plus faible
void printNumReverse(num* nombre);
/* LONGUEUR ET COMPARAISON DE NOMBRES */
// Trouver la longueur d'un nombre.
int findLenNum(num *nombre);
// Renvoie 0 si nombre1 < nombre2, ou 1 si nombre1 >= nombre2
int compareNum(num *nombre1, num *nombre2);
// Renvoie 0 si nombre1 < nombre2, ou 1 si nombre1 >= nombre2
int isEqual(num *nombre1, num *nombre2);
/* OPÉRATIONS STRUCTURES NOMBRES */
// Renvoie 0 si out of memory. Ajoute un chiffre de poids le plus faible à un nombre.
int addHeadNum(num *nombre, char chiffre);
// Renvoie 0 si out of memory. Ajoute un chiffre de poids le plus fort à un nombre.
int addTailNum(num *nombre, char chiffre);
// Renvoie un pointeur sur la dernier chiffre d'un nombre, qui correspond à son chiffre de poids le plus fort.
cell* checkTailNum(num *nombre);
// Supprime un chiffre de poids le plus fort à un nombre. Utile pour enlever les zéros de le plus fort.
void deleteTailNum(num *nombre);
// Permet de copier un nombre dans un autre nombre. Permet de limiter les fuites mémoires à cause de pointeurs fous.
int copyNum(num *nombre1, num *nombre2);
// Détruit tous les chiffres chaînés d'un nombre. Désallocation du pointeur
void deleteNumber(num *nombre);
// Détruit seulement les chiffres chaînés d'un nombre, mais pas le pointeur du nombre.
void deleteChiffres(num *nombre);
/* OPÉRATIONS SUR LA PILE QUI PERMET DE STOCKER LES POINTEURS AFIN DE FAIRE L'ÉVALUATION POSTFIXE. */
// La pile est initialisé à length = 0 et top = NULL;
void initPile(pile *stack);
// Destruction de la pile d'exécution.
void deletePile(pile* stack);
// 1 si push réussi, 0 si out of memory
int push(pile* stack, num *nombre);
// Retourne NULL si pop échoué, sinon retourne le nombre qui était au sommet de la pile
num* pop(pile* stack);
// 1 si la pile est vide, 0 sinon.
int isEmpty(pile* stack);
// Retourne le pointeur d'un nombre si présent dans la pile. 0 sinon.
num* checkPile(num* nombre, pile* stack);
int main(int argc, char*argv[]) {
char *mot; // Un mot que l'on veut étudier (une opérande, un opérateur ou une affection, ou un mot hors langage également).
pile *stack = NULL; // Pile qui va nous permettre d'évaluer l'expression postfixe.
memoire *buffer = NULL;
int c; // Un caractère que je récupère dans la console.
int erreur; // Permet de vérifier qu'il n'y pas eu d'erreurs dans mes appels de fonctions.
int debut; // Permet de marquer le début d'un nouveau mot.
int exception = 0;
memoire* mem = malloc(sizeof(memoire));
if (!mem)
exception = 1;
else
mem->tete = NULL;
init:
while (1) {
stack = malloc(sizeof(pile));
if (!stack)
exception = 1;
else
initPile(stack);
buffer = malloc(sizeof(memoire));
if (!buffer)
exception = 1;
else
buffer->tete = NULL;
mot = NULL;
char *motCpy = NULL;
int longueurMot = 0;
debut = 1;
printf("> ");
while ((c = getchar())) {
if (!exception && debut && c == ' ')
exception = 2; // Pas d'espace au début d'un mot. SYNTAXE
else if (c == '\n' || c == EOF) { // À la fin de la ligne, on arrête.
if (!exception) {
erreur = postfixeEvaluation(buffer, mem, stack, mot); // Derniere opération à effectuer puisqu'on a atteint la fin de ligne ou de fichier.
if (erreur)
exception = erreur; // Out of Memory ou Erreur de syntaxe
}
if (!exception && stack->length == 1) {
num* val1 = pop(stack);
if (val1) {
// Si tout est bon, on peut actualiser les valeurs de la mémoire à partir de celles du buffer
if (retablirValeurs(buffer, mem))
exception = 1; // Out of memory
if (!exception) {
deleteMem(buffer, val1); // Destruction du buffer.
buffer = NULL; // Afin d'éviter de re-désallouer le buffer en bas de la boucle, on met à NULL.
printNumReverse(val1); // Impression du résultat
if (!val1->compteurRef)
deleteNumber(val1); // Si la veuleur popé n'est plus référencé, on peut la détruire
}
}
}
else if (!exception) exception = 2; // La stack n'est pas de longueur 1 à la fin, c'est qu'il y a une erreur dans l'expression postfixée.
if (!exception)
printf("\n");
if (c == EOF)
goto stop; // Fin de fichier, le programme peut s'arrêter.
else if (c == '\n')
break; //Si fin de ligne, on reprend la boucle principale pour relire une nouvelle ligne.
}
else if (!exception && c == ' ' && !debut) { // Un nouveau mot a été lu.
erreur = postfixeEvaluation(buffer, mem, stack, mot);
if (erreur)
exception = erreur; // Out of Memory ou Erreur de syntaxe
if (mot)
free(mot);
mot = NULL;
debut = 1;
}
else if (!exception) { // On est en train d'enregistrer un mot
debut = 0;
if (!mot) {
mot = malloc(sizeof(char) + 1);
if (!mot)
exception = 1;
else {
strncpy(mot, (char *) &c, 2);
longueurMot++;
}
}
else {
motCpy = malloc(sizeof(char)*(longueurMot + 2));
if (!motCpy)
exception = 1;
else {
strcpy(motCpy, mot);
strcat(motCpy, (char *) &c);
free(mot);
}
mot = malloc(sizeof(char)*(longueurMot + 2));
if (!mot)
exception = 1;
else {
strcpy(mot, motCpy);
longueurMot++;
}
free(motCpy);
}
}
}
// On attend d'avoir atteint la fin de ligne pour sortir de la boucle de getChar() afin de traiter les exceptions.
// En effet, si on avait pas géré l'exception de cette manière, getChar() continuerait à traiter la suite de l'expression à partir
// de là où l'exception a été levée.
switch (exception) {
case 1:
printf("Out of Memory. Le programme n'a plus assez de mémoire pour fonctionner normalement.\n");
exception = 0;
break;
case 2:
printf("Erreur de syntaxe:\n L'expression doit être une expression postfixe\n"
" L'expression ne doit pas commencer par un espace, ni se terminer par un espace\n"
" Chaque opérande et opérateur ou affection doivent être espacés d'un espace exactement\n"
" Une variable doit être affectée pour pouvoir être utilisée.\n");
exception = 0;
break;
default:
break;
}
// Enfin, après une exception ou une fin de boucle, on s'assure bien d'avoir vider la pile, le mot, et le buffer
// Avant de recommencer un traitement d'une nouvelle ligne.
if (mot) free(mot);
if (stack) deletePile(stack);
if (buffer) deleteMem(buffer, NULL);
goto init;
}
// Étiquette de fin du programme. On détruit toutes les cases mémoires possiblement allouées.
stop:
if (mot) free(mot);
if (buffer) deleteMem(buffer, NULL);
if (stack) deletePile(stack);
if (mem) deleteMem(mem, NULL);
return 0;
}
num* transformationStructure(memoire* buffer, memoire* mem, pile * stack, char *str) {
int longueurChaine = (int) strlen(str);
num* nombre = malloc(sizeof(num));
if (!nombre)
return nombre;
nombre->compteurRef = 0;
nombre->negatif = 0;
nombre->chiffres = NULL;
if (!(longueurChaine == 1 && str[0] == '0')) { // Prendre en compte le cas 0 pour le mémoire
int i;
for(i = longueurChaine - 1; i >= 0; i--){
if (addTailNum(nombre, str[i])) {
deleteNumber(nombre);
return NULL;
}
}
}
num* num1 = checkPile(nombre, stack); // et surtout checkMemoire;
num* num2 = checkMem(nombre, mem);
num* num3 = checkMem(nombre, buffer);
if (num1) {
deleteNumber(nombre);
return num1;
}
if (num2) {
deleteNumber(nombre);
return num2;
}
if (num3) {
deleteNumber(nombre);
return num3;
}
return nombre;
}
int postfixeEvaluation(memoire *buffer, memoire* mem, pile* stack, char* mot) {
if (validLiteral(mot)) {
if (mot[0] >= 'a' && *mot <= 'z') {
int erreur;
variable *ptr = rechercherVar(mem, *mot);
variable *ptrBuf = rechercherVar(buffer, *mot);
if (!ptr && !ptrBuf)
return 2; // Buf et memoire vide. Cette variable n'a pas été affectée.
else
erreur = ptrBuf ? push(stack, ptrBuf->nombre) : push(stack, ptr->nombre); // On va chercher en priorité la valeur contenue dans le buffer qui est la plus actuelle.
// si elle n'est pas présente dans le buffer, on push le pointeur de nombre de la variable contenu en memoire.
if (erreur)
return 1; // Out of Memory
return 0; // Tout s'est bien passé
}
else {
num* val1 = transformationStructure(buffer, mem, stack, mot);
if (!val1)
return 1; // Out of memory, il n'y avait plus de place pour malloc dans transformationStructure;
if (push(stack, val1)) { // En cas d'échec, on doit détruire ce nombre si son compteur de référence est à 0, sinon on en perdrait la trace.
if (!val1->compteurRef)
deleteNumber(val1);
return 1; // Out of Memory, il n'y a plus de place pour la pile.
}
return 0;
}
}
else if(validOpBin(mot)) {
num *val2 = pop(stack);// Destack val1
num *val1 = pop(stack);// Destack val2
if (val1 && val2) {
num *resultat = evaluerOpBin(val1, val2, *mot); // Evaluer l'expression
if (!resultat) {
// Le resultat est NULL, echec de l'opération. On vérifie que les valeurs ne pointent pas sur le même nombre, sinon on pourrait
// désalloué un même nombre deux fois. S'ils ne sont pas égaux, et que leur compteur de ref vaut 0, on peut les détruire sans soucis.
// De plus, il faut désallouer, car sinon risque d'objets morts en sortant de la méthode.
if ((isEqual(val1, val2) && !val1->compteurRef))
deleteNumber(val1);
else if (!isEqual(val1, val2) && !val1->compteurRef && !val2->compteurRef) {
deleteNumber(val1);
deleteNumber(val2);
}
else if (!isEqual(val1, val2) && !val1->compteurRef && val2->compteurRef)
deleteNumber(val1);
else if (!isEqual(val1, val2) && val1->compteurRef && !val2->compteurRef)
deleteNumber(val2);
return 1;// Out of memory pour l'allocation dans evaluerOpBin;
}
// Le résultat n'est pas NULL. On devrait donc vérifier dans la memoire (buffer et memoire principale) ainsi
// que la pile que ce nombre n'existe pas déjà en mémoire. S'il existe déjà, on peut détruire le résultat.
num *num1 = checkPile(resultat, stack);
num *num2 = checkMem(resultat, mem);
num *num3 = checkMem(resultat, buffer);
if (num1) {
deleteNumber(resultat);
resultat = num1;
}
else if (num2) {
deleteNumber(resultat);
resultat = num2;
}
else if (num3) {
deleteNumber(resultat);
resultat = num3;
}
else if (isEqual(val1, resultat)) {
deleteNumber(resultat);
resultat = val1;
}
else if (isEqual(val2, resultat)) {
deleteNumber(resultat);
resultat = val2;
}
else
resultat->compteurRef = 0;
// Si le resultat a la même valeur que val1 ou val2, on pourrait désallouer val1 ou val2 alors que resultat pointe
// sur le même nombre. Ainsi, afin de ne pas pas désallouer resultat, on incrémente son compteur de référence.
resultat->compteurRef++;
if ((isEqual(val1, val2) && !val1->compteurRef))
deleteNumber(val1);
else if (!isEqual(val1, val2) && !val1->compteurRef && !val2->compteurRef) {
deleteNumber(val1);
deleteNumber(val2);
}
else if (!isEqual(val1, val2) && !val1->compteurRef && val2->compteurRef)
deleteNumber(val1);
else if (!isEqual(val1, val2) && val1->compteurRef && !val2->compteurRef)
deleteNumber(val2);
// Passé cette étape, on peut décrémenter le compteur de référence, qui sera re-incrémenter par le push dans la pile.
resultat->compteurRef--;
if (push(stack, resultat)) {
if (!resultat->compteurRef)
deleteNumber(resultat);
return 1;
}
return 0;
}
else {
// Si on arrive dans ce cas, la pile n'a pu pop les nombres requis pour l'opération.
// On vérifie les compteurs de références de ces nombres, et on désalloue si nécessaire.
if (val1 && !val1->compteurRef)
deleteNumber(val1);
if (val2 && !val2->compteurRef)
deleteNumber(val2);
return 2; // Erreur de syntaxe
}
}
else if(validOpUn(mot)) {
num* val1 = pop(stack);// Destack val1
if (val1) {
num* resultat = evaluerOpUn(buffer, mem, stack, val1, mot);
if (!resultat && !val1->compteurRef) { // Cas out of memory avec resultat = NULL
deleteNumber(val1);
return 1; // Out of memory pour l'alloc dans evaluer expUn
}
if (!isEqual(val1, resultat) && !val1->compteurRef)
deleteNumber(val1);
if (push(stack, resultat)) {
if (!resultat->compteurRef)
deleteNumber(resultat);
return 1; // Out of Memory
}
return 0; // Tout s'est bien passé
}
return 2; // Erreur de Syntaxe: impossible de pop un opérande.
}
return 2; // Ni literral, ni binaire, ni unaire ( ? et =a)
}
num* evaluerOpBin(num *nombre1, num *nombre2, char operator) {
num* resultat = malloc(sizeof(num));
if (!resultat)
return NULL;
num *temp = NULL;
switch(operator) {
case '+':
temp = addition(nombre1, nombre2); break;
case '-':
temp = soustraction(nombre1, nombre2); break;
case '*':
temp = multiplication(nombre1, nombre2); break;
default:
free(resultat); return NULL;
}
if (copyNum(temp, resultat)) {
if(resultat)
deleteNumber(resultat);
if (temp)
deleteNumber(temp);
return NULL;
}
deleteNumber(temp);
return resultat;
}
int nombreChiffre(int n) {
if (n < 10)
return 1;
return 1 + nombreChiffre(n / 10);
} // Compter le nombre de chiffres que prend le compteur de reference (p.e 4560 prend 4 chiffres en longueur)
num* evaluerOpUn(memoire *buffer, memoire *mem, pile *stack, num *nombre, char *opun) {
num *resultat, *num2, *num3, *num4;
char str[nombreChiffre(nombre->compteurRef)];
if (opun) {
int longueur = (int) strlen(opun);
switch(longueur) {
case 1: // Cas où l'on veut obtenir le compteur de référence d'un nombre.
if (sprintf(str, "%d", nombre->compteurRef) < 0)
return NULL;
resultat = transformationStructure(buffer,mem, stack, str); // Fais la verif checkMem etc.
if (!resultat)
return NULL;
if (isEqual(nombre, resultat)) {
deleteNumber(resultat);
resultat = nombre;
}
return resultat;
case 2:
if (affecterVal(buffer, opun[1], nombre))
return NULL;
return nombre;
default:
break;
}
}
return NULL;
}
int validLiteral(char *nombre) {
if (!nombre)
return 0;
int longueurLiteral = (int) strlen(nombre);
if (longueurLiteral == 1 && *nombre >= 'a' && *nombre <= 'z')
return 1; // Accepter 'a', 'b', 'c'
if (longueurLiteral > 1 && *nombre == '0')
return 0; // Cas 0123 , 004324 mais on garde juste 0;
int i;
for(i = 0; i < longueurLiteral; i++)
if (!(*(nombre+i) >= '0' && *(nombre+i) <= '9'))
return 0;
return 1;
}
int validOpBin(char *opbin) {
if (!opbin)
return 0;
int longueur = (int) strlen(opbin);
if (longueur > 1 || (*opbin != '+' && *opbin != '-' && *opbin != '*'))
return 0;
return 1;
}
int validOpUn(char *opun) {
if (!opun)
return 0;
int longueur = (int) strlen(opun);
if (longueur == 1 && opun[0] == '?')
return 1;
else if (longueur == 2 && opun[0] == '=' && opun[1] >= 'a' && opun[1] <= 'z')
return 1;
return 0;
}
void initPile(pile *stack) {
stack->length = 0;
stack->top = NULL;
}
int isEmpty(pile* stack) {
if (stack->top)
return 0;
return 1;
}
int push(pile* stack, num *nombre) { // 1 si out of memory, 0 sinon
node *noeud = malloc(sizeof(node));
if(!noeud)
return 1;
else {
noeud->nombre = nombre;
noeud->nombre->compteurRef++;
noeud->suivant = stack->top;
stack->top = noeud;
stack->length++;
return 0;
}
}
num* pop(pile* stack) {
node *noeud;
num *nombre;
if(isEmpty(stack))
return NULL;
noeud = stack->top;
stack->top = noeud->suivant;
nombre = noeud->nombre;
free(noeud);
stack->length--;
if (!stack->length)
stack->top = NULL;
nombre->compteurRef--;
return nombre;
}
num* checkPile(num *nombre, pile* stack) {
node *ptr = stack->top;
while(ptr) {
if (isEqual(nombre, ptr->nombre))
return ptr->nombre; // On a trouvé un nombre égal à nombre dans la pile
ptr = ptr->suivant;
}
return NULL;
}
void deletePile(pile* stack) {
num *nombre = pop(stack);
while (nombre) {
if (!nombre->compteurRef)
deleteNumber(nombre);
nombre = pop(stack);
}
free(stack);
}
num* addition(num *nombre1, num *nombre2) { // Addition de deux entiers positifs
num* temp;
num* resultatSomme = malloc(sizeof(num));
if (!resultatSomme)
return NULL;
// En cas d'addition avec 0
if (!nombre1->chiffres && nombre2->chiffres) { // 0 + (-1234) ou 0 + 1234, il suffit de renvoyer num2
if (copyNum(nombre2, resultatSomme))
goto deleteSomme;
return resultatSomme;
}
else if (nombre1->chiffres && !nombre2->chiffres) { // 1234 + 0 ou -1234 + 0.
if (copyNum(nombre1, resultatSomme))
goto deleteSomme;
return resultatSomme;
}
else if (!nombre1->chiffres && !nombre2->chiffres) { // 0 + 0
resultatSomme->negatif = 0;
resultatSomme->chiffres = NULL;
return resultatSomme;
}
// En cas d'addition de nombre négatifs
if(nombre1->negatif && nombre2->negatif)
resultatSomme->negatif = 1; // Si on fait (-1234) + (-1234) = - (1234 + 1234)
else if (!nombre1->negatif && nombre2->negatif) { // Si on fait 1234 + (-1234) = 1234 - 1234
nombre2->negatif = 0;
temp= soustraction(nombre1,nombre2);
if (!temp)
goto deleteSomme;
if (copyNum(temp, resultatSomme))
goto deleteTempSomme;
deleteNumber(temp);
nombre2->negatif = 1;
return resultatSomme;
}
else if (nombre1->negatif && !nombre2->negatif) { // Si on fait -1234 + 33
nombre1->negatif = 0;
temp= soustraction(nombre2,nombre1);
if (!temp)
goto deleteSomme;
if (copyNum(temp, resultatSomme))
goto deleteTempSomme;
deleteNumber(temp);
nombre1->negatif = 1;
return resultatSomme;
}
else
resultatSomme->negatif = 0;
// Sinon on fait l'addition
int sommeIntermediaire;
int reste = 0;
resultatSomme->chiffres = NULL;
cell *chiffre1 = nombre1->chiffres; // Pointeur sur le premier chiffre de num1
cell *chiffre2 = nombre2->chiffres; // Pointeur sur le premier chiffre de num2
while(chiffre1 && chiffre2) {
sommeIntermediaire = (chiffre1->chiffre - '0') + (chiffre2->chiffre - '0') + reste;
reste = sommeIntermediaire / 10;
if (addTailNum(resultatSomme, (char) (sommeIntermediaire % 10 + '0')))
goto deleteSomme;
chiffre1 = chiffre1->suivant;
chiffre2 = chiffre2->suivant;
}
while(chiffre1) {
sommeIntermediaire = (chiffre1->chiffre - '0') + reste;
reste = sommeIntermediaire / 10;
if (addTailNum(resultatSomme, (char) (sommeIntermediaire % 10 + '0')))
goto deleteSomme;
chiffre1 = chiffre1->suivant;
}
while(chiffre2) {
sommeIntermediaire = (chiffre2->chiffre - '0') + reste;
reste = sommeIntermediaire / 10;
if (addTailNum(resultatSomme, (char) (sommeIntermediaire % 10 + '0')))
goto deleteSomme;
chiffre2 = chiffre2->suivant;
}
if (reste > 0 && addTailNum(resultatSomme, (char) (reste + '0')))
goto deleteSomme;
return resultatSomme;
deleteSomme:
deleteNumber(resultatSomme);
return NULL;
deleteTempSomme:
deleteNumber(resultatSomme);
deleteNumber(temp);
return NULL;
}
num* soustraction(num *nombre1, num *nombre2) {
int soustractionIntermediaire;
int reste = 0;
cell* chiffre1, *chiffre2;
num *temp;
num* resultatSoustraction = malloc(sizeof(num));
if (!resultatSoustraction)
return NULL;
// En cas de soustraction avec 0
if (!nombre1->chiffres && nombre2->chiffres) { // 0 - 1234 ou 0 - (-1234)
if (copyNum(nombre2, resultatSoustraction))
goto deleteSous;
if (nombre2->negatif)
resultatSoustraction->negatif = 0; // 0 - (-1234) si num2 negatif, alors le resultat est positif.
else
resultatSoustraction->negatif = 1; // 0 - 1234 si c'est 1234, alors ca devient négatif
return resultatSoustraction;
}
else if (nombre1->chiffres && !nombre2->chiffres) { // 1234 - 0 ou -1234 - 0; On garde num1 seulement
if (copyNum(nombre1, resultatSoustraction))
goto deleteSous;
return resultatSoustraction;
}
else if (!nombre1->chiffres && !nombre2->chiffres) { // Cas 0 - 0
resultatSoustraction->negatif = 0;
resultatSoustraction->chiffres = NULL;
return resultatSoustraction;
}
// Traitement des cas négatifs
if(nombre1->negatif && nombre2->negatif) { // (-12) - (-11) = 11 - 12
nombre1->negatif = 0;
nombre2->negatif = 0;
temp = soustraction(nombre2, nombre1);
if (!temp)
goto deleteSous;
if (copyNum(temp, resultatSoustraction))
goto deleteTempSous;
deleteNumber(temp);
nombre1->negatif = 1;
nombre2->negatif = 1;
return resultatSoustraction;
}
else if(nombre1->negatif && !nombre2->negatif) { // (-12) - (11) => - 12 - 11 = - (12+11) => addition(12,11) puis je prends le négatif
nombre1->negatif = 0;
temp = addition(nombre1, nombre2);
if (!temp)
goto deleteSous;
if (copyNum(temp, resultatSoustraction))
goto deleteTempSous;
deleteNumber(temp);
nombre1->negatif = 1;
resultatSoustraction->negatif = 1;
return resultatSoustraction;
}
else if (!nombre1->negatif && nombre2->negatif) { // (12) - (-11) => addition(12,11) SEULEMENT
nombre2->negatif = 0;
temp = addition(nombre1, nombre2);
if (!temp)
goto deleteSous;
if (copyNum(temp, resultatSoustraction))
goto deleteTempSous;
deleteNumber(temp);
nombre2->negatif = 1;
return resultatSoustraction;
}
// Si num2 plus grand que num1, par exemple 11 - 12
if (!compareNum(nombre1, nombre2)) { // Si num1 < num2
temp = soustraction(nombre2, nombre1);
if (!temp)
goto deleteSous;
if (copyNum(temp, resultatSoustraction))
goto deleteTempSous;
deleteNumber(temp);
resultatSoustraction->negatif = 1;
return resultatSoustraction;
}
resultatSoustraction->chiffres = NULL;
chiffre1 = nombre1->chiffres; // Pointeur sur le premier chiffre de num1
chiffre2 = nombre2->chiffres; // Pointeur sur le premier chiffre de num2
while(chiffre2) {
// Je fais la soustraction entre les deux chiffres.
soustractionIntermediaire = (chiffre1->chiffre - '0') - ((chiffre2->chiffre - '0') + reste);
if (soustractionIntermediaire < 0) {
soustractionIntermediaire += 10;
reste = 1;
}
else
reste = 0;
if (addTailNum(resultatSoustraction, (char) (soustractionIntermediaire + '0')))
goto deleteSous;
chiffre1 = chiffre1->suivant;
chiffre2 = chiffre2->suivant;
}
while(chiffre1) {
soustractionIntermediaire = (chiffre1->chiffre - '0') - reste;
if (soustractionIntermediaire < 0) {
soustractionIntermediaire += 10;
reste = 1;
}
else
reste = 0;
if (addTailNum(resultatSoustraction, (char) (soustractionIntermediaire + '0')))
goto deleteSous;
chiffre1 = chiffre1->suivant;
}
resultatSoustraction->negatif = 0;
enleverPoidsForts0(resultatSoustraction);
return resultatSoustraction;
deleteSous:
deleteNumber(resultatSoustraction);
return NULL;
deleteTempSous:
deleteNumber(resultatSoustraction);
deleteNumber(temp);
return NULL;
}
num* multiplication(num *nombre1, num *nombre2) {
num* resultatMultiplication = malloc(sizeof(num));
if (!resultatMultiplication)
return NULL;
num *temp;
if (!nombre1->chiffres || !nombre2->chiffres) {
resultatMultiplication->negatif = 0;
resultatMultiplication->chiffres = NULL;
return resultatMultiplication;
}
if (findLenNum(nombre2) > findLenNum(nombre1)) { // Afin de s'assurer que ce soit toujours mon nombre le plus grand en premier.
temp = multiplication(nombre2, nombre1);
if (!temp)
goto deleteResultat;
if (copyNum(temp, resultatMultiplication))
goto deleteTempRes;
deleteNumber(temp);
return resultatMultiplication;
}
resultatMultiplication->negatif = 0;
resultatMultiplication->chiffres = NULL;
num* resultatInter = malloc(sizeof(num));
if (!resultatInter)
goto deleteResultat;
cell* chiffre2 = nombre2->chiffres;
int compteur = -1;
while(chiffre2) {
resultatInter->negatif = 0;
resultatInter->chiffres = NULL;
int i;
for(i = 0; i < chiffre2->chiffre - '0'; i++) { // On fait des additions successives
temp = addition(resultatInter, nombre1);
if (!temp)
goto deleteInterResultat;
deleteChiffres(resultatInter);
if (copyNum(temp, resultatInter))
goto deleteTempInterRes;
deleteNumber(temp);
}
compteur++;
for(i = 0; i < compteur; i++)
if(addHeadNum(resultatInter, '0'))
return NULL; // A chaque fois que l'on passe au nombre suivant, on rajoute un 0 en poids faible de plus
temp = addition(resultatMultiplication, resultatInter); // Addition du résultat intermédiaire obtenu avec le résultat final
if (!temp)
goto deleteInterResultat;
deleteChiffres(resultatMultiplication);
if (copyNum(temp, resultatMultiplication))
goto deleteTempInterRes;
deleteChiffres(resultatInter);
deleteNumber(temp);
chiffre2 = chiffre2->suivant;
}
free(resultatInter);
if (nombre1->negatif^nombre2->negatif)
resultatMultiplication->negatif = 1; // Dans le cas ou l'un des nombre serait négatif
else
resultatMultiplication->negatif = 0;
return resultatMultiplication;
deleteResultat:
deleteNumber(resultatMultiplication);
return NULL;
deleteTempRes:
deleteNumber(resultatMultiplication);
deleteNumber(temp);
return NULL;
deleteInterResultat:
deleteNumber(resultatMultiplication);
deleteNumber(resultatInter);
return NULL;
deleteTempInterRes:
deleteNumber(resultatMultiplication);
deleteNumber(temp);
deleteNumber(resultatInter);
return NULL;
}
void enleverPoidsForts0(num *nombre) {
cell* tail = checkTailNum(nombre);
while (tail && tail->chiffre == '0') {
deleteTailNum(nombre);
tail = checkTailNum(nombre);
}
}
void printRev(cell *chiffre) {
if (!chiffre)
return;
printRev(chiffre->suivant);
printf("%c", chiffre->chiffre);
} // Méthode récursive afin d'imprimer un nombre du bits de poids le plus fort au plus faible (ex: 10000)
void printNumReverse(num *nombre) {
if(!nombre->chiffres) {
printf("0");
return;
}
if(nombre->negatif)
printf("-");
printRev(nombre->chiffres);
} // Ajout du signe du nombre, et appel à printRev pour imprimer le nombre.
int findLenNum(num *nombre) {
int longueur = 0;
cell* p = nombre->chiffres;
while(p) {
longueur++;
p = p->suivant;
}
return longueur;
} // Permet de trouve la longueur d'un nombre en terme de chiffres.
int compareNum(num *nombre1, num *nombre2) { // Renvoie 0 si nombre1 < num2, ou 1 si nombre1 >= num2
cell* pointeur1 = nombre1->chiffres;
cell* pointeur2 = nombre2->chiffres;
if(!pointeur1 && !pointeur2)
return 1; // Cas 0 et 0
else if(pointeur1 && !pointeur2) { // cas -13 et 0 et 13 et 0;
if (nombre1->negatif)
return 0;
return 1;
}
else if(!pointeur1) { // Cas 0 et -13 OU 0 et 13
if(nombre2->negatif)
return 1;
return 0;
}
if(nombre1->negatif && !nombre2->negatif)
return 0; // -124 et 12 par exemple
else if (!nombre1->negatif && nombre2->negatif)
return 1; // 124 et -12 par exemple
int longueurNum1 = findLenNum(nombre1);
int longueurNum2 = findLenNum(nombre2);
if(longueurNum1 > longueurNum2 && nombre1->negatif && nombre2->negatif)
return 0; // Donc -1344 et -35, donc nombre1 < num2
else if(longueurNum1 > longueurNum2 && !nombre1->negatif && !nombre2->negatif)
return 1; // Donc 1344 et 35
else if (longueurNum1 < longueurNum2 && nombre1->negatif && nombre2->negatif)
return 1; // Donc -34 et -1344
else if (longueurNum1 < longueurNum2 && !nombre1->negatif && !nombre2->negatif)
return 0; // Donc 34 et 1344
int compteur = 0;
int i = 0;
// Les deux nombres sont donc de la même taille en longueur, et de même signe
while(1) {
pointeur1 = nombre1->chiffres;
pointeur2 = nombre2->chiffres;
while(i < longueurNum1 - 1 - compteur) { // Sinon on a deux chiffres de même longueur. On compare les chiffres 1 à 1 du poids le plus fort au plus faible.
pointeur1 = pointeur1->suivant;
pointeur2 = pointeur2->suivant;
i++;
}
if (pointeur1->chiffre - '0' == pointeur2->chiffre - '0') {
compteur++;
i = 0;
if(compteur == longueurNum1)
return 1; // On atteint la début de notre chaîne et tout est égal, alors 1
}
else if (pointeur1->chiffre - '0' > pointeur2->chiffre - '0') {
if(nombre1->negatif)
return 0;
return 1;
}
else if (pointeur1->chiffre - '0' < pointeur2->chiffre - '0') {
if(nombre1->negatif)
return 1;
return 0;
}
}
} // Renvoie 0 si nombre1 < nombre2, ou 1 si nombre1 >= nombre2
int isEqual(num *nombre1, num *nombre2) {
if (!nombre1 || !nombre2)
return 0;
cell* pointeur1 = nombre1->chiffres;
cell* pointeur2 = nombre2->chiffres;
int compteur = 0;
int i = 0;
if(!pointeur1 && !pointeur2)
return 1; // Cas 0 et 0
else if (!pointeur1 || !pointeur2)
return 0;
if (nombre1->negatif != nombre2->negatif)
return 0;
int longueurNum1 = findLenNum(nombre1);
int longueurNum2 = findLenNum(nombre2);
if (longueurNum1 != longueurNum2)
return 0;
while(1) {
pointeur1 = nombre1->chiffres;
pointeur2 = nombre2->chiffres;
while(i < longueurNum1 - 1 - compteur) { // Sinon on a deux chiffres de même longueur. On compare les chiffres 1 à 1 du poids le plus fort au plus faible.
pointeur1 = pointeur1->suivant;
pointeur2 = pointeur2->suivant;
i++;
}
if (pointeur1->chiffre - '0' == pointeur2->chiffre - '0') {
compteur++;
i = 0;
if(compteur == longueurNum1)
return 1; // On atteint la début de notre chaîne et tout est égal, alors 1
}
else if (pointeur1->chiffre - '0' != pointeur2->chiffre - '0')
return 0;
}
} // Renvoie 1 si num1 == num2,
cell* checkTailNum(num *nombre) {
cell* temp = nombre->chiffres;
if(!temp)
return NULL;
while(temp->suivant)
temp = temp->suivant;
return temp;
} // checkTailNum retourne le bit de poids le plus fort d'un num.
int addHeadNum(num *nombre, char chiffre) {
cell *nouveau_chiffre = malloc(sizeof(cell));
if (!nouveau_chiffre)
return 1;
nouveau_chiffre->chiffre = chiffre;
nouveau_chiffre->suivant = nombre->chiffres;
nombre->chiffres = nouveau_chiffre;
return 0;
} // Ajoute un chiffre au poids le plus faible du nombre (dans le cas de la multiplication, 0)
int addTailNum(num *nombre, char chiffre) { // Ajouter un nombre au poid le plus fort.
cell *nouveau_chiffre = malloc(sizeof(cell));
if (!nouveau_chiffre)
return 1; // Out of memory
nouveau_chiffre->chiffre = chiffre;
if(!nombre->chiffres) {
nouveau_chiffre->suivant = nombre->chiffres; // on pointe le noeud tête
nombre->chiffres = nouveau_chiffre; // Ajout du noeud dans la liste
}
else {
cell* p = nombre->chiffres;
while(p->suivant)
p = p->suivant;
p->suivant = nouveau_chiffre; // Suivant pointe sur le nouveau chiffre;
nouveau_chiffre->suivant = NULL;
}
return 0;
} // Ajoute un chiffre de poids le plus fort au nombre. Utilisé dans les opérations.
void deleteTailNum(num *nombre) {
cell* temp;
cell* p = nombre->chiffres;
if (!p)
return;
else if (!p->suivant) {
free(p);
nombre->chiffres = NULL;
}
else {
while(p->suivant->suivant)
p = p->suivant;
temp = p->suivant;
p->suivant = NULL;
free(temp);
}
}
void deleteNumber(num *nombre) {
if (!nombre) return;
cell* p = nombre->chiffres;
cell* suivant;
while (p)
{
suivant = p->suivant;
free(p);
p = suivant;
}
free(nombre);
}
void deleteChiffres(num *nombre) {
if (!nombre) return;
cell* p = nombre->chiffres;
cell* suivant;
while (p)
{
suivant = p->suivant;
free(p);
p = suivant;
}
}
int copyNum(num* srcNum, num* destNum) {
if (!srcNum)
return 1; // Out of memory
destNum->chiffres = NULL;
destNum->negatif = srcNum->negatif;
cell *p = srcNum->chiffres;
while(p) {
if (addTailNum(destNum, p->chiffre))
return 1; // Out of memory
p = p->suivant;
}
return 0; // OK
}
num* checkMem(num *nombre, memoire* mem) {
variable *ptr = mem->tete;
while(ptr) {
if (isEqual(nombre, ptr->nombre))
return ptr->nombre; // On a trouvé un nombre égal à num1 dans la pile
ptr = ptr->suivant;
}
return NULL;
}
variable* rechercherVar(memoire* mem, char var) { // Retourne le noeud contenant la variable si présent
variable* ptr = mem->tete;
while (ptr) {
if (ptr->var == var)
return ptr;
ptr = ptr->suivant;
}
return ptr;
}
int affecterVal(memoire* mem, char var, num* nombre) { // Trouver la variable 'x' et met la valeur. Si non présente, on ajoute une nouvelle valeur.
variable *ptr = rechercherVar(mem, var);
if (ptr) {
ptr->nombre->compteurRef--;
if (!ptr->nombre->compteurRef)
deleteNumber(ptr->nombre);
ptr->nombre = nombre;
ptr->nombre->compteurRef++;
return 0; //OK
}
else {
ptr = malloc(sizeof(variable));
if (!ptr)
return 1; // Out of memory
ptr->var = var;
ptr->nombre = nombre;
ptr->nombre->compteurRef++;
if (!mem->tete) {
mem->tete = ptr;
ptr->suivant = NULL;
}
else {
ptr->suivant = mem->tete;
mem->tete = ptr;
}
return 0; //OK
}
}
int retablirValeurs(memoire* buf, memoire* mem) { // Rétablir la valeur des variables en memoire a partir du buf si tout est OK.
variable *ptr = buf->tete; // Ajouter les nouvelles variables si nécessaires si elles n,existent pas en memoire.
int longueur = 0;
// Afin d'être sûr que le rétablissement de la mémoire se fera sans problème.
// Si un échec appairaissait lors de l'affectation des valeurs à la mémoire principale, la mémoire principale contiendrait des valeurs
// issus du buffer, alors que l'on préfère garantir l'intégrite des données en mémoire principale.
// Ainsi on test qu'il y assez de blocs mémoires disponibles pour le rétablissement des valeurs.
while(ptr) {
longueur++;
ptr = ptr->suivant;
}
// Test qu'il n'y aura aucun problème d'allocation au moment du rétablissement des valeurs.
void *test = malloc(sizeof(variable)*longueur);
if (!test)
return 1;
else free(test);
ptr = buf->tete;
if (!ptr)
return 0; // Il n'y a rien à rétablir à partir du buffer.
while (ptr) {
if (affecterVal(mem, ptr->var, ptr->nombre))
return 1; // Out of memory
ptr = ptr->suivant;
}
return 0;
}
void deleteMem(memoire *mem, num *nombre) {
variable* ptr;
ptr = mem->tete;
variable* temp;
while (ptr) {
temp = ptr->suivant;
ptr->nombre->compteurRef--;
if (!ptr->nombre->compteurRef && !isEqual(ptr->nombre, nombre))
deleteNumber(ptr->nombre);
free(ptr);
ptr = temp;
}
free(mem);
} |
the_stack_data/34512885.c | // Performance test for the leak checker from bug #191182.
// Nb: it must be run with --leak-resolution=high to show the quadratic
// behaviour caused by the large number of loss records.
// By Philippe Waroquiers.
//
// On my machine, before being fixed, building the loss record list took about
// 36 seconds, and sorting + printing it took about 20 seconds. After being
// fixed it took about 2 seconds, and the leak checking was only a small
// fraction of that. --njn
#include <stdlib.h>
#include <strings.h>
#include <stdio.h>
#include <math.h>
/* parameters */
/* we will create stack_fan_out ^ stack_depth different call stacks */
int stack_fan_out = 15;
int stack_depth = 4;
/* for each call stack, allocate malloc_fan blocks */
int malloc_fan = 4;
/* for each call stack, allocate data structures having malloc_depth
indirection at each malloc-ed level */
int malloc_depth = 2;
/* in addition to the pointer needed to maintain the levels; some more
bytes are allocated simulating the data stored in the data structure */
int malloc_data = 5;
/* every n top blocks, 1 block and all its children will be freed instead of
being kept */
int free_every_n = 2;
/* every n release block operation, 1 block and its children will be leaked */
int leak_every_n = 250;
struct Chunk {
struct Chunk* child;
char s[];
};
struct Chunk** topblocks;
int freetop = 0;
/* statistics */
long total_malloced = 0;
int blocknr = 0;
int blockfreed = 0;
int blockleaked = 0;
int total_stacks = 0;
int releaseop = 0;
void free_chunks (struct Chunk ** mem)
{
if (*mem == 0)
return;
free_chunks ((&(*mem)->child));
blockfreed++;
free (*mem);
*mem = 0;
}
void release (struct Chunk ** mem)
{
releaseop++;
if (releaseop % leak_every_n == 0) {
blockleaked++;
*mem = 0; // lose the pointer without free-ing the blocks
} else {
free_chunks (mem);
}
}
void call_stack (int level)
{
int call_fan_out = 1;
if (level == stack_depth) {
int sz = sizeof(struct Chunk*) + malloc_data;
int d;
int f;
for (f = 0; f < malloc_fan; f++) {
struct Chunk *new = NULL; // shut gcc up
struct Chunk *prev = NULL;
for (d = 0; d < malloc_depth; d++) {
new = malloc (sz);
total_malloced += sz;
blocknr++;
new->child = prev;
prev = new;
}
topblocks[freetop] = new;
if (freetop % free_every_n == 0) {
release (&topblocks[freetop]);
}
freetop++;
}
total_stacks++;
} else {
/* Nb: don't common these up into a loop! We need different code
locations to exercise the problem. */
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
call_stack (level + 1);
if (call_fan_out == stack_fan_out) return;
call_fan_out++;
printf ("maximum stack_fan_out exceeded\n");
}
}
int main()
{
int d;
int stacks = 1;
for (d = 0; d < stack_depth; d++)
stacks *= stack_fan_out;
printf ("will generate %d different stacks\n", stacks);
topblocks = malloc(sizeof(struct Chunk*) * stacks * malloc_fan);
call_stack (0);
printf ("total stacks %d\n", total_stacks);
printf ("total bytes malloc-ed: %ld\n", total_malloced);
printf ("total blocks malloc-ed: %d\n", blocknr);
printf ("total blocks free-ed: %d\n", blockfreed);
printf ("total blocks leak-ed: %d\n", blockleaked);
return 0;
}
|
the_stack_data/50137398.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXS 20
/*
ES3.
Definire un tipo di dato per una lista dinamica di parole, dove ciascuna
parola è lunga al massimo 20 caratteri. Realizzare i sottoprogrammi standard
per la gestione di una lista di parole, in particolare per l'inserimento in
coda di un nuovo elemento, la visualizzazione del contenuto della lista, il
calcolo della lunghezza della lista e la sua distruzione. Scrivere un
programma che riceve come argomenti i nomi di due file di testo, ciascuno
contenente una sequenza di lunghezza indefinita di parole di al massimo 20
caratteri. Il programma carica le due sequenze in due liste dinamiche s1 e s2.
In seguito, il sottoprogramma verifica se s1 è sottosequenza di s2 o,
viceversa se s2 è sottosequenza di s1, e stampa a video i risultati dei test
(1 o 0); si noti che se almeno una delle due liste è vuota l'esito è negativo.
Prima di terminare il programma libera tutta la memoria allocata. Visualizzare
opportuni messaggi nel caso di errore (es: argomenti mancanti, memoria non
allocata correttamente, file non aperto, ...). Si consiglia di suddividere
opportunamente il programma in sottoprogrammi.
*/
typedef struct nodo_ {
char str[MAXS + 1];
struct nodo_ *next;
} nodo_t;
nodo_t *inserisciInCoda(nodo_t *h, char *str);
void visualizza(nodo_t *h);
int lunghezza(nodo_t *h);
nodo_t *distruggi(nodo_t *h);
nodo_t *acquisisci(FILE *fp);
int verificaSubSeq(nodo_t *h, nodo_t *sub);
int main(int argc, char **argv) {
FILE *fp1, *fp2;
nodo_t *s1, *s2;
int tmp;
if (argc == 3) {
fp1 = fopen(argv[1], "r");
if (fp1) {
fp2 = fopen(argv[2], "r");
if (fp2) {
s1 = acquisisci(fp1);
s2 = acquisisci(fp2);
printf("s1: ");
visualizza(s1);
printf("s2: ");
visualizza(s2);
tmp = verificaSubSeq(s1, s2);
printf("s2 subseq di s1: %d\n", tmp);
tmp = verificaSubSeq(s2, s1);
printf("s1 subseq di s2: %d\n", tmp);
s1 = distruggi(s1);
s2 = distruggi(s2);
fclose(fp2);
} else
printf("Errore apertura file 2.\n");
fclose(fp1);
} else
printf("Errore apertura file 1.\n");
} else
printf("Errore argomenti.\n");
return 0;
}
nodo_t *inserisciInCoda(nodo_t *h, char *str) {
nodo_t *tmp, *last;
tmp = malloc(sizeof(nodo_t));
if (tmp) {
strcpy(tmp->str, str);
tmp->next = NULL;
if (h) {
for (last = h; last && last->next; last = last->next)
;
last->next = tmp;
} else
h = tmp;
} else
printf("Errore allocazione.\n");
return h;
}
void visualizza(nodo_t *h) {
for (; h; h = h->next)
printf("%s ", h->str);
printf("\n");
}
int lunghezza(nodo_t *h) {
int count;
for (count = 0; h; h = h->next)
count++;
return count;
}
nodo_t *distruggi(nodo_t *h) {
nodo_t *tmp;
while (h) {
tmp = h;
h = h->next;
free(tmp);
}
return NULL;
}
nodo_t *acquisisci(FILE *fp) {
nodo_t *h;
char str[MAXS + 1];
h = NULL;
fscanf(fp, "%s", str);
while (!feof(fp)) {
h = inserisciInCoda(h, str);
fscanf(fp, "%s", str);
}
return h;
}
int verificaSubSeq(nodo_t *h, nodo_t *sub) {
int valid, res, oneIsEmpty;
nodo_t *tmpH, *tmpSub;
oneIsEmpty = !(lunghezza(h) && lunghezza(sub));
for (res = 0; h && !res && !oneIsEmpty; h = h->next) {
for (valid = 1, tmpH = h, tmpSub = sub; valid && tmpH && tmpSub;
tmpH = tmpH->next, tmpSub = tmpSub->next) {
if (strcmp(tmpH->str, tmpSub->str))
valid = 0;
}
if (valid && !tmpSub)
res = 1;
}
return res;
}
|
the_stack_data/115765258.c | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{ int n,i;
scanf("%d",&n);
for(i=1;i<=n;i++)
printf("*");
printf("\n");
system("PAUSE");
return 0;
}
|
the_stack_data/107952589.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <poll.h>
#include <sys/epoll.h>
#define BUF_SIZE 200
int main(int argc, char *argv[])
{
int sock_fd, conn_fd;
struct sockaddr_in server_addr;
char buff[BUF_SIZE];
int ret;
int port_number = 2047;
// 创建socket描述符
if ((sock_fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
fprintf(stderr,"Socket error:%s\n\a", strerror(errno));
exit(1);
}
// 填充sockaddr_in结构
bzero(&server_addr, sizeof(struct sockaddr_in));
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
server_addr.sin_port = htons(port_number);
// 绑定sock_fd描述符
if (bind(sock_fd, (struct sockaddr *)(&server_addr), sizeof(struct sockaddr)) == -1) {
fprintf(stderr,"Bind error:%s\n\a", strerror(errno));
exit(1);
}
// 监听sock_fd描述符
if(listen(sock_fd, 5) == -1) {
fprintf(stderr,"Listen error:%s\n\a", strerror(errno));
exit(1);
}
int i;
int conn_num = 5; //连接数
int timeout = 3000; //超时时间
struct epoll_event eventList[conn_num]; //事件数组
// epoll创建并初始化
int epollfd = epoll_create(conn_num);
// 将socket描述符添加到epoll监听
struct epoll_event event;
event.events = EPOLLIN|EPOLLET; // 可读和边缘触发(通知一次,不管有没有处理)
event.data.fd = sock_fd;
if(epoll_ctl(epollfd, EPOLL_CTL_ADD, sock_fd, &event) < 0) {
printf("epoll add fail : fd = %d\n", sock_fd);
exit(1);
}
while(1) {
// 获取epoll监听中活跃的描述符
int active_num = epoll_wait(epollfd, eventList, conn_num, timeout);
printf ( "active_num: %d\n", active_num);
if(active_num < 0) {
printf("epoll wait error\n");
break;
} else if(active_num == 0) {
printf("timeout ...\n");
continue;
}
//直接获取了事件数量,给出了活动的流,这里是和poll区别的关键
for(i = 0; i < active_num; i++) {
// 非可读跳过
if (!(eventList[i].events & EPOLLIN)) {
printf ( "event: %d\n", eventList[i].events);
continue;
}
// 判断是否新连接
if (eventList[i].data.fd == sock_fd) {
conn_fd = accept(sock_fd, (struct sockaddr *)NULL, NULL);
if (conn_fd < 0) {
printf("accept error\n");
continue;
}
printf("Accept Connection: %d\n", conn_fd);
//将新建立的连接添加到epoll的监听中
struct epoll_event event;
event.data.fd = conn_fd;
event.events = EPOLLIN|EPOLLET;
epoll_ctl(epollfd, EPOLL_CTL_ADD, conn_fd, &event);
} else {
// 接受数据
ret = recv(eventList[i].data.fd, buff, BUF_SIZE, 0);
if (ret <= 0) {
// 客户端关闭
printf("client[%d] close\n", i);
close(eventList[i].data.fd);
// 删除监听
epoll_ctl(epollfd, EPOLL_CTL_DEL, eventList[i].data.fd, NULL);
} else {
// 添加结束符
if (ret < BUF_SIZE) {
memset(&buff[ret], '\0', 1);
}
printf("client[%d] send:%s\n", i, buff);
// 发送数据
send(eventList[i].data.fd, "Hello", 6, 0);
}
}
}
}
// 关闭连接
close(epollfd);
close(sock_fd);
exit(0);
} |
the_stack_data/82678.c | #include <assert.h>
#include <string.h>
struct blob
{
unsigned dummy;
unsigned bit : 1;
};
int main()
{
struct blob b;
struct blob b1 = b;
// Perform byte-wise updates of the struct, up to its full size. Constant
// propagation made impossible, and thus the byte updates need to be handled
// by the back-end.
if(b.dummy <= sizeof(struct blob))
memset(&b, 0, b.dummy);
// If we updated the complete struct, then the single-bit bit-field needs to
// have been set to zero as well. This makes sure that the encoding of byte
// update properly handles fields that are smaller than bytes.
assert(b1.dummy != sizeof(struct blob) || b.bit == 0);
}
|
the_stack_data/92326861.c | #include <string.h>
#include <stdio.h>
void reverse(char *str) {
char tmp;
int len;
len = strlen(str);
for (int i = 0; i < len / 2; i++) {
tmp = str[i];
str[i] = str[len - (i + 1)];
str[len - (i + 1)] = tmp;
}
}
int main(int argc, char **argv) {
if (argc > 1) {
reverse(argv[1]);
printf("%s\n", argv[1]);
return 0;
}
printf("Not enougth arguments\n");
return 1;
}
|
the_stack_data/154832062.c | # include <stdio.h>
# include <stdlib.h>
typedef struct MyLinkedList {
int data;
struct MyLinkedList *next;
} MyLinkedList;
/** Initialize your data structure here. */
MyLinkedList* myLinkedListCreate() {
MyLinkedList *A = (MyLinkedList*)malloc(sizeof(MyLinkedList));
A -> data = 0;
A -> next = NULL;
return A;
}
/** Get the value of the index-th node in the linked list. If the index is invalid, return -1. */
int myLinkedListGet(MyLinkedList* obj, int index) {
int i = 0;
MyLinkedList *p = obj;
if (index < 0) {
return -1;
}
while (i <= index) {
p = p -> next;
if (p == NULL) {
return -1;
}
++i;
}
return p -> data;
}
/** Add a node of value val before the first element of the linked list. After the insertion, the new node will be the first node of the linked list. */
void myLinkedListAddAtHead(MyLinkedList* obj, int val) {
MyLinkedList *node = (MyLinkedList*)malloc(sizeof(MyLinkedList));
node -> data = val;
node -> next = obj -> next;
obj -> next = node;
}
/** Append a node of value val to the last element of the linked list. */
void myLinkedListAddAtTail(MyLinkedList* obj, int val) {
MyLinkedList *p = obj;
MyLinkedList *node = (MyLinkedList*)malloc(sizeof(MyLinkedList));
node -> data = val;
node -> next = NULL;
while (p -> next != NULL) {
p = p -> next;
}
p -> next = node;
}
/** Add a node of value val before the index-th node in the linked list. If index equals to the length of linked list, the node will be appended to the end of linked list. If index is greater than the length, the node will not be inserted. */
void myLinkedListAddAtIndex(MyLinkedList* obj, int index, int val) {
int i = 0;
MyLinkedList *p = obj;
MyLinkedList *node = (MyLinkedList*)malloc(sizeof(MyLinkedList));
node -> data = val;
while (i < index) {
p = p -> next;
if (p == NULL) {
return;
}
++i;
}
node -> next = p -> next;
p -> next = node;
}
/** Delete the index-th node in the linked list, if the index is valid. */
void myLinkedListDeleteAtIndex(MyLinkedList* obj, int index) {
int i = 0;
MyLinkedList *p = obj;
MyLinkedList *q;
if(index < 0 || p -> next == NULL) {
return;
}
while (i < index) {
p = p -> next;
if (p -> next == NULL) {
return;
}
++i;
}
q = p -> next;
p -> next = q -> next;
free(q);
}
void myLinkedListFree(MyLinkedList* obj) {
MyLinkedList *p;
while (obj != NULL) {
p = obj;
obj = obj -> next;
free(p);
}
}
/**
* Your MyLinkedList struct will be instantiated and called as such:
* MyLinkedList* obj = myLinkedListCreate();
* int param_1 = myLinkedListGet(obj, index);
* myLinkedListAddAtHead(obj, val);
* myLinkedListAddAtTail(obj, val);
* myLinkedListAddAtIndex(obj, index, val);
* myLinkedListDeleteAtIndex(obj, index);
* myLinkedListFree(obj);
*/
int main() {
MyLinkedList* obj = myLinkedListCreate();
MyLinkedList* p =obj;
myLinkedListAddAtHead(obj, 1);
myLinkedListAddAtTail(obj, 3);
myLinkedListAddAtIndex(obj, 1, 2);
myLinkedListGet(obj, 1);
myLinkedListDeleteAtIndex(obj, 1);
myLinkedListGet(obj, 1);
while (p!=NULL) {
printf("%d,",p->data);
p = p->next;
}
myLinkedListFree(obj);
return 0;
}
|
the_stack_data/73575923.c | /*
* Font Packer
*
* This program packs a 4 bit left shifted font so that
* two characters are stored in a single one.
* The resulting font can be used with the TI calculators and
* the ZX Spectrum in ANSI VT mode building the libraries with
* the -DPACKEDFONT flag set.
*
* Example: fontpack F4.BIN F4PACK.BIN
*
* Stefano 6/6/2002
*
* $Id: fontpack.c,v 1.1 2002/06/07 09:01:50 stefano Exp $
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
unsigned char mychar[8];
FILE *fpin, *fpout;
int x;
int c;
int i;
int len;
if ((argc < 3 )||(argc > 4 )) {
fprintf(stdout,"Usage: %s [input 4 bit font] [output packed font] \n",argv[0]);
exit(1);
}
if ( (fpin=fopen(argv[1],"rb") ) == NULL ) {
printf("Can't open input file\n");
exit(1);
}
/*
* Now we try to determine the size of the input font
*/
if (fseek(fpin,0,SEEK_END)) {
printf("Couldn't determine size of file\n");
fclose(fpin);
exit(1);
}
len=ftell(fpin);
fseek(fpin,0L,SEEK_SET);
if ( (fpout=fopen(argv[2],"w+b") ) == NULL ) {
printf("Can't open output file\n");
exit(1);
}
for (x=0; x<(len/16); x++) {
//EVEN CHAR
for (i=0; i<8;i++)
mychar[i]=getc(fpin);
//ODD CHAR
for (i=0; i<8;i++)
mychar[i]=mychar[i]+(unsigned char)(getc(fpin)/16);
//Write packed char loop
for (i=0; i<8;i++)
fputc(mychar[i],fpout);
}
fclose(fpin);
fclose(fpout);
}
|
the_stack_data/45478.c | #include <stdio.h>
#include <locale.h>
int main()
{
setlocale(LC_ALL, "Portuguese");
int ddd;
printf("Informe o DDD: ");
scanf("%i", &ddd);
fflush(stdin);
switch (ddd)
{
case 61:
printf("DDD %i, Brasilia", ddd);
break;
case 71:
printf("DDD %i, Salvador", ddd);
break;
case 11:
printf("DDD %i, Sao Paulo", ddd);
break;
case 21:
printf("DDD %i, Rio de Janeiro", ddd);
break;
case 32:
printf("DDD %i, Juiz de Fora", ddd);
break;
case 19:
printf("DDD %i, Campinas", ddd);
break;
case 27:
printf("DDD %i, Vitoria", ddd);
break;
case 31:
printf("DDD %i, Belo Horizonte", ddd);
break;
default:
printf("DDD %i, Invalido", ddd);
}
return 0;
}
|
the_stack_data/124803.c | //Classification: #default/n/IVO/UIM/aA+aS/D(v)/fr/rp
//Written by: Igor Eremeev
//Reviewed by: Sergey Pomelov
//Comment:
#include <stdio.h>
int* func() {
int a[10], i, *p = &a[7];
for (i = 0; i<5; i++) {
a[i]=i;
}
return p;
}
int main(void)
{
printf ("%d", *func());
return 0;
}
|
the_stack_data/1132190.c | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct ship{
char color[10];
}boat1, boat2;
int main(){
strcpy(boat1.color, "RED");
printf("%s ", boat1.color);
boat2= boat1;
strcpy(boat2.color, "YELLOW");
printf("%s", boat1.color);
return 0;
} |
the_stack_data/107953601.c | #include <sys/time.h>
#include <sys/resource.h>
int main() {
struct rusage u;
getrusage(0, &u);
return 0;
}
|
the_stack_data/162642803.c | // KMSAN: uninit-value in sha_transform
// https://syzkaller.appspot.com/bug?id=2b66985d58dd6ae758c6db40a1475455a439ce88
// status:invalid
// autogenerated by syzkaller (http://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <endian.h>
#include <errno.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/capability.h>
#include <sched.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
__attribute__((noreturn)) static void doexit(int status)
{
volatile unsigned i;
syscall(__NR_exit_group, status);
for (i = 0;; i++) {
}
}
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
const int kFailStatus = 67;
const int kRetryStatus = 69;
static void fail(const char* msg, ...)
{
int e = errno;
va_list args;
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
fprintf(stderr, " (errno %d)\n", e);
doexit((e == ENOMEM || e == EAGAIN) ? kRetryStatus : kFailStatus);
}
static void use_temporary_dir()
{
char tmpdir_template[] = "./syzkaller.XXXXXX";
char* tmpdir = mkdtemp(tmpdir_template);
if (!tmpdir)
fail("failed to mkdtemp");
if (chmod(tmpdir, 0777))
fail("failed to chmod");
if (chdir(tmpdir))
fail("failed to chdir");
}
static bool write_file(const char* file, const char* what, ...)
{
char buf[1024];
va_list args;
va_start(args, what);
vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
buf[sizeof(buf) - 1] = 0;
int len = strlen(buf);
int fd = open(file, O_WRONLY | O_CLOEXEC);
if (fd == -1)
return false;
if (write(fd, buf, len) != len) {
int err = errno;
close(fd);
errno = err;
return false;
}
close(fd);
return true;
}
static void loop();
static void sandbox_common()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
setpgrp();
setsid();
struct rlimit rlim;
rlim.rlim_cur = rlim.rlim_max = 128 << 20;
setrlimit(RLIMIT_AS, &rlim);
rlim.rlim_cur = rlim.rlim_max = 8 << 20;
setrlimit(RLIMIT_MEMLOCK, &rlim);
rlim.rlim_cur = rlim.rlim_max = 32 << 20;
setrlimit(RLIMIT_FSIZE, &rlim);
rlim.rlim_cur = rlim.rlim_max = 1 << 20;
setrlimit(RLIMIT_STACK, &rlim);
rlim.rlim_cur = rlim.rlim_max = 0;
setrlimit(RLIMIT_CORE, &rlim);
if (unshare(CLONE_NEWNS)) {
}
if (unshare(CLONE_NEWIPC)) {
}
if (unshare(0x02000000)) {
}
if (unshare(CLONE_NEWUTS)) {
}
if (unshare(CLONE_SYSVSEM)) {
}
}
static int real_uid;
static int real_gid;
__attribute__((aligned(64 << 10))) static char sandbox_stack[1 << 20];
static int namespace_sandbox_proc(void* arg)
{
sandbox_common();
write_file("/proc/self/setgroups", "deny");
if (!write_file("/proc/self/uid_map", "0 %d 1\n", real_uid))
fail("write of /proc/self/uid_map failed");
if (!write_file("/proc/self/gid_map", "0 %d 1\n", real_gid))
fail("write of /proc/self/gid_map failed");
if (unshare(CLONE_NEWNET))
fail("unshare(CLONE_NEWNET)");
if (mkdir("./syz-tmp", 0777))
fail("mkdir(syz-tmp) failed");
if (mount("", "./syz-tmp", "tmpfs", 0, NULL))
fail("mount(tmpfs) failed");
if (mkdir("./syz-tmp/newroot", 0777))
fail("mkdir failed");
if (mkdir("./syz-tmp/newroot/dev", 0700))
fail("mkdir failed");
unsigned mount_flags = MS_BIND | MS_REC | MS_PRIVATE;
if (mount("/dev", "./syz-tmp/newroot/dev", NULL, mount_flags, NULL))
fail("mount(dev) failed");
if (mkdir("./syz-tmp/newroot/proc", 0700))
fail("mkdir failed");
if (mount(NULL, "./syz-tmp/newroot/proc", "proc", 0, NULL))
fail("mount(proc) failed");
if (mkdir("./syz-tmp/newroot/selinux", 0700))
fail("mkdir failed");
const char* selinux_path = "./syz-tmp/newroot/selinux";
if (mount("/selinux", selinux_path, NULL, mount_flags, NULL)) {
if (errno != ENOENT)
fail("mount(/selinux) failed");
if (mount("/sys/fs/selinux", selinux_path, NULL, mount_flags, NULL) &&
errno != ENOENT)
fail("mount(/sys/fs/selinux) failed");
}
if (mkdir("./syz-tmp/newroot/sys", 0700))
fail("mkdir failed");
if (mount(NULL, "./syz-tmp/newroot/sys", "sysfs", 0, NULL))
fail("mount(sysfs) failed");
if (mkdir("./syz-tmp/pivot", 0777))
fail("mkdir failed");
if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) {
if (chdir("./syz-tmp"))
fail("chdir failed");
} else {
if (chdir("/"))
fail("chdir failed");
if (umount2("./pivot", MNT_DETACH))
fail("umount failed");
}
if (chroot("./newroot"))
fail("chroot failed");
if (chdir("/"))
fail("chdir failed");
struct __user_cap_header_struct cap_hdr = {};
struct __user_cap_data_struct cap_data[2] = {};
cap_hdr.version = _LINUX_CAPABILITY_VERSION_3;
cap_hdr.pid = getpid();
if (syscall(SYS_capget, &cap_hdr, &cap_data))
fail("capget failed");
cap_data[0].effective &= ~(1 << CAP_SYS_PTRACE);
cap_data[0].permitted &= ~(1 << CAP_SYS_PTRACE);
cap_data[0].inheritable &= ~(1 << CAP_SYS_PTRACE);
if (syscall(SYS_capset, &cap_hdr, &cap_data))
fail("capset failed");
loop();
doexit(1);
}
static int do_sandbox_namespace(void)
{
int pid;
real_uid = getuid();
real_gid = getgid();
mprotect(sandbox_stack, 4096, PROT_NONE);
pid =
clone(namespace_sandbox_proc, &sandbox_stack[sizeof(sandbox_stack) - 64],
CLONE_NEWUSER | CLONE_NEWPID, 0);
if (pid < 0)
fail("sandbox clone failed");
return pid;
}
uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};
void loop()
{
long res = 0;
res = syscall(__NR_socket, 0x26, 5, 0);
if (res != -1)
r[0] = res;
*(uint16_t*)0x20276000 = 0x26;
memcpy((void*)0x20276002,
"\x68\x61\x73\x68\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 14);
*(uint32_t*)0x20276010 = 0;
*(uint32_t*)0x20276014 = 0;
memcpy((void*)0x20276018,
"\x73\x68\x61\x31\x2d\x67\x65\x6e\x65\x72\x69\x63\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
64);
syscall(__NR_bind, r[0], 0x20276000, 0x58);
res = syscall(__NR_accept, r[0], 0, 0);
if (res != -1)
r[1] = res;
memcpy((void*)0x204b8ff8, "./file0", 8);
res = syscall(__NR_open, 0x204b8ff8, 0x28042, 0);
if (res != -1)
r[2] = res;
syscall(__NR_fallocate, r[2], 0, 0, 0x73e0);
*(uint64_t*)0x20e64ff8 = 0;
syscall(__NR_sendfile, r[1], r[2], 0x20e64ff8, 0x8e18);
}
int main()
{
syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
use_temporary_dir();
int pid = do_sandbox_namespace();
int status = 0;
while (waitpid(pid, &status, __WALL) != pid) {
}
return 0;
}
|
the_stack_data/100140550.c | #include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
struct Person {
char *name;
int age;
int height;
int weight;
};
struct Person *Person_create(char *name, int age, int height, int weight) {
struct Person *who = malloc(sizeof(struct Person));
assert(who != NULL);
who->name = strdup(name);
who->age = age;
who->height = height;
who->weight = weight;
return who;
}
void Person_destroy(struct Person *who) {
assert(who != NULL);
free(who->name);
free(who);
}
void Person_print(struct Person *who) {
printf("Name: %s\n", who->name);
printf("Age: %d\n", who->age);
printf("Height: %d\n", who->height);
printf("Weight: %d\n", who->weight);
}
int main(int argc, char *argv[]) {
// make two people structures
struct Person *joe = Person_create("Joe Alex", 32, 64, 140);
struct Person *frank = Person_create("Frank Blank", 20, 72, 180);
// print them out and where they are in memory
printf("Joe is at memory location %p:\n", joe);
Person_print(joe);
printf("Frank is at memory location %p:\n", frank);
Person_print(frank);
// make everyone age 20 years and print them again
joe->age +=20;
joe->height -= 2;
joe->weight += 40;
Person_print(joe);
frank->age += 20;
frank->weight += 20;
Person_print(frank);
// destroy them both so we clean up
Person_destroy(joe);
Person_destroy(frank);
return 0;
}
|
the_stack_data/92324532.c | /**
* ppjC je programski jezik podskup jezika C definiran u dokumentu
* https://github.com/fer-ppj/ppj-labosi/raw/master/upute/ppj-labos-upute.pdf
*
* ova skripta poziva ppjC kompajler (za sada samo analizator) pritiskom
* na tipku [Ctrl+S], [Shift+Enter] ili [Alt+3] i prikazuje rezultat analize.
*
* ne garantiram tocnost leksera, sintaksnog niti semantickog analizatora koji
* se ovdje pokrece.
*
* URL skripte prati verzije izvornog programa, tako da je moguca razmjena
* izvornih programa u timu putem URL-ova.
*/
int printf(const char format[]) {
/* i wish i could printf */
return 0;
}
int main(void) {
char c = 'a';
int a['a'];
return 0;
}
|
the_stack_data/190768284.c | /* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern void signal(int sig , void *func ) ;
extern float strtof(char const *str , char const *endptr ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned char input[1] , unsigned char output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
int main(int argc , char *argv[] )
{
unsigned char input[1] ;
unsigned char output[1] ;
int randomFuns_i5 ;
unsigned char randomFuns_value6 ;
int randomFuns_main_i7 ;
{
megaInit();
if (argc != 2) {
printf("Call this program with %i arguments\n", 1);
exit(-1);
} else {
}
randomFuns_i5 = 0;
while (randomFuns_i5 < 1) {
randomFuns_value6 = (unsigned char )strtoul(argv[randomFuns_i5 + 1], 0, 10);
input[randomFuns_i5] = randomFuns_value6;
randomFuns_i5 ++;
}
RandomFunc(input, output);
if (output[0] == 153) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
void megaInit(void)
{
{
}
}
void RandomFunc(unsigned char input[1] , unsigned char output[1] )
{
unsigned char state[1] ;
unsigned char local1 ;
{
state[0UL] = (input[0UL] + 51238316UL) + (unsigned char)234;
local1 = 0UL;
while (local1 < 1UL) {
state[0UL] = state[local1] * state[0UL];
local1 += 2UL;
}
local1 = 0UL;
while (local1 < 1UL) {
state[0UL] = state[local1] * state[local1];
local1 ++;
}
output[0UL] = state[0UL] - 724560680UL;
}
}
|
the_stack_data/126550.c | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define bool int
#define true 1
#define false 0
//calculate the max length of intersection the suffix of a and the prefix of b
int computePrefixFunction(char *p) {
if(!p || !strlen(p) || strlen(p) == 1) return 0;
int i;
int result = 0;
char *p1 = p+1;
while(*p1 != '\0') {
char *p11 = p1;
char *p2 = p;
while(*p11 != '\0' && *(p2+1) != '\0') {
//printf("*p11=%c, *p2=%c\n", *p11, *p2);
if(*p11 == *p2) {
p11++;
p2++;
} else {
break;
}
}
if(*p11 == '\0') {
//printf("enter here\n");
result = p2 - p;
break;
}
p1++;
//printf("\n");
}
return result;
}
//return first displacement of the matching
//-1 means no matches
int regularKmpMatching(char *t, char *p) {
if(!t || !p || !*t || !*p || !strlen(t) || !strlen(p) || strlen(p) > strlen(t)) return -1;
char *ptHeader = t;
char *ptTail = t;
char *pp = p;
int result = -1;
while(*ptTail != '\0' && *pp != '\0') {
printf("%c, %c, %c\n", *ptHeader, *ptTail, *pp);
if(*ptTail == *pp) {
//pt++;
ptTail++;
pp++;
} else {
int i = pp - p - 1;
if(i < 0) {
ptHeader = ptHeader + 1;
} else {
char* cCopy = (char*)calloc(i+2, sizeof(char));
memcpy(cCopy, p, i+1);
*(cCopy+i+1) = '\0';
printf("%d, %s\n", i, cCopy);
int s = computePrefixFunction(cCopy);
printf("s=%d\n", s);
ptHeader = ptTail - s;
//ptTail = ptHeader;
pp = p;
}
ptTail = ptHeader;
}
}
if(*pp == '\0') {
printf("enter here\n");
printf("%c, %c\n", *ptHeader, *t);
result = ptHeader - t;
}
return result;
}
bool isMatch(char *s, char *p) {
char *ps = s;
char *pp = p;
while(*pp != '\0') {
pp++;
}
}
int main(void) {
char t[30], p[30];
printf("please input t: \n");
fgets(t, sizeof(t), stdin);
printf("please input p: \n");
fgets(p, sizeof(p), stdin);
char *tt = (char*)calloc(strlen(t)+1, sizeof(char));
char *pp = (char*)calloc(strlen(p)+1, sizeof(char));
strcpy(tt, t);
strcpy(pp, p);
char *tEnd = strchr(tt, '\n');
if(tEnd) {
*tEnd = '\0';
}
char *pEnd = strchr(pp, '\n');
if(pEnd) {
*pEnd = '\0';
}
// printf("tt=%s, pp=%s\n", tt, pp);
printf("s=%d\n", kmpMatching(tt, pp));
/**
char a[30];
printf("please input the pattern: \n");
fgets(a, sizeof(a), stdin);
char *aa = (char*)calloc(strlen(a)+1, sizeof(char));
strcpy(aa, a);
printf("a==%s\n", a);
printf("aa==%s\n", aa);
char *end = strchr(aa, '\n');
if(end) {
*end = '\0';
}
printf("%d\n", computePrefixFunction(aa));
**/
return 0;
}
|
the_stack_data/148578187.c | /*
Copyright 2021 Simon (psyomn) Symeonidis
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.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#define HANDLE_ERROR(msg) do { perror(msg); return EXIT_FAILURE; } while(0);
int main(void) {
printf("simple usage of fmemopen\n");
uint8_t contents[] = {
0xca, 0xfe, 0xd0, 0x0d,
0x01, 0x02, 0x03, 0x04,
};
FILE* fd = fmemopen(&contents[0],
ARRAY_SIZE(contents),
"rb");
if (fd == NULL) HANDLE_ERROR("problem opening buffer as stream\n");
uint8_t buff[ARRAY_SIZE(contents)] = {0};
if (!fread(buff, sizeof(buff), ARRAY_SIZE(contents), fd))
HANDLE_ERROR("problem reading into buffer");
fclose(fd);
for (size_t i = 0; i < ARRAY_SIZE(contents); ++i)
printf("%02x.", buff[i]);
printf("\n");
return 0;
}
|
the_stack_data/101216.c | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
//array of 5 chars
char *c = (char *) malloc(sizeof(char));
//don't free char
return 0;
} |
the_stack_data/248031.c | #include<stdio.h>
#include<string.h>
void RabinKarp(char pat[], char txt[], int q,int d)
{
int M = strlen(pat);
int N = strlen(txt);
int i, j;
int p = 0; // hash value for pattern
int t = 0; // hash value for txt
int h = 1;
// The value of h would be "pow(d, M-1)%q"
for (i = 0; i < M-1; i++)
h = (h*d)%q;
// Calculate the hash value
for (i = 0; i < M; i++)
{
p = (d*p + pat[i])%q;
t = (d*t + txt[i])%q;
}
// Slide the pattern over text one by one
for (i = 0; i <= N - M; i++)
{
// Check the hash values of current window of text
// and pattern. If the hash values match then only
// check for characters on by one
if ( p == t )
{
/* Check for characters one by one */
for (j = 0; j < M; j++)
{
if (txt[i+j] != pat[j])
break;
}
// if p == t and pat[0...M-1] = txt[i, i+1, ...i+M-1]
if (j == M)
printf("Pattern found at index %d \n", i);
}
// Calculate hash value for next window of text: Remove
// leading digit, add trailing digit
if ( i < N-M )
{
t = (d*(t - txt[i]*h) + txt[i+M])%q;
// We might get negative value of t, converting it
// to positive
if (t < 0)
t = (t + q);
}
}
}
/* Driver program to test above function */
int main()
{
char txt[] = "Hello World";
char pat[] = "World";
int q = 101; // A prime number
RabinKarp(pat, txt, q,256);
return 0;
} |
the_stack_data/247019312.c | #include <sys/socket.h>
#include <sys/time.h>
#include <errno.h>
#include "syscall.h"
#ifndef PS4
int getsockopt(int fd, int level, int optname, void *restrict optval, socklen_t *restrict optlen)
{
long tv32[2];
struct timeval *tv;
int r = __socketcall(getsockopt, fd, level, optname, optval, optlen, 0);
if (r==-ENOPROTOOPT) switch (level) {
case SOL_SOCKET:
switch (optname) {
case SO_RCVTIMEO:
case SO_SNDTIMEO:
if (SO_RCVTIMEO == SO_RCVTIMEO_OLD) break;
if (*optlen < sizeof *tv) return __syscall_ret(-EINVAL);
if (optname==SO_RCVTIMEO) optname=SO_RCVTIMEO_OLD;
if (optname==SO_SNDTIMEO) optname=SO_SNDTIMEO_OLD;
r = __socketcall(getsockopt, fd, level, optname,
tv32, (socklen_t[]){sizeof tv32}, 0);
if (r<0) break;
tv = optval;
tv->tv_sec = tv32[0];
tv->tv_usec = tv32[1];
*optlen = sizeof *tv;
break;
case SO_TIMESTAMP:
case SO_TIMESTAMPNS:
if (SO_TIMESTAMP == SO_TIMESTAMP_OLD) break;
if (optname==SO_TIMESTAMP) optname=SO_TIMESTAMP_OLD;
if (optname==SO_TIMESTAMPNS) optname=SO_TIMESTAMPNS_OLD;
r = __socketcall(getsockopt, fd, level,
optname, optval, optlen, 0);
break;
}
}
return __syscall_ret(r);
}
#endif
|
Subsets and Splits