mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-29 16:14:43 +00:00
Initial Import
This commit is contained in:
21
config/cc.c
Normal file
21
config/cc.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 3)
|
||||
write(1,"gnucc33\n",9);
|
||||
exit(0);
|
||||
#endif
|
||||
#if (__GNUC__ >= 2) && (__GNUC_MINOR__ >= 95)
|
||||
write(1,"gnucc95\n",8);
|
||||
exit(0);
|
||||
#endif
|
||||
#ifdef __GNUC__
|
||||
write(1,"gnucc\n",6);
|
||||
#else
|
||||
write(1,"yes\n",4);
|
||||
#endif
|
||||
return(0);
|
||||
}
|
||||
9
config/inet_addr.c
Normal file
9
config/inet_addr.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct in_addr ia;
|
||||
ia.s_addr = inet_addr("0.0.0.0");
|
||||
return(0);
|
||||
}
|
||||
|
||||
8
config/inet_aton.c
Normal file
8
config/inet_aton.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct in_addr ia;
|
||||
return(inet_aton("0.0.0.0",&ia));
|
||||
}
|
||||
|
||||
32
config/ldtest.c
Normal file
32
config/ldtest.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(__GNUC__) && defined(__ELF__)
|
||||
#define __page(x) __attribute__ (( __section__ (x) ))
|
||||
#else
|
||||
#define __page(x) /* nothing */
|
||||
#endif
|
||||
|
||||
#define S(x) x,sizeof(x)
|
||||
|
||||
__page(".text.e")
|
||||
int function1(int a)
|
||||
{
|
||||
return a + 1;
|
||||
}
|
||||
|
||||
__page(".text.c")
|
||||
int function2(int a)
|
||||
{
|
||||
return a + 2;
|
||||
}
|
||||
|
||||
__page(".text.d")
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (((void*)main < (void*)function1) && ((void*)function1 < (void*)function2))
|
||||
write(1,S("yes\n"));
|
||||
else
|
||||
write(1,S("no\n"));
|
||||
return(0);
|
||||
}
|
||||
1
config/md5.h
Symbolic link
1
config/md5.h
Symbolic link
@@ -0,0 +1 @@
|
||||
../src/md5/md5.h
|
||||
1
config/md5_internal.c
Symbolic link
1
config/md5_internal.c
Symbolic link
@@ -0,0 +1 @@
|
||||
../src/md5/md5.c
|
||||
10
config/ptr_size.c
Normal file
10
config/ptr_size.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
printf("%i\n",sizeof(void*));
|
||||
return(0);
|
||||
}
|
||||
|
||||
27
config/pw.c
Normal file
27
config/pw.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
char * CRYPT_FUNC (const char *, const char *);
|
||||
int main(void)
|
||||
{
|
||||
char *enc;
|
||||
int md5,des;
|
||||
|
||||
des = md5 = 0;
|
||||
enc = CRYPT_FUNC ("password","$1$XX");
|
||||
if (enc && !strcmp(enc,"$1$XX$HxaXRcnpWZWDaXxMy1Rfn0"))
|
||||
md5 = 1;
|
||||
enc = CRYPT_FUNC ("password","XX");
|
||||
if (enc && !strcmp(enc,"XXq2wKiyI43A2"))
|
||||
des = 1;
|
||||
|
||||
if (md5 && des)
|
||||
write(1,"DESaMD5\n",8);
|
||||
else
|
||||
if (des)
|
||||
write(1,"DES\n",4);
|
||||
else
|
||||
if (md5)
|
||||
write(1,"MD5\n",4);
|
||||
return(0);
|
||||
}
|
||||
8
config/python.c
Normal file
8
config/python.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Py_Initialize();
|
||||
Py_Finalize();
|
||||
return 0;
|
||||
}
|
||||
9
config/socket.c
Normal file
9
config/socket.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int s;
|
||||
s = socket(AF_INET,SOCK_STREAM,0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
10
config/tcl.c
Normal file
10
config/tcl.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <unistd.h>
|
||||
#include <tcl.h>
|
||||
Tcl_Interp *interp = NULL;
|
||||
int main(void)
|
||||
{
|
||||
interp = Tcl_CreateInterp();
|
||||
Tcl_Init(interp);
|
||||
return(0);
|
||||
}
|
||||
|
||||
19
config/unaligned.c
Normal file
19
config/unaligned.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
int buserror(char *data)
|
||||
{
|
||||
int *x;
|
||||
x = (int*)(data+1);
|
||||
return(*x);
|
||||
}
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char busdata[6];
|
||||
int x;
|
||||
strcpy(busdata,"Xyes\n");
|
||||
x = buserror(busdata);
|
||||
write(1,&x,4);
|
||||
return(0);
|
||||
}
|
||||
14
config/which
Executable file
14
config/which
Executable file
@@ -0,0 +1,14 @@
|
||||
bin=$1
|
||||
spath="`echo $PATH | sed 's/:/ /g;'`"
|
||||
if [ -x $bin ]; then
|
||||
echo $bin
|
||||
exit
|
||||
fi
|
||||
for pd in $spath; do
|
||||
if [ -x $pd/$bin ]; then
|
||||
echo $pd/$bin
|
||||
exit
|
||||
fi
|
||||
done
|
||||
echo 'not found'
|
||||
|
||||
Reference in New Issue
Block a user