const int ci= 16; const int *cip= adr; |
int * const ipc= &ci; |
int const * const ccip= &ci; |
extern int atoi(const char *); |
static void seKulmination(void) { int volatile rf=0; if (setjmp(J)==1 && rf>0) return; // ... if (seKul>9) rf=2, ++a; if (a) longjmp(J, 1); ErrV= rf; // cc return; } |
typedef unsigned char BYTE; typedef BYTE *BYTEP; BYTE a, b=2, c, *bp=0; |
typedef struct _FILE_ { int __cnt; // 4 unsigned char *__ptr, // 8 *__base, //12 __flag, //13 __file, //14 __buf[2]; //16(Dummy) } FILE, *FILEP; extern FILE __iob[]; #define stdin (&__iob[0]) #define stdout (&__iob[1]) #define stderr (&__iob[2]) FILE *fp; fp= fopen("COM2", "rb"); if (!fp) PrintErr(E_OPENF, "COM2"), exit(2); |
typedef int A[10][2]; A a, b; int a[10][2], b[10][2]; |
void funktion(void) { /*...*/ return; } |
(void)printf("..."); |
# define uchar unsigned char void *memset_F(void *d0, int i, register unsigned n) { register uchar *d= (uchar*)d0; register uchar c= (uchar )i; while (n > 0) *d++ = c, --n; return (d0); } # undef uchar |
int iarr[64]; struct dirent dea[100]; memset_F(iarr, 0, sizeof(iarr)); memset_F(dea , 0, sizeof(dea)); memset_F(&dea[8], -1, sizeof(*dea)); memset_F(&dea[8], -1, sizeof(struct dirent)); // sizeof(dea)/sizeof(*dea) ist gleich 100 |
typedef unsigned uint; typedef unsigned char byte; void *memcpy_F(void *d0, const void *s0, register uint n) { register byte *d=d0; register const byte *s=s0; if (n) do *d = *s, ++d,++s; while (--n); return d0; } int memcmp_F(const void *d0, const void *s0, uint n) { register const byte *d=d0, *s=s0; if (n && d!=s) { do if (*d!=*s) return *d - *s; while (--n&&(++d,++s,1)); } return 0; } uint strlen_F(const byte *s0) { register const byte *s=s0; while (*s) ++s; return (s-s0); } int strcmp_F(const byte *d0, const byte *s0) { register const byte *d=d0, *s=s0; if (d!=s) { for (; 1; ++d,++s) { if (*d!=*s) return *d - *s; if (!*s) break; } } return 0; } |
{ /*...*/ a=4;;;;;;;;; };;;;; |
int ia[10]; int *iap, i; iap= ia+5; i= iap[-2]; // entspricht: i= ia[3]; i= (ia+5)[-2]; // dito |
long l; struct test { int i; char c; long l; }; struct test T; struct test *TP= &T; l= TP->l; l= (*TP).l; // *TP ist die Struktur T als Ganzes l= TP[0].l; l= T.l; l= (&T)->l; |
int i, *ip; ip= &i; *ip= 5; i= 5; |
int *ip, **ipp; ipp= &ip; |
~00000000 == 11111111 ~11111111 == 00000000 ~11001101 == 00110010 unsigned long ul= ~(0ul); |
if (!a) a= b+2; i= !!25; i= !!(1-3); |
c= ++*a++; c= ++*++a; c= (*++a)--; // Fehler!: *++a-- |
++i; i++; i+=1; i=i+1; --i; i--; i-=1; i=i-1; |
a= b + ++i + c; |
a= b + i++ + c; |
a= b + i+1 + c, ++i; a= b + i + c, ++i; |
i-- = 2; i++ = 2; |
*a++ = *b++; *a = *b , a++, ++b; *++a = ++*b++; |
unsigned u; int i=100; char c; int *ipa, *ipb; c= (char)i; c=-2; // c == 11111110 i= c; // i == -2 == 111111...1111111111111110 u= c; // u == 4294967294u u= (unsigned)c; // u == 4294967294u u= (unsigned)(unsigned char)c; // u == 254 == 11111110 u= (unsigned char)c; // u == 254 c= 127; u=i=c; // u == i == c == 127 == 01111111 ipb= ipa + 1; i= (int)(ipb-ipa); // i == 1 i= ( (unsigned)ipb - (unsigned)ipa ); // i == 4 i= ( (char*)ipb - (char*)ipa ); // i == 4 struct kfl { char a; unsigned char b; } *sp; sp= (struct kfl*) &i; ++sp->b; |
char Buf[256]; for (i=0; i<sizeof(Buf)/sizeof(long); ++i) { ((long*)Buf)[i]= 0L; } |
struct kfs { int i; char rel; } Kfs[2]; int Array[10]; sizeof(int) // 4 sizeof(char) // 1 (ist immer 1) sizeof(char*) // 4 sizeof(struct kfs) // 8 also 3 Füll-Bytes sizeof(*Kfs) // 8 sizeof(Kfs) // 16 sizeof(Kfs+0) // 4 Pointer-Kontext erzwungen: +0 sizeof(Kfs[0].i) // 4 sizeof(Kfs[1].rel) // 1 sizeof( ( (struct kfs *)0 )->rel ) // 1 sizeof(&( (struct kfs *)8 )->rel ) // 4 sizeof(Array) // 40 sizeof(*Array) // 4 sizeof(Array[0]) // 4 sizeof(long[2][3]) // 24 sizeof("") // 1 sizeof("abc") // 4 sizeof('A') // 4 sizeof((char)'A') // 1 |
8/4 == 2 7/4 == 1 7.0/4.0 == 1.75 5/4 == 1 4/4 == 1 3/4 == 0 8%4 == 0 7%4 == 3 // 7/4 == 1 + 3/4 5%4 == 1 4%4 == 0 |
int y, a=j, b=k, c=25000, d=40; // int: 16 Bit y= a - b + c + d; y= (a - b)+ c + d; y= (int)( a - (long)b + c + d ); |
( signed char)11110000 >> 2 ==>11111100 ! (unsigned char)11110000 >> 2 ==>00111100 |
if (i == (int)u) /*...*/; while (*ap != NULL) { /*...*/ ++ap; } |
5.850000000000013 oder 5.850000000000022 oder 5.849999999999994 oder 5.849999999999981 oder ... |
i = 32; 00100000 i |= (1 | 4 | 8); 00101101 i &= ~(1 | 4 | 8); 00100000 10000001 ^ 11111111 == 01111110 if ( i & (4|8)) ... if ((i & (4|8))==(4|8)) ... |
if (!a && b>=4 && (c||d)) ... if (r=0, !a && (r=1, b>6) && (r=2, c)) ... |
y= a>5 ? 1 : 0; z= a + b + (a>2 ? a&12 : (++k, b-1)) - 24; k ? printf("k!=0") : printf("k==0"); |
a = 1; b += 2; entspricht b= b+2; b -= 3+a; entspricht b= b-(3+a); b *= a+1; entspricht b= b*(a+1); s <<= 4; entspricht s= s<<4; s += l = CatS(buf+s, j, k, *pp, (byte*)0); |
if (a>2&&b!=10) a+=4, b=Fu(1), ++c; else a=b=0, --c; if (k&8) { a=2, b|=k|1, ++Err; break; } |
if (f>1) i+= Fuu(a, b, (f+=2,c=a-f, c), d=D+1, e), i*=4; |
i= A[f=++k+4]; i= A[f=++k+4, f]; |
switch (at->z.n) { case 0: if (at->format!=AT_BIN) { at->z.n=3; goto TXTSW; } at->z.n=1; case 1: if (!T_All[at->vi]) { buf[0]=0; buf[1]=0; buf[2]=0; buf[3]=0; buf[4]=2; at->crc= Crc16(at->crc, buf, 5); buf[5]=(BYTE)at->crc; buf[6]=(BYTE)(at->crc>>8); put(buf, 7); at->z.n=5; goto END; } at->bi=0; at->z.n=2; case 2: if (s=TXT(T_All[at->vi], at->bi), !s) { ++at->vi; at->z.n=1; goto TXTSW; } dw= (UNS4)T_All[at->vi][at->bi][0]; buf[0]=(BYTE) dw; buf[1]=(BYTE)(dw>>8); buf[2]=(BYTE)(dw>>16); buf[3]=(BYTE)(dw>>24); r= (buf[4]=(BYTE)strncpy_F(buf+5, s, _40+1))+5; at->crc= Crc16(at->crc, buf, r); put(buf, r); ++at->bi; goto END; case 3: if (!T_All[at->vi]) { put("\r\n", 2); at->z.n=5; goto END; } at->bi=0; at->z.n=4; case 4: if (s=TXT(T_All[at->vi], at->bi), !s) { ++at->vi; at->z.n=3; goto TXTSW; } r= sprintf_F(buf, "%010lu\t", T_All[at->vi][at->bi][0]); r+=nput=strncpy_F(buf+r, s, _40+1); if (!nput||nput>_40) buf[r++]='\a'; buf[r++]='\r', buf[r++]='\n'; put(buf, r); ++at->bi; goto END; case 5: break; } |
0777 == 111111111 0x777 == 11101110111 0xFFF == 111111111111 |
long long ll; unsigned u; short s; ll = -678; ll = 857322624983473ll; ll = 857322624983473; // Compiler-Warnung! ll = 1u << 31; // Suffix u erforderlich! u = 16; u = 3847772663u; s = 28433; |
'A' '#' 'ä' '\'' '\x41' '\0' L'x' (wchar_t) |
\' \" \? \\ \a \b \f \n \r \t \v \ooo \xhh |
"Die Programmiersprache \"C\" hat wenige Schlüsselwörter." L"Die Programmiersprache \"C++\" hat mehr davon." //wchar_t |
printf("aaaaaaa" "bbb" "ccccc" "\n" ); printf("aaaaaaabbbccccc\n"); |
printf("aaaaaaa\ bbb\ ccccc\ \n" ); |
/* Dies ist ein Kommentar */ // Dies ist ein Zeilenkommentar |
a= b + c - d / 70; a= b + c - d //*70*/ 80; |
int ultob_F(byte *buf, ulong u) { register byte *bp= buf; register int l=1; int l0; if (u) l=sizeof(u)*CHAR_BIT; while (u && !(u&~((~0ul)>>1))) u<<=1, --l; l0=l; do *bp= u&~((~0ul)>>1) ? '1' : '0'; while (++bp,u<<=1, --l>0); *bp=0; return (l0); } |
#define ZIFFER(N) while (u>=N) u-=N, ++c, f=1; \ if (c>'0' || f) *a++ = c, c='0'; int itoa_F(byte *a0, int i) { register unsigned u; register byte *a= a0; register byte c='0', f=0; if (i<0) i= -i, *a++='-'; u=(unsigned)i; if (u<1000U) goto U100; # if defined(UNIX) || defined(DOS32) if (u<100000U) goto U10000; ZIFFER(1000000000u); ZIFFER( 100000000u); ZIFFER( 10000000u); ZIFFER( 1000000u); ZIFFER( 100000u); U10000:; # endif ZIFFER( 10000u); ZIFFER( 1000u); U100:; ZIFFER( 100u); ZIFFER( 10u); *a++=(byte)u+'0'; *a=0; return (a-a0); } #undef ZIFFER |
#define kLAENGE 360 |
a+kLAENGE.0 |
# include <stdio.h> # include "./mod/kfu.c" |
#undef kLAENGE #define kLAENGE 3600 |
# define D_NBLF (D_NBLD+32) |
# define OVSCAN(c) printf("\033[=%uA", c) |
# define D_BSZ1 BUFSIZE # define D_BSZ2 ((D_NDE>>6)%1 ? ((D_NDE>>6)+1)<<10 : D_NDE<<4) # define BUFSIZE (2*1024) |
#if !defined(FREEBSD) # undef CURSOR # define CURSOR(s,e) printf("\033[=" #s ";" #e "C") # define CURSOR_0 printf("\033[=%u;%uC", \ getErr<0?12:(V6845.cursor_type>>8), \ getErr<0?14:(V6845.cursor_type&0xff)) # define CURSOR_OFF CURSOR(16,15) #else # define CURSOR(s,e) printf("\033[=%uC",(s)>(e)||(s)>15?2:3) # define CURSOR_0 printf("\033[=3C") # define CURSOR_OFF printf("\033[=2C") #endif |
printf("\033[=" "8" ";" "12" "C"); // Preprocessor |
printf("\033[=8;12C"); // Compiler |
#define cat(a,b) a##b //... cat(ooo, OOO) |
# define GETADR(GGG) \ adr[FT_##GGG][0]= GetCfgAdrById(ID_MoId_##GGG##_TYP); \ adr[FT_##GGG][1]= GetCfgAdrById(ID_MoId_##GGG##_SNO); |
#if defined(HPUX) && ( NDK > 4 || SDK == 11+KT ) # define DKVAL 2 # ifdef V12 # undef VL_A static int Ask[10]; # else static long Ask[10]; # endif #endif |
#if defined(NAME) #if !defined(NAME) #ifdef NAME #ifndef NAME |
#if /* Bedingte Kompilierung, verschachtelbar: */ #elif #else #endif #line #error "BUFSIZE scBuf zu klein!" #pragma xyz #pragma pack() /* Alignment in Strukturen: */ #pragma pack(1) /* Nicht ANSI */ #pragma pack(2) #pragma pack(4) |
__LINE__ __STDC__ __FILE__ __DATE__ __TIME__ __func__ // C99 #define BUILDTIME __DATE__ " " __TIME__ printf("%s %s\n", __DATE__, __TIME__); printf("%s\n", BUILDTIME); printf(BUILDTIME "\n"); //Potentiell fehlerhaft! |
#if defined(DOS32) || defined(DOS) # define PNT '\\' #else # define PNT '/' #endif |
#if defined(F_ultoa_F) #if defined(SLOW_FUNCTIONS) int ultoa_F(byte *puf, ulong u) { byte buf[(sizeof(u)*CHAR_BIT)/3+2]; register byte *bp= buf; do *bp++= (byte)(u%10U + '0'); while ( u/=10U ); { register int l=0; while (bp>buf) puf[l++]= *--bp; puf[l]= 0; return l; } } #else int ultoa_F(byte *a, ulong u) { if (u>0xFFFFul) return ( ultoa_H(a, u) - a ); return ( utoa_H(a, (unsigned)u) - a ); } #endif #endif |
#if defined(F_DelSlash) && !defined(DF_DelSlash) # define DF_DelSlash int DelSlash(register byte *a) { register byte *b; byte *A=b=a; do { if (*b==PNT) for (++a; *++b==PNT; ); if (b!=a) *a=*b; } while (*b && (++b,++a, 1)); if (a>A+1 && a[-1]==PNT) *--a=0; return (a-A); } #endif |
int main(void) { return 0; } |
int __iob[ _NFILE_ * sizeof(__szFILE)/sizeof(int) ]; |
/* xyz.c sc/14.12.99 */ # include <stdlib.h> # include <stdio.h> # include <sys/types.h> #if defined(UNIX) # include <unistd.h> #endif #if defined(DOS) # include <io.h> # include <dos.h> # include <conio.h> #endif # include <fcntl.h> /*# include "xyz.h"*/ int main(int, char *[]); static int xyz(int, char **); static void Funktion1(void); static int *Funktion2(char *); static int Err; int main(int count, char *argv[]) { register int r=1; if (count>=2) Funktion1(), r= xyz(count-1, argv+1); return (r|Err); } static int xyz(int C, char **A) { int *ip; ip= Funktion2(A[0]); return ip?*ip:2; } static int *Funktion2(char *name) { static int ia[8]; if (!name[0]||name[1]!=0) return 0; ia[2]= (unsigned char)name[0] + 1; return ia+2; } static void Funktion1(void) { /* Kommentar */ // Zeilenkommentar, neu ab C99-ANSI/ISO if (!isatty(0)) ++Err; return; } |
int main(int argc, char **argv, char **envp); |
for (; argc>0; --argc,++argv) printf("%s\n", argv[0]); |
int main(void); int main(int, char *[]); |
char *av[]= argv; |
char **av= argv; |
int main(int C, unsigned char **A, char **E); |
main atexit environ exit |
#define SPT (24UL*3600UL) static ulong MS[]= { 0UL, SPT*31UL, SPT*28UL, SPT*31UL, SPT*30UL, SPT*31UL, SPT*30UL, SPT*31UL, SPT*31UL, SPT*30UL, SPT*31UL, SPT*30UL, SPT*31UL }; static uint JT[]= { 0, 0, 31, 31+28, 31+28+31, 31+28+31+30, 31+28+31+30+31, 31+28+31+30+31+30, 31+28+31+30+31+30+31, 31+28+31+30+31+30+31+31, 31+28+31+30+31+30+31+31+30, 31+28+31+30+31+30+31+31+30+31, 31+28+31+30+31+30+31+31+30+31+30 }; |
int Sec2DateTime(int *t, long l) { register ulong sec=(ulong)l; { register uint cjsj; { register uint j; register ulong corr; for (j=1970; 1; sec-=corr,++j) { if (corr= SPT*365UL +((cjsj=!(j%4)&&j%100||!(j%400))!=0?SPT:0UL), sec<corr ) break; } t[0]=j/100, t[1]=j%100; } { register uint m; register ulong corr; for (m=1; 1; sec-=corr,++m) { if (corr= MS[m] + (m==2&&cjsj ? SPT : 0UL), sec<corr) break; } t[2]=m; } } { register int s; t[3]=(int)(sec/SPT)+1, sec%=SPT; t[4]=(int)(sec/3600UL), sec%=3600UL; s =(int) sec; t[5]=s/60, s%=60; t[6]=s; } return 0; } long DateTime2Sec(int *t) { register uint j, cjsj, nsj; ulong sec; uint J, M=t[2], T=t[3], h=t[4], m=t[5], s=t[6]; j=t[0]*100+t[1]; if ( j< 70) j+=2000; else if (j< 100) j+=1900; else if (j<1970) j= 1970; for (J=j,nsj=0,j=1970; j<=J; ++j) { nsj+= cjsj= !(j%4)&&j%100||!(j%400); } sec= SPT*(365UL*(J-1970)+nsj-cjsj) + SPT*(ulong)(JT[M]+T-1)+(ulong)(h*3600UL+m*60UL+s); if (cjsj && M>=3) sec+=SPT; return (long)sec; } |
int Input(int ityp) { register int c; while ( PSnu=0, c= List(ityp), ityp&ITYP_I?++KDOnu:0, !O['t'] && (c<EoF||(ityp&ITYP_I)&& (c>ADD+8&&(!(G.ityp&ITYP_P)||c!=rETURN) ||c==EoF&&(O['I']|O['P']) &&(write(2,"Benutze exit" NL,13+NLSZ), --KDOnu, 1)) ) ); return c; } int Input(int ityp) { register int c; while ( PSnu=0, c=List(ityp), 1 ) { if (ityp&ITYP_I) ++KDOnu; if ( O['t']) break; if ( c>=EoF) { if ( !(ityp&ITYP_I) ) break; if ( c<=ADD+8 || (G.ityp&ITYP_P) && c==rETURN ) { if ( c!=EoF || !(O['I']|O['P']) ) break; write(2, "Benutze exit" NL, 13+NLSZ); --KDOnu; } } } return c; } |
while (--sz >= 0) e[sz]= vla[sz]; |
int * restrict p; |
int ** restrict p; |
_Bool flg; long v=567; flg = v ? 1 : 0; flg = !!v; flg = v; |
double _Complex dcx; |
char *A[]= { "abc", "def" }; // bisher char *A[]= { [1]="def", [0]="abc" }; // neu typedef struct { int quot, rem; } div_t; div_t S= { .quot=4, .rem=-1 }; struct { int a[3], b; } AS[]= { [0].a={1}, [1].a[0]=2 }; /* AS ist ein Array aus 2 Strukturen */ int A[15]= { 1,3,5,7,9,[10]=8,6,4,2,0 }; // 1 3 5 7 9 0 0 0 0 0 8 6 4 2 0 int A[15]= { 1,3,5,7,9,[3]=8,6,4,2,0 }; // 1 3 5 8 6 4 2 0 0 0 0 0 0 0 0 union { /*...*/ } U= { .any=8 }; |
struct { int a[3], b; } AS[]= { {1}, 2 }; struct { int a[3], b; } AS[]= { {{1,0,0}, 0}, {{2,0,0}, 0} }; |
char A[2][3][4]= { 0,1,2,3,4,5,6,7,8,9,10,11, 12,13 }; |
struct sfa { int i; char fca[]; } *sp; char buf[100]; sp= (struct sfa*)buf; sp->fca[95]= 8; //sizeof(struct sfa) == sizeof(sp->i) |
struct sfa { int i; char fca[96]; }; |
char fca[1]; |
char d_name[1]; |
int *p= (int []){2, 4}; // global; statisch int *p; // innerhalb Funktion ... p= (int [2]){*p}; // [0]=*p, [1]=0 |
drawline( (struct point){.x=1, .y=1}, (struct point){.x=3, .y=4} ); drawline(&(struct point){.x=1, .y=1}, &(struct point){.x=3, .y=4} ); |
(const float []){1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6} |
"/tmp/fileXXXXXX" (char []){"/tmp/fileXXXXXX"} (const char []){"/tmp/fileXXXXXX"} |
long Fu(int n, int m, long a[n][m]); long Fu(int n, int m, long a[*][*]); long Fu(int n, int m, long a[ ][*]); long Fu(int n, int m, long a[ ][m]); |
extern int n; extern int m; void fcompat(void) { int a[n][6][m]; int (*p)[4][n+1]; int c[n][n][6][m]; int (*r)[n][n][n+1]; p = a; // Fehler - nicht kompatibel, da 4 != 6. r = c; // Kompatibel, aber definiertes Verhalten // nur falls n == 6 und m == n+1. } |
extern int n; int A[n]; // Error - file scope VLA extern int (*p2)[n]; // Error - file scope VM int B[100]; // OK - file scope, not VM void fvla(int m, int C[m][m]); // OK - prototype scope { typedef int VLA[m][m]; // OK - block scope typedef VLA struct tag { int (*y)[n]; // Error - y not ordinary identifier int z[n]; // Error - z not ordinary identifier }; int D[m]; // OK - auto VLA. static int E[m]; // Error - static block scope VLA extern int F[m]; // Error - F has linkage and is VLA int (*s)[m]; // OK - auto pointer to VLA. extern int (*r)[m]; // Error - r had linkage and is // a pointer to VLA. static int (*q)[m] = &B; // OK - q is a static block // pointer to VLA. } |
void copyt(int n) { typedef int B[n]; // B hat n int, n jetzt bewertet. n += 1; // Nanu, vor Objektanlegen!? B a; // a hat n int, n ohne += 1. int b[n]; // a und b sind unterschiedlich groß for (int i = 1; i < n; i++) a[i-1] = b[i]; } { int n = 4, m = 3; int a[n][m]; int (*p)[m] = a; // p == &a[0] p += 1; // p == &a[1] (*p)[2] = 99; // a[1][2] == 99 n = p - a; // n == 1 } |
void Add(int n, int m, double a[n][n*m+300], double x); int main() { double b[4][308]; Add(4, 2, b, 2.17); return 0; } void Add(int n, int m, double a[n][n*m+300], double x) { for (int i=0; i < n; i++) for (int j=0, k=n*m+300; j < k; j++) a[i][j] += x; // a ist ein Zeiger auf ein VLA // mit n*m+300 Elementen } |
#include <iso646.h> and && or || not ! not_eq != bitand & bitor | xor ^ compl ~ and_eq &= or_eq |= xor_eq ^= |
unsigned Funktion(register int sz) { extern signed char e[]; signed char vla[sz]; while (--sz >= 0) e[sz]= vla[sz]; return e[5]; } |
int a, *p; // Syntax hier genau so wie später // Der * als Pointer-Symbol ist naheliegend a *= 10; // mit sich selbst multiplizieren a += 22; // etwas aufaddieren, hinzufügen a++; // eins dazu, eins weiter a = *p; // sichtbare Dereferenzierung a = kp->b; // mit Zeiger -> zugreifen |
DECLARE (a, b) FIXED, ap REF FIXED; a := 2; ap := a; b := CONT ap; /* b := 2; */ b := ap; /* implizite Deref. */ CONT ap := ap + 4; /* implizit rechts; a := a + 4; */ |
typedef unsigned char BYTE; BYTE cksum, buf[256]; if (~cksum != buf[r]) atSEND(ECKSUM); cksum 1: 00111000 BYTE cksum 2: 0000000000111000 int cksum 3: 1111111111000111 ~ != buf[] 2: 0000000011000111 int buf[] 1: 11000111 BYTE |
BYTE cksum, buf[256]; if ((BYTE)~cksum != buf[r]) atSEND(ECKSUM); cksum 1: 00111000 BYTE cksum 2: 0000000000111000 int cksum 3: 1111111111000111 ~ cksum 4: 11000111 (BYTE) cksum 5: 0000000011000111 int != buf[] 2: 0000000011000111 int buf[] 1: 11000111 BYTE |
int *ip= (int*)102700u; |
int i=2, *ip, **ipp; ip= &i; ipp= &ip; |
char *cp= (char*)&i; cp[0] == 2 cp[1] == 0 cp[2] == 0 cp[3] == 0 |
char A[5]; int *ip; ip= (int*)(A+1); *ip= 0; // setzt das 2. bis 5. Byte von A auf 0 |
neue_Adresse = Adresse + i; |
neue_Adresse = Adresse + i * sizeof(*Adresse) |
ip += 1; |
ip += 1 * sizeof(int) |
ip - 1; |
ip - 1 * sizeof(int) |
i = (int)( ipb - ipa ); |
i = (ipb-ipa) / sizeof(int) |
extern char **environ; extern char* *environ; /* Alternativ-Darstellung */ |
char *envarr[]= { "PATH=...............", "CDPATH=.............", "...", }; char **environ= envarr; char **environ=&envarr[0]; /* Alternative */ |
char *cp; short *sp; long *lp, *lpb; void *vp; // Assembler-Ebene: ++cp; // cp += 1 * sizeof(char); cp += 1 ++sp; // sp += 1 * sizeof(short); sp += 2 ++lp; // lp += 1 * sizeof(long); lp += 4 lp+1 // lp + 1 * sizeof(long); lp+4 lp-2 // lp - 2 * sizeof(long); lp-8 ++vp; // vp += 1 * sizeof(????); FEHLER! |
((struct abc *)vp) += 3; // vp += 3 * sizeof(struct abc); (2) (( long(*)[5][10] )vp) += 3; // vp += 3 * sizeof(long [5][10]), (2) // vp += 3 * 200; |
(uint)(lp-lpb) // (lp-lpb) / sizeof(long) (uint)lp - (uint)lpb // lp-lpb (1) (char*)lp - (char*)lpb // lp-lpb |
// Event. Misalignment: ((long*)cp)++; // cp+=sizeof(long) (2) *((long*)cp) = 0; // DWORD=0 auf das cp zeigt (a) *((long*)cp++) = 0; // cp+=1 nach Zuw. (a) *((long*)cp)++ = 0; // cp+=4 nach Zuw. (!ANSI,a) *++((long*)cp) = 0; // cp+=4 vor Zuw. (!ANSI,a) ++*((long*)cp); // DWORD+=1 auf das cp zeigt (a) (*((long*)cp))++; // dito |
*(cp+256) =48; ++cp; // cp[256]=48, cp+=sizeof(char) *(cp++ +256)=48; // dito *(256+cp++) =48; // dito (cp++)[256]=48; // dito cp++[256] =48; // dito |
(a) event. Misalignment auf Nicht-x86-Prozessoren (1) nicht vollkommen portabel: (unsigned)adr Besser, bei Differenzen : i= (char*)lpb - (char*)lpa; (2) nicht Strict ANSI, dennoch ziemlich portabel cp= (char*)((long*)cp+1); ist voll portabel |
( adr != NULL) ( adr != 0) ( adr) ( adr == NULL) ( adr == 0) (!adr) |
#define NULL 0 // oder #define NULL ((void*)0) |
char *adr= NULL; if ( 0 == adr ) ; if ( 0 == (unsigned)adr ) ; |
char *adr= 0xC0000000; if ( 0xC0000000 == adr ) ; if ( 0x00000000 == adr ) ; |
static int CatS(char *, char *, ...); /* ... */ CatS(ziel, a, bp, s1, (char*)0); CatS(ziel, a, bp, s1, (char*)NULL); CatS(ziel, a, bp, s1, (void*)0); |
static const unsigned d4[]= { 00000, 10000, 20000, 30000, 40000u, 50000u, 60000u, 60000u, 60000u, 60000u, }; static const int d3[]= { 0000, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, }; static const int d2[]= { 000, 100, 200, 300, 400, 500, 600, 700, 800, 900, }; static const int d1[]= { 00, 10, 20, 30, 40, 50, 60, 70, 80, 90, }; # define F_DIG(c) ((c)<='9'&&(c)>='0') # define F_SP(c) ((c)==' '||(c)=='\t') int atoi_F(register const byte *a) { register int i; int m=0; if (*a<='0') { if (a[0]==0 || a[1]==0) return 0; while (F_SP(*a)) ++a; if (*a=='-'&&(m=1,1) || *a=='+') ++a; while (*a=='0') ++a; } i=0; if (!F_DIG(a[0])) goto ADD0; if (!F_DIG(a[1])) goto ADD1; if (!F_DIG(a[2])) goto I2; if (!F_DIG(a[3])) goto I3; if (!F_DIG(a[4])) goto I4; goto I5; I2: a+=1; goto ADD2; I3: a+=2; goto ADD3; I4: a+=3; goto ADD4; I5: a+=4; ADD5: i+= d4[a[-4]-'0']; ADD4: i+= d3[a[-3]-'0']; ADD3: i+= d2[a[-2]-'0']; ADD2: i+= d1[a[-1]-'0']; ADD1: i+= a[ 0]-'0'; ADD0:; return (m?-i:i); } |
int A[5]; A[0]=A[1]=A[2]=A[3]=A[4]= 258; /* 258 == 0x00000102 */ 21002100210021002100 00001111222233334444 *...*...*...*...*...* 10200 10208 10216 10204 10212 10220 |
sizeof(A) == 20 (10220-10200==20). sizeof(A)/sizeof(*A) == 5 (20/4==5). |
printf("%u %d\n", A, A[2]); /* Ausgabe: 10200 258 */ |
A[i] entspricht *(A+i) A[0] entspricht *(A+0) A[0] entspricht * A |
AdressenAusdruck[IntegerAusdruck] *(AdressenAusdruck+IntegerAusdruck) *(IntegerAusdruck +AdressenAusdruck) IntegerAusdruck [AdressenAusdruck] |
c= 3["abcde"]; // c='d'; |
int AA[5][2]; .0000000011111111222222223333333344444444 // AA[i][ ] .0000111100001111000011110000111100001111 // AA[ ][i] .0000111122223333444455556666777788889999 // ((int*)AA)[i] |
int (*aap)[2]= AA; |
int *ip= (int*)AA; |
int AA[5][2]; // int(*)[2] Typ von AA AA[i][j]; ip[i*2+j]; |
int AAA[5][2][3], (*aaap)[2][3]; int *ip= (int*)AAA; |
(void)AAA[4][1][2]; // (4*6+1*3+2)==(29) |
assert(i<5 && j<2 && k<3); //-> abort() -> raise(SIGABRT) |
char C[2][3][4]; // 2*3*4= 24 Elemente: 0...23 000000000000111111111111 [i][ ][ ] 000011112222000011112222 [ ][i][ ] 012301230123012301230123 [ ][ ][i] ********** * * * * .0123456789 12 16 20 23 ((char*)C)[i] // 1-dimensional: |
char C[2][3][4]; char (*cp)[3][4]= C; // der erste Index 'fehlt' char (*cpa[1])[3][4]; cpa[0]= C; C[1][1][1]=4; // 4 Element 17 cp[1][1][1]=4; // 4 Element 17 |
char(*bp)[80][2]= malloc( sizeof(char[Z_MAX+1][80][2]) ); bp[z][s][1]= 0x07; // s: 0..79 |
char C[2][3][4]; char *cp = (char *) C; char (*p)[6]= (char(*)[6]) C; char c; c= **p++; // c = Element 0 von C c= **p++; // c = Element 6 von C c= **p; // c = Element 12 von C c= p[1][5]; // c = Element 23 von C p-=2; c= p[1][5]; // c = Element 11 von C c= p[2][0]; // c = Element 12 von C |
char CA[8]; CA[3]=6; // Zuweisung von 6 an 4. Element *&*&CA[3]=6; // dito (&((&CA[3])[ 0]))[0]=6; // dito (&((&CA[3])[-3]))[3]=6; // dito (&((&CA[0])[ 3]))[0]=6; // dito |
char A[3][256]; A[0] // Adresse erster Teil: 0, Typ: char* A[1] // Adresse zweiter Teil: 256, Typ: char* A[2] // Adresse dritter Teil: 512, Typ: char* |
static char *A[4] = { "aaaaaa", "bbbbDBBBbbbb", "ccc" }; static char AA[4][13]= { "aaaaaa", "bbbbDBBBbbbb", "ccc" }; sizeof( A) == 16 sizeof(AA) == 52 == 6+7 + 12+1 + 3+10 + 0+13 == 4 x 13 |
static char const * A[4]= { "aaa", "abc", "ccc" }; static char const * const A[4]= { "aaa", "abc", "ccc" }; |
static char AA[3][4]= { "aaa", "bbb" }; 000011112222 [i][ ] aaa0bbb00000 0 0 |
static char AA[2][4]= { "aaa", "bbb" }; static char AA[ ][4]= { "aaa", "bbb" }; static char AA[2][3]= { "aaa", "bbb" }; |
typedef struct _FILE_ FILE, *FILEP; |
struct etikett { /*...*/ }; struct { /*...*/ } S; struct se_t { /*...*/ } SE, *pSE, SEA[4]={ /*init*/ }; struct sa_t { int i; char ca[4]; }; struct sb_t { struct sb_t *p; int i; struct sa_t saA[12]; }; struct sb_t SB1,SB2, *pSB= &SB1; SB2= SB1; SB2= *pSB; // Struktur kopieren, genau wie zuvor SB1.p= pSB; ++SB1.p->p; // entspricht: ++SB1.p; SB1.p == &SB1+1 ++pSB->i; // SB1.i += 1 SB1.saA[3].i= 2; SB1.saA[3].ca[2]+= 4; &SB1.saA[2] // Adresse 3. Struktur: (struct sa_t*) SB1.saA // Adresse 1. Struktur: (struct sa_t*) pSB->saA[1]= pSB->saA[0]; // Struktur sa_t kopieren |
#define offsetof(typ,mbr) ((size_t)(&((typ *)0)->mbr)) |
union ua_t { char cBuf[ 100*sizeof(long long) ]; long lBuf[(101*sizeof(long long))/sizeof(long)]; unsigned long long ullBuf[100]; } Ucl; for (i=0; i<100; ++i) Ucl.ullBuf[i]= 0xA5A5A5A5A5A5A5A5ull; |
#if !defined(LPMCR) union u_lpmcr { BYTE _byte; struct { BYTE _RES :1, _CG0 :1, _CG1 :1, _TMD :1, _RST :1, _SPL :1, _SLP :1, _STP :1; } _bit; struct { BYTE :1, _CG :2, :5; } _bits; }; extern volatile union u_lpmcr _lpmcr; #define LPMCR _lpmcr._byte #define LPMCR_RST _lpmcr._bit._RST #define LPMCR_CG _lpmcr._bits._CG #endif |
struct bit { ushort a:1, b:2, c:3, d:4; } bf = {1,2,4,8}; |
0x0225 = 000000.1000.100.10.1 = 0 8 4 2 1 struct bit Bitf[512]; // enthält 2048 Bitfelder long v= 0xbaL; // Wert ist zu groß (s.u.) bf.a= 0; bf.d= 11; Bitf[100].b= 3; Bitf[511].c= v; // Pauschalmaßnahme des Compilers: // (v & 7) == 2 |
struct bit { ushort a:1, // 1 b:2, // 2 :4, c:3, // 4 d:4, // 8 :0, e:5; // 16 } bf= { 1,2, 4,8, 16 }; |
0x0010 0x2205 = 00000000000.10000 00.1000.100.0000.10.1 = 16 8 4 2 1 // Bitf[] enthält 2560 Bitfelder struct bit Bitf[512]; // in 512 DWORDs |
enum { null, eins, zwei, drei, vier }; |
enum ft { False, True }; enum monate { Jan=1, Feb, Mar, Apr, Mai, Jun, Jul , Aug, Sep, Okt, Nov, Dez }; enum { zehn=10, elf, Zehn=10, sechzehn=16, siebzehn }; enum ft FALSE= False; |
// Prototypen: int Fua(int, long); static int Fub(int, int, int *); int Fua(int i, register long l) { int a=0, b[4]; // ... l+= Fub(++i, a, b+1); // ... return a+(int)l; } static int Fub(int i, int i1, int *ip) { int af=32; // ... *++ip-=2; // b[?] wird verändert return af; } |
int(*FuaP)(int,long)= Fua; i= (*FuaP)(2, 0L); // Aufruf i= ( FuaP)(2, 0L); // ohne * geht's auch, i= FuaP (2, 0L); // und sogar so i= (Fua+13)(2,0L); // nicht nachmachen! |
int CatS(char *, char *, ...); int CatS(char *S0, char *S1, ...) { register char *s= S0, *sa, **a; if (s) { for (a=&S1; (sa=*a)!=0; ++a) while (*s=*sa, *sa) ++s,++sa; } return (int)(s-S0); } //... l+= CatS(ziel+l, a, bp, s1, (char*)0); |
char Funktion(...); //Syntaxfehler! char Funktion( ); |
#include <stdarg.h> int CatS(char *, ...); int CatS(char *S0, ...) { register char *s=S0, *sa; va_list a; if (s) { for (va_start(a,S0); (sa=va_arg(a,char*))!=0; ) while (*s=*sa, *sa) ++s,++sa; va_end(a); } return s-S0; } |
Typ: va_list void va_start(va_list ap, parmN); type va_arg(va_list ap, type); void va_copy(va_list dest, va_list src); void va_end(va_list ap); |
f= va_arg(a,int); // a==Px if (n==4) va_copy(a_safe, a); // a==Py ! |
typedef char* va_list; #define va_start(ap,pn) \ ((void)(ap = (va_list)((char *)&pn \ + ((sizeof(pn)+(sizeof(int)-1)) \ & ~(sizeof(int)-1))))) #define __justiere(type) \ ((sizeof(type) + sizeof(int) - 1) \ & ~(sizeof(int) - 1)) #define va_arg(list, type) \ (*((type *)((list += __justiere(type)) \ - __justiere(type)))) #define va_end(ap) ((void)0) |
static void Fak(int i, int m) { static int F; if (!i) F=m, m=++i; printf(" %d", m); if (++i<=F) Fak(i, m*i); else printf("\n"); return; } Fak(0, 8); |
void qsort_(l, r, cmp, swap) register uint l, r; int (*cmp )(uint, uint); void (*swap)(uint, uint); { register uint ve; uint lg, rg; if (l < r) { lg=l; rg=r; ve=(l+r)>>1; do { while (l!=ve && cmp(l,ve) < 0) ++l; while (r!=ve && cmp(r,ve) > 0) --r; if (l < r) { if (cmp(l,r)) { swap(l,r); if (ve==l) ve=r; else if (ve==r) ve=l; } ++l; --r; } } while (l < r); if (l==r) if (l!=ve && cmp(l,ve) > 0) --r; else ++l; qsort_(lg,r, cmp,swap); qsort_(l,rg, cmp,swap); } return; } |
int qsorta(l, r, cmp, swap) register uint l; register uint r; int (*cmp)(uint, uint); void (*swap)(uint, uint); { uint LR[2][256]; uint *I; uint lg, rg, reg; reg=rg=r; lg=l; I=LR[0]; while (1) { {register uint ve=(l+r)>>1; while (l < r) { do { while ((*cmp)(l, ve) < 0) ++l; while ((*cmp)(r, ve) > 0) --r; if (l < r) { (*swap)(l, r); if (ve==l) ve=r; else if (ve==r) ve=l; l++; r--; } else break; } while (l < r); if (l==r) if ((*cmp)(l, ve) > 0) r--; else l++; *I=l; *(I++ +256)=rg; l=lg; rg=r; ve=(l+r)>>1; } } {register uint *i=I; l=(uint)LR[0]; ///P while (--i>(uint*)l && *i>=*(i+256)); l=*i; r=*(i+256); if (l==r && l==reg) break; lg=l; rg=r; *i=*(i+256)=0; I=i; } } return (0); } //TODO |
long Ocalc(register const byte *on) { register int ic; long r=1L, m; while (1) { if (ic=*on, ic<'0'||ic>'9') { r=~(0UL)>>1; break; } r*= atol_F(on); while ((ic=*++on, ic) && ic>='0'&&ic<='9'); if (!ic) break; m=1L; if (ic=='b') m=512L; if (ic=='k') m=1024L; if (ic=='w') m=2L; if (ic=='l') m=4L; if (m>1L && (r*=m,ic=*++on, !ic)) break; if (ic=='+') { r+=Ocalc(on+1); break; } if (ic=='-') { r-=Ocalc(on+1); break; } if (ic!='x') { r=~(0UL)>>1; break; } ++on; } return r; } |
static int I, D=4; int i= 0; int k= '5'; double d= 0.0; int monat=6, jahr=2000, tag, stunde=0, lv=120, rv=lv*2; if (!I && a+k > 10) D=8, ++I; while (lv<240) { int j=1; /*...*/ lv+=j; } |
static char A[5]= { 10, 14, 'z', 22 }; |
static char A[ ]= { 10, 14, 'z', 22 }; |
static char A[4]= "abc"; static char A[4]= { 'a', 'b', 'c', 0 }; const char *cp = "abc"; |
static char A[2][3]= { {3,4,5}, {20,24,28,} }; struct { int a[3], b; } AS[]= { {{1,0,3}, 8}, {{2,0,4}, 9} }; |
static int i; static int ii= 32; |
extern long timezone; extern char **environ; extern char *envarr[]; extern unsigned __brkval; extern int printf(const char *, ...); |
extern int eia[]; extern int eia[64]; |
extern int *eia; |
register int i, r; |
esi edi ebx/bl si di |
auto int i; int i; |
{ int i=2, a, r; char buf[256]; if (/*...*/) { int k=0; /*...*/; } { static int krest; printf("%s\n", /*...*/); //... } //... } |
{ { ... } { ... } ... { ... } } |
if ( bedingung ) anweisung ; if ( bedingung ) anweisungs-kommaliste; if ( bedingung ) { anweisung; anweisung; ...; } if ( bedingung ) ; /* Leeranweisung */ if ( bedingung ) falls bedingung!=0 ; else falls bedingung==0 ; if ( ... ) { if (...) ...; anw; } if ( ... ) anw1; anw2; else ...; // else-Fehler! if ( ... ) { if (...) ...; } else ...; if ( ... ) ...; else if ( ... ) ...; else if ( ... ) ...; else ...; if (r=0, !a&&(r=1, b>6)&&(r=2, c)) ...; |
i= !a&&(r=1, b>6)&&(r=2, c); |
for (liste; bedingung; liste_b) anweisung; for (; bedingung; ) anweisung; for (;;) { anweisungen; } for (; bedingung; ) { // ... if (bed) continue; // ... break; // ... } for (a=b+2,++c; b<10&&d; ++b) /*...*/; |
while ( bedingung ) anweisung; while ( bedingung ) { anweisung; anweisung; ...; } |
do anweisung; while ( bedingung ); do { anweisung; anweisung; ...; } while ( bedingung ); |
switch ( case-wert-ausdruck ) { case 'a': anweisungen; case 'A': anweisungen; break; case 'b': case 'B': anweisungen; break; case 670: anweisungen; goto DFLT; case 620: anweisungen; break; default : DFLT:; k=l=0; break; } |
return; return ausdruck; |
goto sprungMARKE; /* ... */ sprungMARKE: anweisung; // oder Leeranweisung ; |
#define COPY(str) (p= u_copy(p, end, str)) int send_header(int fd, struct op_t *out, uint len) { static char const LF[]= "\r\n"; unsigned char buf[4096], *p, *end; char const *msg; unsigned code; if (out->location) code=302, msg="FOUND"; else code=200, msg="OK"; p = buf; p+= sprintf(p, "HTTP/1.0 %u %s%s", code, msg, LF); p+= sprintf(p, "Content-Length: %u%s", len, LF); p+= sprintf(p, "Content-Type: "); end= buf + sizeof(buf); if (!COPY(out->content_type)) goto OVERRUN; if (!COPY(LF) ) goto OVERRUN; if (code==302) { if (!COPY("Location: ") ) goto OVERRUN; if (!COPY(out->location)) goto OVERRUN; if (!COPY(LF) ) goto OVERRUN; } if (!COPY(LF) ) goto OVERRUN; b_write(fd, buf, p-buf); return 0; OVERRUN: syslog(LOG_ERR, "Script headers too large for buffer"); return -1; } #undef COPY // p= u_copy(p, end, out->location); |
10 KeLax Bra + 8 Funktion() 10; // --- KeLax; // mov ecx, KeLax (void)KeLax; // mov eax, KeLax -KeLax; // mov eax, KeLax Bra + 8; // mov edx, Bra Funktion(); // call Funktion |
if (a==6) n= vel; a==6 && (n= vel); r = a==6 && (n= vel); r = a==6; r = a==6 || a==8 || b!=0; |
// Parameter: (byte *bp0, byte *bpe0, int *pteil) static byte ec1[]= "ABCDEFHf`GdPMXJK@LSTZmnsupihlkz"; static byte ec2[]= "ABCFGHIJKLMhl"; //[= static byte Teil[4*128]; byte fts[4*128], *strs[16+1]; int nums[16+1], num; register byte *bp= bp0; byte *bpe=bpe0; register int z, s; int teil=*pteil, ei, ft,fi, ni; byte del; if (teil) bpe=bp=Teil, bpe+=teil; ESCAGAIN:; fi=ni=z=s=del=0; NOWBUF:; for (; bp<bpe; ++bp) { register byte c; switch (c=*bp, z) { case 0: if (c!=27) break; ++z, s|=1; continue; case 1: if (c=='[') { ++z, s|=2; continue; } if (c=='Q') { z=10, s|=32|2; continue; } break; case 2: if (++z, c=='=') { s|=4; continue; } case 3: if (!Cdig[c]) if (s&4) break; else if (c=='"'||c=='\'') { z=6,del=c; continue; } else { z=9; goto ENDCK; } ++z, s|=8; num=0; case 4: DIG:; if (Cdig[c]) { num*=10, num+=c-'0'; continue; } if (ni>=16) bsh_Err(LS16|E_LIMIT, "ansi: e[#;#;#"); strs[ni]=0; nums[ni++]=num; if (c==';') { ++z; continue; } z=9; goto ENDCK; case 5: if (Cdig[c]) { --z; num=0; goto DIG; } if (c=='"'||c=='\'') { ++z,del=c; continue; } break; case 6: if (ni>=16) bsh_Err(LS16|E_LIMIT, "ansi: e[#;#;#"); s|=64; nums[ni]=-1; strs[ni++]= fts+fi; ++z; case 7: if (c==del&&(bp+1>=bpe||bp[1]!=c)) { ++z; continue; } if (fi>=sizeof(fts)) bsh_Err(LS16|E_LIMIT, "ansi: esc[\"...\""); if (c=='\n'&&!(ni&1)) c='\r'; fts[fi++]= c; if (c==del) ++bp; continue; case 8: if (c==';') { z=5; continue; } ++z; case 9: ENDCK:; if (ei=CCk(s&4?ec2:ec1, c), ei) s|=16; break; case 10: if (c>='0'&&c-'0'<96) { ++z,ft=c-'0'+1; continue; } break; case 11: if (c&&c<255) { ++z, del=c, fi=0; continue; } break; case 12: if (c==del) { s|=16; break; } if (fi>=sizeof(fts)) bsh_Err(LS16|E_LIMIT, "ansi: escQFn\"..."); fts[fi++]=c; continue; } nums[ni]=-1, strs[ni]=fts+fi; *pteil=0; if (!(s&1)) { bp=bp0; goto ANSIR; } if (!(s&16)||s&64&&(s&4||ei!=26||ni<2||ni&1)) { *pteil=0,bp=bp0; bp+=teil?0:1; goto ANSIR; } teil=0; if (s& 4) ei+=32-1; if (s&32) ei=0; if ( /*!(s&8)*/ !ni) num=nums[0]=1, ++ni; else num=nums[0]; /* 485 Zeilen Auswertung */ ANSIR:; return (int)(bp-bp0); |
byte *getenv_F(const byte *name) { extern byte **environ; byte **env; register byte *ecp; register byte *n= name; register int l; int nl; if (n && environ) { while (*n>' ' && *n!='=') ++n; if (nl=(int)(n-name), !*n && nl>0) { for (env=environ; (ecp=*env)!=NULL; ++env) { # if defined(DOS32) || defined(DOS) for (n=name,l=nl; l>0&&( *ecp==*n ||*ecp>='a'&&*ecp<='z'&&*ecp-('a'-'A')==*n ||*ecp>='A'&&*ecp<='Z'&&*ecp+('a'-'A')==*n); --l,++n,++ecp); # else for (n=name,l=nl; l>0 && *ecp==*n; --l,++n,++ecp); # endif if (!l && *ecp=='=' && !*n) return (ecp+1); } } } return NULL; } |
extern void ( *signal(int, void(*)(int)) )(int); |
void (*sig)(int); |
char *cp[3]; |
char (*cp)[3]; |
char *(*cpa[1])[3]; |
char *(**cpap)[3]= cpa; |
char *(*fuu(int,int))[3][4]; |
typedef char* (*AA3CP)[3]; AA3CP cpa[1]; |
arr[x][x++]; |
a = i++ - i + b; |
i = ++i + 1; |
funktion(++i, i, a); |
funktion(a+4, a=b+1, c); |
y += y * y; |
static int CatSn(int n, byte *S0, byte *S1, ...) { register byte *s; register byte *sa, **a; if (s=S0, s&&n>0) { for (a=&S1; (sa=*a, sa); ++n,++a) { while (n-- >0 && (*s=*sa)!=0) ++s,++sa; if (n<0) { # if defined(BSH_H) write(2, S0, n), bsh_Err(E_LIMIT, "Ziel-Puffer"); # else write(2, "*** LIMIT: Ziel-Puffer ***\r\n", 28); exit(64); # endif return n; } } } return (int)(s-S0); } |
#define SZ(d,q) (sizeof(d)>sizeof(q)?sizeof(q):sizeof(d)) memcpyw(buf, qs, SZ(buf,qs)/2); char buf[(int)((sizeof(av)*CHAR_BIT)/3.321+1)]; sizeof(WEs) sizeof(struct wes) sizeof( ( (struct kfs *)0 )->relay ) |
# define _c 4 #if _c == 2 # define Cx() C(0) C(1) #endif #if _c == 3 # define Cx() C(0) C(1) C(2) #endif #if _c == 4 # define Cx() C(0) C(1) C(2) C(3) # define Cfx(f) C(f,0) C(f,1) C(f,2) C(f,3) #endif #if _c < 2 || _c > 4 # error "_c: falscher Wert!" #endif struct bff { int a; char rb[_c*20]; }; |
# define C(c) uvw[c]//... Cx() #undef C //... # define C(c) xyz[c]//... Cx() #undef C //... # define C(f,c) hij[f]; xyz[c]//... # define F(f) mno[f]; Cfx(f);//... F(3); F(4); F(5); #undef F #undef C |
if ( 3 == 7 ) { /*...[3]...*/ } |
U.Ch.C[6].tseq[1]; |
static struct ever DRev[100]= {0}; static struct ever DRev[100]; |
int NV_write_dflts_fill_ram(int a) { struct param const *p; UNS adr; for (adr=EE_PARAM,p=Param; p->p; adr+=p->sz,++p) { if (!p->sdflt) memcpy_F(p->p, &p->dflt, p->sz); else { memset_F(p->p, 0, p->sz); if (p->typ_sd=='s') strncpy_F(p->p, p->sdflt, p->sz); } if (a==0||a==1) EE_write(adr, p->p, p->sz); } return 0; } |
funktion(puffer1, puffer2, anzahl_byte); |
# define RXERR(n) (USR##n##_ORFE==1||USR##n##_PE==1) # define CLRRXERR(n) (UMC##n##_RFC=0) # define RXERR(n) (SSR##n##_ORE==1||SSR##n##_FRE==1|| \ SSR##n##_PE==1) # define CLRRXERR(n) (SCR##n##_CRE=1) if (ISRXDATA(2) && !RXERR(2)) { //... } else /*...,*/ CLRRXERR(2); |
# define B8(a,b,c,d,e,f,g,h) \ ( a<<7|b<<6|c<<5|d<<4|e<<3|f<<2|g<<1|h<<0 ) PORT3= B8(0,0,1,1,0,0,1,0); |
# define CLEAR(l) (void) \ ((sizeof(l)>=2&&!(sizeof(l)&1)&&!(((UNS)&(l))&1)) \ ? (void)memsetw ( &(l) , 0 , sizeof(l)/2 ) \ : (void)memset_F( &(l) , 0 , sizeof(l) )) |
# define RIBERR(g) ( Mess.g.ctl|=128 ) # define WRIB(b,v) \ ( Mess.b.n>=sizeof(Mess.b.buf) \ ?(void)(RIBERR(b)) \ :(void)((Mess.b.w>=sizeof(Mess.b.buf)) \ ?(void)(Mess.b.w=1,Mess.b.buf[0]=(v),++Mess.b.n) \ :(void)(Mess.b.buf[++Mess.b.w-1]=(v),++Mess.b.n) \ ) \ ) # define RRIB(b,v) (void) \ ( !Mess.b.n \ ?(RIBERR(b)) \ :((Mess.b.r>=sizeof(Mess.b.buf)) \ ?(Mess.b.r=1,v=Mess.b.buf[0],--Mess.b.n) \ :(v=Mess.b.buf[++Mess.b.r-1],--Mess.b.n) \ ) \ ) |
WRIB(UART1,RXDATA(1)) RRIBw(UART1,v) WRIBw(CAN0,MS_VRB|d<<8); WRIBl(CAN0,DTR0_DWORD(CB_VRB,0)); WRIBl(CAN0,DTR0_DWORD(CB_VRB,1)); RRIBw(CAN0,v) |
# define MS_n0 2 # define MS_nUART0 8 # define MS_nUART2 8 # define MS_nUNB 8 # define MS_nVRB 16 # define MS_nDIB 8 # define MS_nRYB 8 # define MS_nBMB 32 # define MS_nFMB 16 # define MS_0 0 # define MS_UART0 (MS_0+MS_n0) # define MS_UART2 (MS_UART0+MS_nUART0) # define MS_UNB (MS_UART2+MS_nUART2) # define MS_VRB (MS_UNB+MS_nUNB) # define MS_DIB (MS_VRB+MS_nVRB) # define MS_RYB (MS_DIB+MS_nDIB) # define MS_BMB (MS_RYB+MS_nRYB) # define MS_FMB (MS_BMB+MS_nBMB) # define MS_END (MS_FMB+MS_nFMB) |
static unsigned atou_pp(const char ** const ss) { const char *s= *ss, *s0=s; unsigned u; for (u=0; *s && DIGIT(*s); ++s) u*=10, u+=*s-'0'; if (s>s0) *ss+= (s-s0)-1; return u; } |
typedef const uchar FAR * cfp_t; typedef const uchar FAR * const FAR (*cfap_t)[LANG]; typedef const uchar FAR * const FAR tpa_t[][LANG]; typedef uchar const FAR ta_t[]; cfap_t const FAR T_All[]= { T_funcmenu, T_ctlmenu, T_ccumenu, T_cal_mu, T_access, T_secrmenu, //... |
struct adcv { // U7V INT2 sum; INT2 mesw, offs, scal, mesw_min, mesw_max; INT2 adc, adc1, adc2, ist1, ist2; BYTE run, init; }; struct adc { struct adcv V[5]; BYTE run, v, s, ns; }; # define ADC_NV ( sizeof( ((struct adc *)0)->V) \ /sizeof(*((struct adc *)0)->V) ) # define ADC_NS 7 //>=1 //... struct adc volatile ADC; |
for (ap=ADC.V,i=0; i<ADC_NV; ++i,++ap) { ap->adc2= ap->adc; } for (ap=ADC.V,i=0; i<ADC_NV; ++i,++ap) { if (!(U.calyes&1u<<i)) continue; scal= ((float)(ap->ist2-ap->ist1)*(ADC_NS)) / (float)(ap->adc2-ap->adc1); offs= ap->ist2/scal - (float)ap->adc2/(ADC_NS); ap->offs= (INT2)(offs>=0.0f?offs+0.5f:offs-0.5f); ap->scal= (INT2)(scal*1000.0f + 0.5f); } |
#define ADCv(m,E) \ if (ADC.s==0) { \ if (ADC.V[m].init==0) ADC.V[m].mesw_min= 32767, \ ADC.V[m].mesw_max=-32767, \ ADC.V[m].init=1; \ ADC.V[m].sum=0, ADC.run=2; \ } \ ADC.V[m].sum+=(INT2)(ADCR&01777); \ if (ADC.s>=ADC_NS-1) { \ ADC.V[m].adc = ADC.V[m].sum; \ ADC.V[m].sum+= ADC.V[m].offs*(ADC_NS); \ ADC.V[m].mesw= \ __div(__mul(ADC.V[m].sum, ADC.V[m].scal) \ + (ADC.V[m].sum>=0?+(ADC_NS)*(1000/2) \ :-(ADC_NS)*(1000/2)), \ (ADC_NS)* 1000 ); \ if (ADC.V[m].mesw<ADC.V[m].mesw_min) \ ADC.V[m].mesw_min= ADC.V[m].mesw; \ if (ADC.V[m].mesw>ADC.V[m].mesw_max) \ ADC.V[m].mesw_max= ADC.V[m].mesw; \ if (E==1) { ADC.s=ADC.v=0, ADC.run=3; break; } \ } \ if (E==1) ++ADC.s, ADC.v=0, ADCS1_STRT=1; \ break; |
__interrupt void Int_ADC(void) { switch (ADC.v++) { //:U case 0: ADCv(0,0); //U: case 1: ADCv(1,0); case 2: ADCv(4,0); case 3: ADCv(3,0); case 4: ADCv(2,1); } ADCS1_INT=0; return; } #undef ADCv |
void*memset_F(void*d0,int i,register unsigned n){register uchar*d=(uchar*)d0;register uchar c=(uchar)i;while(n>0){*d++=c,--n;}return(d0);} |
//gindent -kr i.c o.c void *memset_F(void *d0, int i, register unsigned n) { register uchar *d = (uchar *) d0; register uchar c = (uchar) i; while (n > 0) { *d++ = c, --n; } return (d0); } |
//gindent -orig i.c o.c void * memset_F(void *d0, int i, register unsigned n) { register uchar *d = (uchar *) d0; register uchar c = (uchar) i; while (n > 0) { *d++ = c, --n; } return (d0); } |
//gindent -gnu i.c o.c void * memset_F(void *d0, int i, register unsigned n) { register uchar *d = (uchar *) d0; register uchar c = (uchar) i; while (n > 0) { *d++ = c, --n; } return (d0); } |
#define D0006000100grp GCFG06000000, gCFG06000000 #define D0006000100obj 6000100, 5808, 2, 16, #define D0006000100str 0 #define D0006000100dfmima0 0x0000u, 0x0000u, #define D0006000100dfmima1 0x0000u, 0x0000u, #define D0006000100szname sizeof(Sys.opclo_out[0]), &Sys.op const BYTE FAR T0006000100[]= "Break/Close contact 1"; #define D0006000100einhtxt 0, T0006000100 const BYTE FAR I0006000100[]= " AlarmB,AlarmA,Alarm, S" #define D0006000100info I0006000100 #define D0006000100Text T_brclo, T_group+7, T_sgrp+24, T_ |
void Zeile(const char *, ...); |
/* xyz.c 2.11.95 */ # include <stdlib.h> # include <stdio.h> # include "xyz.h" # include "mod/a.c" # include "mod/b.c" # include "mod/c.c" # include "mod/d.c" struct kle { /* ... */ }; int main(int, char **); static int xyz(int, char **); static int vLEN; /* ... */ |
#if !defined(DECL_H) # define DECL_H # include <mb90lx340.h> # include "../lib/typen.h" # define RX_ERRn 0x2000u # define RX_ERRd0 0x4000u // ... struct channel { UNS4 volatile delay[2], rtc[1], tseq[2]; UNS2 rxch, lock; BYTE nrx, lseq; }; struct channels { struct channel C[16]; struct { UNS2 enable:1, opener:1, toggle:1, ext:1, seq:1, rtc:1, lock:1, tx:1, led:1, safe:1; } flg; UNS2 nrxt, rtcw; }; # define Cx() C(0) C(1) C(2) C(3) C(4) C(5) C(6) C(7) \ C(8) C(9) C(10) C(11) C(12) C(13) C(14) C(15) // ... #endif |
#if !defined(VAR_H) # define VAR_H # define EXTERN extern # include "var.c" # undef EXTERN #endif |
# include "decl.h" #if !defined(EXTERN) # define EXTERN # define EXTRN 0 #else # define EXTRN 1 #endif EXTERN struct irt IRt; EXTERN struct irr IRr; EXTERN struct channels Ch; EXTERN struct i1ms volatile I1ms; #if EXTRN == 0 EXTERN char const K11lz[]= "%1.1K$"; EXTERN char const K21lz[]= "%2.1K$"; #else EXTERN char const K11lz[]; EXTERN char const K21lz[]; #endif |
# include "decl.h" # include "prototypen.h" # include "var.h" |
unsigned char *get_line(int fd) { int i; unsigned char *line; line= (char*)malloc(1); for (i=1; line[i]!='\n' || line[i]!=';'; i++) { read(fd, &line[i], 1); line= (char*)realloc(line, 1); } return line; } |
static byte Abuf[256*1024]; static byte *Args[4*1024]; //... Funktion(ai-x, Args+x); |
static byte *Abuf; static byte **Args; // etc. |
//struct dynmem { void *p, *pold; byte *nam; // int sz, max, min; // byte zero, elem; }; static void *MemE(int b, int sz) { struct dynmem *mp; int i; void *p; M_isdiff=0; if (b<0 && sz<0) { for (mp=Mem,i=0; i < sizeof(Mem)/sizeof(*Mem); ++i,++mp) { if (mp->p) free(mp->p), mp->p=0; } return 0; } |
if (b<0) { b= -b-1; mp= &Mem[b]; if (!mp->elem) mp->elem= 1; if ( mp->zero) p= calloc(sz>>4, 16); else p= malloc(sz); if (!p) bsh_Err(LS16|E_NOMEM, "calloc()"); mp->pold= mp->p ? mp->p : p; mp->p = p; mp->sz = mp->min= M_size= sz; M_elem = sz/mp->elem; } |
else { mp= &Mem[b]; p= mp->p; if (!mp->elem) mp->elem= 1; M_size= mp->sz; if (sz>=4) sz= (sz+3)&~(4-1); if (sz>0) { for (i=1; mp->sz<<i <= mp->sz+sz; ++i); sz= mp->sz<<i; } else if (sz<0) sz= mp->min; else sz= mp->sz<<1; if (sz > mp->max) if (mp->sz < mp->max) sz= mp->max; else { M_size=0; return p; } if (sz == mp->sz) return p; p= realloc(p, sz); |
if (!p) bsh_Err(LS16|E_NOMEM, "realloc()"); if (sz>mp->sz && mp->zero) { ulong *lp= p; i = (sz-mp->sz)/sizeof(*lp); lp+= mp->sz/sizeof(*lp); for (; i>0; --i,++lp) *lp= 0; } |
mp->pold= mp->p ? mp->p : p; mp->p = p; mp->sz = M_size= sz; M_elem = sz / mp->elem; M_isdiff= mp->p != mp->pold; } return p; } |
static int MemArgs(void) { Args= MemE(M_ARGS, 0); if (!M_size) return 1; M_Args= M_elem; return 0; } |
static int MemAbuf(void) { register int i; byte *a= Abuf, *b= Abuf+M_Abuf; Abuf= MemE(M_ABUF, 0); if (!M_size) return 1; M_Abuf= M_elem; if (M_isdiff) { byte *ap; for (i=0; i<M_Args; ++i) { if ((ap=Args[i]) && ap>=a && ap<b) { Args[i]= Abuf + (ap-a); } } } return 0; } |
int F(int a, int b, int c) { volatile char buf[1000]; int r= a + b + c; buf[0]= (char)r; return r; } |
void F(int m) { char buf[m*4]; //... { int ibuf[m/2]; //... } return; } |
int Fc(void) { asm("push eax\n" " pop eax\n" ); } |
//void strpad(void *d0, UNS2 pv, UNS n) FOO(strpad) #pragma asm MOVW RW4, RW0 MOVW A, SP MOVW RW5, A MOVW RW0, @RW5+8 MOVL A, @RW5+4 SWAPW SWAP SCEQ DTB SWAP FILS DTB MOVW RW0, RW4 RETP #pragma endasm |
struct bus0_ { BYTE kels[_c][1][40+1]; // sizeof(Bus0.DLS.kels[0][0]) == 41 BYTE kels[_c][1][40+1]; BYTE kels[_c][2][16+1]; // sizeof(Bus0.DVH.kels[0]) == 34 BYTE kels[_c][1][16+1]; |
# include <stdarg.h> # include <limits.h> # define LINKS (1u<<0) # define VPLUS (1u<<1) # define VLEER (1u<<2) # define V0X (1u<<3) # define VNULL (1u<<4) # define GLEIT (1u<<5) # define LCUT (1u<<6) # define NEGAT (1u<<7) # define XUPP (1u<<8) # define ISWI (1u<<9) # define ISPR (1u<<10) # define LENH (1u<<11) # define LENL (1u<<12) # define NOINT (1u<<13) # define FARP (1u<<14) # define CENTR (1u<<15) # define DIGIT(p) ((p)<='9'&&(p)>='0') # define K_VAL 31 # define FAR __far |
STATic int sprintf_F(void *B, const void *F, ...) { register BYTE *b; register const BYTE *f; unsigned szB=0xffffu; va_list ap, ap0; if (!(b=B)||!(f=F)) return (-1); va_start(ap,F); ap0=ap; //va_copy(ap0, ap); if (b==va_arg(ap0,BYTE*) && f+1==va_arg(ap0,BYTE*)) ap= va_arg(ap0,va_list), szB= va_arg(ap0,unsigned); va_end(ap0); while (*f) { BYTE ns[sizeof(ulong)*CHAR_BIT+4], fs[4]; BYTE FAR *s; register unsigned flg; register int l; unsigned z; int w, p; if (*f!='%' || f[1]=='%'&&(++f,1) || f[1]==0 ) { *b++= *f++; continue; } for (s=0,++f,w=p=0,flg=z=0; z<=4&&*f; ++z) { switch (z) { case 0: NXTF:; switch (*f) { case '-': flg|= LINKS; break; case '+': flg|= VPLUS; break; case ' ': flg|= VLEER; break; case '#': flg|= V0X; break; case '0': flg|= VNULL; break; case ',': flg|= GLEIT; break; case '|': flg|= LCUT; break; case ':': flg|= CENTR; break; default : continue; } ++f; goto NXTF; case 1: if (*f=='*') flg|=ISWI, ++f, w= va_arg(ap,int); else if (DIGIT(*f)) { flg|=ISWI; w= atoi_F(f); while (DIGIT(*f)) ++f; } if (w<0) w=-w, flg|=LINKS; if (*f!='.') { z=3-1; continue; } break; |
case 2: if (DIGIT(*f)||*f=='*') { flg|=ISPR; if (*f=='*') p= va_arg(ap,int), ++f; else { p= atoi_F(f); while (DIGIT(*f)) ++f; } } else continue; z=3; case 3: if (*f=='h') { flg|=LENH; break; } if (*f=='l') { flg|=LENL; break; } if (*f=='F') { flg|=FARP; break; } continue; case 4: switch (s=(BYTE FAR*)ns,l=0, *f) { long lv; ulong ulv; case 'i': case 'd': if (flg&LENL) lv= va_arg(ap,long); else if (flg&LENH) lv= va_arg(ap,short); else lv= va_arg(ap,int); if (lv < 0L ) lv=-lv, flg|=NEGAT; if (flg&LENL) l= ultoa_F(ns, (ulong)lv); else if (flg&LENH) l= utoa_F(ns, (ushort)lv); else l= utoa_F(ns, (UNS)lv); break; case 'u': if (flg&LENL) l= ultoa_F(ns, va_arg(ap,ulong)); else if (flg&LENH) l= utoa_F(ns, va_arg(ap,ushort)); else l= utoa_F(ns, va_arg(ap,UNS)); break; case 'x': case 'X': case 'b': if (flg&LENL) ulv= va_arg(ap,ulong); else if (flg&LENH) ulv= va_arg(ap,ushort); else ulv= va_arg(ap,UNS); if (*f=='b') l= ultob_F(ns, ulv); else l= ultoh_F(ns, ulv); if (*f=='X') toupp_F(ns), flg|=XUPP; break; case 'K': flg|=NOINT; s=0; if (flg&ISPR&&flg&ISWI) ; else w=va_arg(ap,int), p=va_arg(ap,int); *b++=K_VAL; *b++=(BYTE)w; *b++=(BYTE)p; break; |
case 'n': *va_arg(ap,int*)= (int)(b-(BYTE*)B); flg|=NOINT; s=0; break; case 's': if (flg&FARP) s= va_arg(ap,BYTE FAR*); else s= (BYTE FAR*)va_arg(ap,BYTE*); if (!s) s=(BYTE FAR*)"(null)"; while (s[l]) ++l; flg|=NOINT; break; case 'c': ns[0]= (BYTE)va_arg(ap,int); flg|=NOINT; l=1; break; default : z=0; goto FERR; } break; default: continue; } ++f; } /*for-z*/ FERR:; if (s&&z==5) { int lfs, l0, wfill, sp,spv; BYTE FAR*f0; spv=sp=wfill=l0=lfs=0; if (!(flg&NEGAT)) { if (flg& VPLUS) fs[0]='+', lfs=1; if (flg& VLEER) fs[0]=' ', lfs=1; } else fs[0]='-', ++lfs; if (flg& V0X) fs[lfs++]='0', fs[lfs++]= flg&XUPP?'X':'x'; if ((flg&(GLEIT|NOINT|ISPR))==(GLEIT|ISPR)) { if (f0=s,z=p, p>l) z=l, sp=p-l; for (s+=l ; z; --s,--z) s[sp]= s[-1]; for (*s='.',z=sp; z; --z) s[z ]= '0'; if (p=l+=sp+1, s==f0) ++p; s=f0; sp=0; } if (!(flg&NOINT)) { if (flg&ISPR&&p>l) l0=p-l; } else { if (flg&ISPR&&l>p) l =p ; } if ((flg&(LCUT|ISWI))==(LCUT|ISWI) && lfs+l0+l>w) { if (l0 =w-(lfs+l ), l0 <0) l0 =0; if (lfs=w-(l +l0), lfs<0) lfs=0; if (l =w-(lfs+l0), l <0) l =0; } |
if (flg&ISWI) wfill= w - (lfs+l0+l); if (wfill>0) { if (flg&VNULL) l0+=wfill; else if (flg&CENTR) spv=wfill>>1, sp=wfill-spv; else if (flg&LINKS) sp =wfill; else spv=wfill; } while (spv>0) *b++=' ', --spv; for (z=0; lfs>0; --lfs) *b++= fs[z++]; while (l0 >0) *b++='0', --l0; while (l >0) *b++= *s++, --l; while (sp >0) *b++=' ', --sp; } } va_end(ap); *b=0; return (int)(b-(BYTE*)B); } |
static int Find(void) { # define NBF (sizeof(buf)-sizeof(Str)-32) byte buf[20*1024+sizeof(Str)+32]; const byte *fp; int nf, fl, o, ro, nr; ulong fnd=0; off_t nd; for (Nr=ro=o=nr=0; (nd=Nmax-Nr, nd>0)&&( nr= read(FDi, buf+ro, nd>=NBF?NBF:(int)nd), nr>0); ) { Bnu=(Nr+=nr); nf=nr+ro-o; do { fp= FindS(buf+o, nf, Str, lStr); if (!fp) { ro=o=0; break; } if (fl=(buf+o+nf)-fp, fl<lStr) { memcpy(buf+(o=32-(fl&31)), fp, fl); ro=o+fl; break; } if (++fnd, !(O1|Ol|Oc)) ;///AUSGABE if (!Og) goto NOg; if (!(fl-=lStr)) { ro=o=0; break; } o=(fp+lStr)-buf; nf=fl; } while (1); } NOg:; if (nr<0) ;///ERROR return (fnd?1:0); } |
int ModemAT(const uchar *at) { unsigned sec=16*5; uchar msg=0; int i, r=0; M.bit.execat=1; for (; ; ++at) { switch (*at) { default : DFL1:; Putc(*at); break; case 0 : case ' ': case '\r': case '\n': KZE:; while (*at && at[1]<=' ') ++at; M.t=U.timetick; M.msg=M.cmd=0; Write("\r\n", 2); AGAIN:; ///Wait while (M.msg==0&&M.cmd==0 && U.timetick-M.t<sec) { if (GetKeyCode()==kESC) return 1; } if (M.cmd) { M.cmd=0; goto AGAIN; } if (M.msg==M_RING || M.ring) { M.msg=M.ring=0; goto AGAIN; } if (M.msg) { if (msg&&M.msg!=msg) { r=-1; goto RET; } break; } if (msg&&!(M.Bit.cable&&M.Bit.autoansw)) { r=-1; goto RET; //TIMEOUT } break; case '%': switch (*++at) { default : case '%': goto DFL1; case 0 : goto KZE; case 'd': Delay(1000); ///Wait break; case 'p': Delay( 250); ///Wait break; case 't': for (sec=i=0; i<3 && DIGIT(at[1]); ++i) { sec*= 10, sec+= *++at-'0'; } if (sec>=100) sec+=63, sec>>=6; else sec*=16; if (sec<5) sec=5*1; if (M.Bit.cable) { if (!M.Bit.autoansw) { if (sec>=16&&sec<16*15) sec=16*15; } else if (sec>16*30) sec=16*30; } break; case '0': msg=0; break; case 'C': msg=M_CONNECT; break; case 'O': msg=M_OK; break; case 'T': Putc(M.Bit.tonwahl?'T':'P'); Writes(M.telefnr); break; } break; } if (*at==0) break; } RET: M.bit.execat=0; return (r); } |
#define JMP(n) M.jmp[1]=n; JMP##n: int ModemAT(const uchar *ats) { static unsigned sec; static uchar msg; static const uchar *at; int i, r=0; ///Neu> if (!(M.req&4)) M.req|=4, M.jmp[1]=0, M.bit.execat=1, sec=16*5, msg=0, at=ats; switch (M.jmp[1]) { case 1: goto JMP1; case 2: goto JMP2; case 3: goto JMP3; } ///Neu< for (; ; ++at) { switch (*at) { default : DFL1:; Putc(*at); break; case 0 : case ' ': case '\r': case '\n': KZE:; while (*at && at[1]<=' ') ++at; M.t=U.timetick; M.msg=M.cmd=0; Write("\r\n", 2); JMP(1); ///ZIEL AGAIN:; if (M.msg==0&&M.cmd==0 && U.timetick-M.t<sec) { return 1; } if (M.cmd) { M.cmd=0; goto AGAIN; } if (M.msg==M_RING || M.ring) { M.msg=M.ring=0; goto AGAIN; } if (M.msg) { if (msg&&M.msg!=msg) { r=-1; goto RET; } break; } if (msg&&!(M.Bit.cable&&M.Bit.autoansw)) { r=-1; goto RET; //TIMEOUT } break; case '%': switch (*++at) { default : case '%': goto DFL1; case 0 : goto KZE; case 'd': //Delay(1000); M.t= U.timetick; JMP(2); ///ZIEL if (U.timetick-M.t<16ul) return 1; break; case 'p': //Delay( 250); M.t= U.timetick; JMP(3); ///ZIEL if (U.timetick-M.t<4ul) return 1; break; case 't': for (sec=i=0; i<3 && DIGIT(at[1]); ++i) { sec*= 10, sec+= *++at-'0'; } if (sec>=100) sec+=63, sec>>=6; else sec*=16; if (sec<5) sec=5*1; if (M.Bit.cable) { if (!M.Bit.autoansw) { if (sec>=16&&sec<16*15) sec=16*15; } else if (sec>16*30) sec=16*30; } break; case '0': msg=0; break; case 'C': msg=M_CONNECT; break; case 'O': msg=M_OK; break; case 'T': Putc(M.Bit.tonwahl?'T':'P'); Writes(M.telefnr); break; } break; } if (*at==0) break; } RET: M.bit.execat=0; M.req&=~4; ///Neu return (r); } |
static const byte * FindS(const byte * const buf, int const lbuf, const byte * const str, int const lstr) { register const byte *b=buf, *s=str; register int l=lbuf; const byte * const be=b+l; const byte *fp=0; byte c; if (l>0 && lstr>0 && b && s) { for (; 1; b=fp+1,fp=0,s=str) { c=*s; while (b<be && *b!=c) ++b; if (b>=be) break; fp=b++; ++s; l=lstr; while (--l>0 && b<be && *b==*s) ++b,++s; if (l<=0 || b>=be) break; } } return (fp); } |
adr+4; *(adr+4); adr[4]; adr+=2; adr++; |
arr[page][row][col]; *SKa->link[i]; |
++(SB1.(p->p)); ++(pSB->i); (SB1.(saA[3]).i) = 2; (SB1.(saA[3]).(ca[2])) += 4; (pSB->(saA[1])) = (pSB->(saA[0])); |
#define PLACE(h) \ (0x##h&1?(pc_(1),pp_(0x##h)):(void)0, \ 0x##h&2?(pc_(2),pp_(0x##h)):(void)0) #define READRINGBUF(b,v) (void) \ ( !Mes.b.n \ ?(RIBERR(b)) \ :((Mes.b.r>=sizeof(Mes.b.buf)) \ ?(Mes.b.r=1, v=Mes.b.buf[0], --Mes.b.n) \ :(v= Mes.b.buf[++Mes.b.r-1], --Mes.b.n) \ ) \ ) return (K=abr,r=abr+4, r); |
for (brek=0,i=0; i<sizeof(buf) && brek==0; ++i) { |
if (!Comm.U0r.n) Comm.U0r.r= 0; if (!Comm.U0t.n) Comm.U0t.r= 0; if (!Comm.U2r.n) Comm.U2r.r= 0; if (!Comm.U2t.n) Comm.U2t.r= 0; |
if (!Comm.U0r.n) Comm.U0r.r= Comm.U0r.w=0; if (!Comm.U0t.n) Comm.U0t.r= Comm.U0t.w=0; if (!Comm.U2r.n) Comm.U2r.r= Comm.U2r.w=0; if (!Comm.U2t.n) Comm.U2t.r= Comm.U2t.w=0; |
if (!Comm.U0r.n) { Comm.U0r.r= Comm.U0r.w=0; } else { ; } if (!Comm.U0t.n) { Comm.U0t.r= Comm.U0t.w=0; } else { ; } if (!Comm.U2r.n) { Comm.U2r.r= Comm.U2r.w=0; } else { ; } if (!Comm.U2t.n) { Comm.U2t.r= Comm.U2t.w=0; } else { ; } |
if (r=0, a==6&&(r=1,1) || a==9&&(r=2,s=4,1)) vel=vd; |
if (a==6) { r=1; vel=vd; } else { if (a==9) { r=2; s=4; vel=vd; } else { r=0; } } |
# define Qx() Q(0) Q(1) Q(2) Q(3) Q(4) //... #define Q(q) ...==q+1...[q]...[q+1]...##q...; Qx() #undef Q |
# define LIMa(i,_,OK,BIT) \ /* ...##...##..##. */ \ case 13: \ if (Vd._[i].manu_oc? Vd._[i].oc:ein) \ opto##OK=0, Abit.BIT=1, Vd._[i].oc=1; \ \ if (Vd._[i].manu_oc?!Vd._[i].oc:aus) \ opto##OK=1, Abit.BIT=0, Vd._[i].oc=0; \ break; \ } \ } \ else Vd._[i].tim[0]=Vd._[i].tim[1]=0, \ Vd.outp=0, opto##OK=1; LIMa(0,lv,LIV,lvdoc0) LIMa(0,li,LIM1,lidoc0) LIMa(1,li,LIM2,lidoc1) LIMa(2,li,LIM3,lidoc2) LIMa(3,li,LIM4,lidoc3) #undef LIMa |
// *s0,offs, val, jmpwidth, n UNS getposl(const void *, UNS, UNS4, UNS, UNS); n= getposl(CFGdat, offsetof(struct cfgdat, ident), ident, sizeof(struct cfgdat), CFGdat_ne); |
l+= sprintf(buf+l, "\t%u %5i: %8lu\r\n", f, i, v); |
#define PRINT(p, ...) fprintf(p, __VA_ARGS__) |
#include <stdlib.h> void *malloc( size_t size); void *realloc(void *ptr, size_t size); void free( void *ptr ); |
int(*Buf)[8*1024]; Buf= malloc(sizeof(int[2][8*1024])); if (!Buf) PrintErr("Speichermangel"), exit(2); //... i= Buf[1][k]; //... free(Buf); |
#include <setjmp.h> static jmp_buf jBuf1; int setjmp(jmp_buf jBuf1); void longjmp(jmp_buf jBuf1, int val); |
#include <signal.h> typedef void(*sig_t)(int); void (*signal(int sig, void(*func)(int)))(int); sig_t signal(int sig, sig_t func); int raise(int sig); |
void SigCatch(int); static sig_atomic_t Sig; // In der Regel: int signal(SIGSEGV, SigCatch); signal(SIGFPE , SigCatch); signal(SIGTERM, SigCatch); signal(SIGINT , SigCatch); signal(SIGABRT, SIG_DFL ); signal(SIGILL , SIG_DFL ); void SigCatch(int sig) { if (SIG_ERR == signal(sig, SIG_IGN)) /*...*/; else switch (Sig=sig, sig) { case SIGSEGV: /*...*/ break; case SIGTERM: /*...*/ break; case SIGINT : /*...*/ break; //... } signal(sig, SigCatch); return; } |
#include <stdio.h> FILE *fopen(const char *filename, const char *mode); int fclose(FILE *stream); |
#include <stdio.h> int fprintf(FILE *stream, const char *format, ...); int printf( const char *format, ...); int sprintf(char *s, const char *format, ...); |
printf("---%d, %c, %010u\n+++\n", 111, 'A', 567); ---111, A, 0000000567 +++ |
#include <stdio.h> int fscanf(FILE *stream , const char *format, ...); int scanf( const char *format, ...); int sscanf(const char *s, const char *format, ...); |
scanf(" abc%d", &i); TAB ENTER abc 7 |
NDEBUG void assert(int expression); |
complex imaginary I _Complex_I _Imaginary_I #pragma STDC CX_LIMITED_RANGE on-off-switch [ ... ] |
int isalnum(int c); int isalpha(int c); int iscntrl(int c); int isdigit(int c); int isgraph(int c); int islower(int c); int isprint(int c); int ispunct(int c); int isspace(int c); int isupper(int c); int isxdigit(int c); int tolower(int c); int toupper(int c); |
EDOM EILSEQ ERANGE errno |
fenv_t FE_OVERFLOW FE_TOWARDZERO fexcept_t FE_UNDERFLOW FE_UPWARD FE_DIVBYZERO FE_ALL_EXCEPT FE_DFL_ENV FE_INEXACT FE_DOWNWARD FE_INVALID FE_TONEAREST #pragma STDC FENV_ACCESS on-off-switch void feclearexcept(int excepts); void fegetexceptflag(fexcept_t *flagp, int excepts); void feraiseexcept(int excepts); void fesetexceptflag(const fexcept_t *flagp, int excepts); int fetestexcept(int excepts); int fegetround(void); int fesetround(int round); void fegetenv(fenv_t *envp); int feholdexcept(fenv_t *envp); void fesetenv(const fenv_t *envp); void feupdateenv(const fenv_t *envp); |
[ ... ] |
[ ... ] intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base); uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base); intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base); |
and bitor not_eq xor and_eq compl or xor_eq bitand not or_eq |
CHAR_BIT CHAR_MAX INT_MIN ULONG_MAX SCHAR_MIN MB_LEN_MAX INT_MAX LLONG_MIN SCHAR_MAX SHRT_MIN UINT_MAX LLONG_MAX UCHAR_MAX SHRT_MAX LONG_MIN ULLONG_MAX CHAR_MIN USHRT_MAX LONG_MAX |
struct lconv LC_ALL LC_CTYPE LC_NUMERIC NULL LC_COLLATE LC_MONETARY LC_TIME char *setlocale(int category, const char *locale); struct lconv *localeconv(void); |
float_t INFINITY FP_SUBNORMAL FP_ILOGB0 double_t NAN FP_ZERO FP_ILOGBNAN HUGE_VAL FP_INFINITE FP_FAST_FMA HUGE_VALF FP_NAN FP_FAST_FMAF HUGE_VALL FP_NORMAL FP_FAST_FMAL #pragma STDC FP_CONTRACT on-off-switch int fpclassify(real-floating x); int isfinite(real-floating x); int isinf(real-floating x); int isnan(real-floating x); int isnormal(real-floating x); int signbit(real-floating x); double acos(double x); float acosf(float x); long double acosl(long double x); double asin(double x); float asinf(float x); long double asinl(long double x); double atan(double x); float atanf(float x); long double atanl(long double x); double atan2(double y, double x); float atan2f(float y, float x); long double atan2l(long double y, long double x); double cos(double x); float cosf(float x); long double cosl(long double x); double sin(double x); float sinf(float x); long double sinl(long double x); double tan(double x); float tanf(float x); long double tanl(long double x); double acosh(double x); float acoshf(float x); long double acoshl(long double x); double asinh(double x); float asinhf(float x); long double asinhl(long double x); double atanh(double x); float atanhf(float x); long double atanhl(long double x); double cosh(double x); float coshf(float x); long double coshl(long double x); double sinh(double x); float sinhf(float x); long double sinhl(long double x); double tanh(double x); float tanhf(float x); long double tanhl(long double x); double exp(double x); float expf(float x); long double expl(long double x); double exp2(double x); float exp2f(float x); long double exp2l(long double x); double expm1(double x); float expm1f(float x); long double expm1l(long double x); double frexp(double value, int *exp); float frexpf(float value, int *exp); long double frexpl(long double value, int *exp); int ilogb(double x); int ilogbf(float x); int ilogbl(long double x); double ldexp(double x, int exp); float ldexpf(float x, int exp); long double ldexpl(long double x, int exp); double log(double x); float logf(float x); long double logl(long double x); double log10(double x); float log10f(float x); long double log10l(long double x); double log1p(double x); float log1pf(float x); long double log1pl(long double x); double log2(double x); float log2f(float x); long double log2l(long double x); double logb(double x); float logbf(float x); long double logbl(long double x); double modf(double value, double *iptr); float modff(float value, float *iptr); long double modfl(long double value, long double *iptr); double scalbn(double x, int n); float scalbnf(float x, int n); long double scalbnl(long double x, int n); double scalbln(double x, long int n); float scalblnf(float x, long int n); long double scalblnl(long double x, long int n); double cbrt(double x); float cbrtf(float x); long double cbrtl(long double x); double fabs(double x); float fabsf(float x); long double fabsl(long double x); double hypot(double x, double y); float hypotf(float x, float y); long double hypotl(long double x, long double y); double pow(double x, double y); float powf(float x, float y); long double powl(long double x, long double y); double sqrt(double x); float sqrtf(float x); long double sqrtl(long double x); double erf(double x); float erff(float x); long double erfl(long double x); double erfc(double x); float erfcf(float x); long double erfcl(long double x); double lgamma(double x); float lgammaf(float x); long double lgammal(long double x); double tgamma(double x); float tgammaf(float x); long double tgammal(long double x); double ceil(double x); float ceilf(float x); long double ceill(long double x); double floor(double x); float floorf(float x); long double floorl(long double x); double nearbyint(double x); float nearbyintf(float x); long double nearbyintl(long double x); double rint(double x); float rintf(float x); long double rintl(long double x); long int lrint(double x); long int lrintf(float x); long int lrintl(long double x); long long int llrint(double x); long long int llrintf(float x); long long int llrintl(long double x); double round(double x); float roundf(float x); long double roundl(long double x); long int lround(double x); long int lroundf(float x); long int lroundl(long double x); long long int llround(double x); long long int llroundf(float x); long long int llroundl(long double x); double trunc(double x); float truncf(float x); long double truncl(long double x); double fmod(double x, double y); float fmodf(float x, float y); long double fmodl(long double x, long double y); double remainder(double x, double y); float remainderf(float x, float y); long double remainderl(long double x, long double y); double remquo(double x, double y, int *quo); float remquof(float x, float y, int *quo); long double remquol(long double x, long double y, int *quo); double copysign(double x, double y); float copysignf(float x, float y); long double copysignl(long double x, long double y); double nan(const char *tagp); float nanf(const char *tagp); long double nanl(const char *tagp); double nextafter(double x, double y); float nextafterf(float x, float y); long double nextafterl(long double x, long double y); double nextafterx(double x, long double y); float nextafterxf(float x, long double y); long double nextafterxl(long double x, long double y); double fdim(double x, double y); float fdimf(float x, float y); long double fdiml(long double x, long double y); double fmax(double x, double y); float fmaxf(float x, float y); long double fmaxl(long double x, long double y); double fmin(double x, double y); float fminf(float x, float y); long double fminl(long double x, long double y); double fma(double x, double y, double z); float fmaf(float x, float y, float z); long double fmal(long double x, long double y, long double z); int isgreater(real-floating x, real-floating y); int isgreaterequal(real-floating x, real-floating y); int isless(real-floating x, real-floating y); int islessequal(real-floating x, real-floating y); int islessgreater(real-floating x, real-floating y); int isunordered(real-floating x, real-floating y); |
jmp_buf int setjmp(jmp_buf env); void longjmp(jmp_buf env, int val); |
sig_atomic_t SIG_IGN SIGILL SIGTERM SIG_DFL SIGABRT SIGINT SIG_ERR SIGFPE SIGSEGV void (*signal(int sig, void (*func)(int)))(int); int raise(int sig); |
va_list type va_arg(va_list ap, type); void va_copy(va_list dest, va_list src); void va_end(va_list ap); void va_start(va_list ap, parmN); |
bool true false __bool_true_false_are_defined |
ptrdiff_t size_t wchar_t NULL offsetof(type, member-designator) |
int8_t INT32_MIN UINT_FAST8_MAX int16_t INT64_MIN UINT_FAST16_MAX int32_t INT8_MAX UINT_FAST32_MAX int64_t INT16_MAX UINT_FAST64_MAX uint8_t INT32_MAX INTPTR_MIN uint16_t INT64_MAX INTPTR_MAX uint32_t UINT8_MAX UINTPTR_MAX uint64_t UINT16_MAX INTMAX_MIN int_least8_t UINT32_MAX INTMAX_MAX int_least16_t UINT64_MAX UINTMAX_MAX int_least32_t INT_LEAST8_MIN PTRDIFF_MIN int_least64_t INT_LEAST16_MIN PTRDIFF_MAX uint_least8_t INT_LEAST32_MIN SIG_ATOMIC_MIN uint_least16_t INT_LEAST64_MIN SIG_ATOMIC_MAX uint_least32_t INT_LEAST8_MAX SIZE_MAX uint_least64_t INT_LEAST16_MAX WCHAR_MIN int_fast8_t INT_LEAST32_MAX WCHAR_MAX int_fast16_t INT_LEAST64_MAX WINT_MIN int_fast32_t UINT_LEAST8_MAX WINT_MAX int_fast64_t UINT_LEAST16_MAX INT8_C(value) uint_fast8_t UINT_LEAST32_MAX INT16_C(value) uint_fast16_t UINT_LEAST64_MAX INT32_C(value) uint_fast32_t INT_FAST8_MIN INT64_C(value) uint_fast64_t INT_FAST16_MIN UINT8_C(value) intptr_t INT_FAST32_MIN UINT16_C(value) uintptr_t INT_FAST64_MIN UINT32_C(value) intmax_t INT_FAST8_MAX UINT64_C(value) uintmax_t INT_FAST16_MAX INTMAX_C(value) INT8_MIN INT_FAST32_MAX UINTMAX_C(value) INT16_MIN INT_FAST64_MAX |
size_t _IOLBF FILENAME_MAX TMP_MAX FILE _IONBF L_tmpnam stderr fpos_t BUFSIZ SEEK_CUR stdin NULL EOF SEEK_END stdout _IOFBF FOPEN_MAX SEEK_SET int remove(const char *filename); int rename(const char *old, const char *new); FILE *tmpfile(void); char *tmpnam(char *s); int fclose(FILE *stream); int fflush(FILE *stream); FILE *fopen(const char * restrict filename, const char * restrict mode); FILE *freopen(const char * restrict filename, const char * restrict mode, FILE * restrict stream); void setbuf(FILE * restrict stream, char * restrict buf); int setvbuf(FILE * restrict stream, char * restrict buf, int mode, size_t size); int fprintf(FILE * restrict stream, const char * restrict format, ...); int fscanf(FILE * restrict stream, const char * restrict format, ...); int printf(const char * restrict format, ...); int scanf(const char * restrict format, ...); int snprintf(char * restrict s, size_t n, const char * restrict format, ...); int sprintf(char * restrict s, const char * restrict format, ...); int sscanf(const char * restrict s, const char * restrict format, ...); int vfprintf(FILE * restrict stream, const char * restrict format, va_list arg); int vfscanf(FILE * restrict stream, const char * restrict format, va_list arg); int vprintf(const char * restrict format, va_list arg); int vscanf(const char * restrict format, va_list arg); int vsnprintf(char * restrict s, size_t n, const char * restrict format, va_list arg); int vsprintf(char * restrict s, const char * restrict format, va_list arg); int vsscanf(const char * restrict s, const char * restrict format, va_list arg); int fgetc(FILE *stream); char *fgets(char * restrict s, int n, FILE * restrict stream); int fputc(int c, FILE *stream); int fputs(const char * restrict s, FILE * restrict stream); int getc(FILE *stream); int getchar(void); char *gets(char *s); int putc(int c, FILE *stream); int putchar(int c); int puts(const char *s); int ungetc(int c, FILE *stream); size_t fread(void * restrict ptr, size_t size, size_t nmemb, FILE * restrict stream); size_t fwrite(const void * restrict ptr, size_t size, size_t nmemb, FILE * restrict stream); int fgetpos(FILE * restrict stream, fpos_t * restrict pos); int fseek(FILE *stream, long int offset, int whence); int fsetpos(FILE *stream, const fpos_t *pos); long int ftell(FILE *stream); void rewind(FILE *stream); void clearerr(FILE *stream); int feof(FILE *stream); int ferror(FILE *stream); void perror(const char *s); |
size_t ldiv_t EXIT_FAILURE MB_CUR_MAX wchar_t lldiv_t EXIT_SUCCESS div_t NULL RAND_MAX double atof(const char *nptr); int atoi(const char *nptr); long int atol(const char *nptr); long long int atoll(const char *nptr); double strtod(const char * restrict nptr, char ** restrict endptr); float strtof(const char * restrict nptr, char ** restrict endptr); long double strtold(const char * restrict nptr, char ** restrict endptr); long int strtol(const char * restrict nptr, char ** restrict endptr, int base); long long int strtoll(const char * restrict nptr, char ** restrict endptr, int base); unsigned long int strtoul( const char * restrict nptr, char ** restrict endptr, int base); unsigned long long int strtoull( const char * restrict nptr, char ** restrict endptr, int base); int rand(void); void srand(unsigned int seed); void *calloc(size_t nmemb, size_t size); void free(void *ptr); void *malloc(size_t size); void *realloc(void *ptr, size_t size); void abort(void); int atexit(void (*func)(void)); void exit(int status); char *getenv(const char *name); int system(const char *string); void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); int abs(int j); long int labs(long int j); long long int llabs(long long int j); div_t div(int numer, int denom); ldiv_t ldiv(long int numer, long int denom); lldiv_t lldiv(long long int numer, long long int denom); int mblen(const char *s, size_t n); int mbtowc(wchar_t * restrict pwc, const char * restrict s, size_t n); int wctomb(char *s, wchar_t wchar); size_t mbstowcs(wchar_t * restrict pwcs, const char * restrict s, size_t n); size_t wcstombs(char * restrict s, const wchar_t * restrict pwcs, size_t n); |
size_t NULL void *memcpy(void * restrict s1, const void * restrict s2, size_t n); void *memmove(void *s1, const void *s2, size_t n); char *strcpy(char * restrict s1, const char * restrict s2); char *strncpy(char * restrict s1, const char * restrict s2, size_t n); char *strcat(char * restrict s1, const char * restrict s2); char *strncat(char * restrict s1, const char * restrict s2, size_t n); int memcmp(const void *s1, const void *s2, size_t n); int strcmp(const char *s1, const char *s2); int strcoll(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t n); size_t strxfrm(char * restrict s1, const char * restrict s2, size_t n); void *memchr(const void *s, int c, size_t n); char *strchr(const char *s, int c); size_t strcspn(const char *s1, const char *s2); char *strpbrk(const char *s1, const char *s2); char *strrchr(const char *s, int c); size_t strspn(const char *s1, const char *s2); char *strstr(const char *s1, const char *s2); char *strtok(char * restrict s1, const char * restrict s2); void *memset(void *s, int c, size_t n); char *strerror(int errnum); size_t strlen(const char *s); |
acos sqrt fmod nearbyint asin fabs frexp nextafter atan atan2 tgamma nextafterx acosh cbrt hypot remainder asinh ceil ilogb remquo atanh copysign ldexp rint cos erf lgamma round sin erfc llrint scalbn tan exp2 llround scalbln cosh expm1 log10 trunc sinh fdim log1p carg tanh floor log2 cimag exp fma logb conj log fmax lrint cproj pow fmin lround creal |
NULL _LOCALTIME time_t CLOCKS_PER_SEC size_t struct tm _NO_LEAP_SECONDS clock_t struct tmx clock_t clock(void); double difftime(time_t time1, time_t time0); time_t mktime(struct tm *timeptr); time_t mkxtime(struct tmx *timeptr); time_t time(time_t *timer); char *asctime(const struct tm *timeptr); char *ctime(const time_t *timer); struct tm *gmtime(const time_t *timer); struct tm *localtime(const time_t *timer); size_t strftime(char * restrict s, size_t maxsize, const char * restrict format, const struct tm * restrict timeptr); size_t strfxtime(char * restrict s, size_t maxsize, const char * restrict format, const struct tmx * restrict timeptr); struct tmx *zonetime(const time_t *timer); |
wchar_t wint_t NULL WEOF size_t struct tm WCHAR_MAX mbstate_t struct tmx WCHAR_MIN [ 112 lines ] |
wint_t wctrans_t wctype_t WEOF int iswalnum(wint_t wc); int iswalpha(wint_t wc); int iswcntrl(wint_t wc); int iswdigit(wint_t wc); int iswgraph(wint_t wc); int iswlower(wint_t wc); int iswprint(wint_t wc); int iswpunct(wint_t wc); int iswspace(wint_t wc); int iswupper(wint_t wc); int iswxdigit(wint_t wc); int iswctype(wint_t wc, wctype_t desc); wctype_t wctype(const char *property); wint_t towlower(wint_t wc); wint_t towupper(wint_t wc); wint_t towctrans(wint_t wc, wctrans_t desc); wctrans_t wctrans(const char *property); |
#include <fcntl.h> int open(const char *path, int oflags, ...); int close(int fd); // fd: file descriptor (handle) |
O_RDONLY O_WRONLY O_RDWR // Hiervon genau eines O_CREAT O_TRUNC O_APPEND // ... // beliebig oder-ierbar #if defined(UNIX) # define O_BINARY 0 # define O_TEXT 0 #endif fdo= open(ofnam, O_RDWR|O_CREAT|O_TRUNC|O_APPEND, 0644); if (fdo<0) PrintErr("Öffnen fehlgeschlagen"), exit(2); //... close(fdo); |
#include <unistd.h> /*<io.h>*/ ssize_t read(int fd, void *buf, size_t nbyte); int read(int fd, void *buf, unsigned nbyte); int write(int fd, const void *buf, unsigned nbyte); |
off_t lseek(int fd, off_t offset, int whence); long lseek(int fd, long offset, int whence); |
filesize= lseek(fd, 0L, SEEK_END); |
#include <sys/types.h> #include <sys/stat.h> int stat(const char *path, struct stat *sp); int fstat(int fd, struct stat *sp); |
dev_t st_dev; // Filesystem-ID ino_t st_ino; // i-node Nummer mode_t st_mode; // Datei-Modus nlink_t st_nlink; // Anzahl Links uid_t st_uid; // User-ID gid_t st_gid; // Gruppen-ID dev_t st_rdev; // Geräte-ID off_t st_size; // Dateigröße in Bytes time_t st_atime; // Zeit: letzter Zugriff time_t st_mtime; // Zeit: letzte Modifikation time_t st_ctime; // Zeit: Kreation, Status |
struct stat Stat; if (stat(datei, &Stat)!=0) /* Fehler */; |
chmod(),chown(),chgrp(), chsize(),truncate(),ftruncate(), utime() |
int dup(int fd); int dup2(int fd, int fd2); |
int isatty(int fd); |
int i[2], *ip=i, j; ++*ip; *++ip= 6; j= ++*ip++; // alternativ: ++ip++[0] ++(ip++)[0] j= ++*++ip; // alternativ: ++(++ip)[0] j= (*++ip)++; // alternativ: (++ip)[0]++ // Fehler! : *++ip++ *(++ip)++ |
char c='ü'; i= A[c]; |
unsigned char c='ü'; //oder i= A[(unsigned char)c]; |
sec= SPT*(365UL*(j-1970)+(nsj+MA[t[2]]+t[3]-1+(cjsj&&t[2]>=3))) + (t[4]*3600UL) + (t[5]*60+t[6]); |
unsigned char: 11111111 + 1 == 00000000 255 + 1 == 256-256 == 0 11111111 + 100 == 01100011 255 + 100 == 355-256 == 99 01100011 - 100 == 11111111 99 - 100 == -1+256 == 255 |
struct dirent { __uint32_t d_fileno; __uint16_t d_reclen; __uint8_t d_type; __uint8_t d_namlen; char d_name[1]; }; |
#include <dirent.h> DIR *dirp; struct dirent di, *dip; dip= readdir(dirp); printf("%s\n", dip->d_name); |
int A[3][4], *ip, i; i= (&A[0][0])[5]; ip= &A[0][0]; // Typ: int* i= ip[5]; * * 000011112222 [3] 012301230123 [4] .......... . .0123456789 11 [12] // 1-dimensional: 3x4==12 |
i= ip[0]; i= ip[1]; /* ... */ i= ip[11]; ip+=12; |
static int Kunden(const char *, ...); Kunden("%s%s", "+=", "Hans Mustermann,..."); Kunden("%s%i", "print", NEU); |
for 3 U V W in Wort... do echo $U $V $W done |
for N from $a by $i to $z repeat do echo $N done # to $z repeat # repeat |
z=10 a="n to $z repeat" for $a ; do echo $n; done |
a=b b=c c=ccc echo %t${{{a}}} ${{{a} ccc ccc |
kdo1 &| kdo2 &| kdo3 && kommando kdo1 &| kdo2 &| kdo3 || kommando |
set BUF:0.100000000 echo %t${#BUF} 100000000 catv '.%%' U V 5,10,W$e 220,4 /%n =35000,,BUF: echo %t${#BUF} 35844 |
cat $Datei | { > $Datei while readl Zeile do catv Zeile /%n done >< } catv HTMLa HTML3 3 0 HTMLb <$CO 3</tmp/$CO | cat >$CO |
(( arithmetik arithmetik )) echo $(( arithmetik )) let "arithmetik" "arithmetik" ... (( a>c ? U : V = 26 )) |
Funktion() { local a=. b:.40 argc=$# args=$* static sa #... return 0 } |
expr "$N" :n '^%(.%)%(.*%)$' '%1%L%2' expr "$n" :n ' %([a-z]%)' + ' %U%1' |
echo $SECONDS sleep 4 sleep -m 350 |
continue [ebenen] break [ebenen] goend [ebenen] |
to 10000 repeat do version=$V conv -d.d' ' version expr "$V" =:version 'Productversion:%(%D*%)' done #0.75 s |
# SLE<-- Buf $offs $len Sle16() { local n=00 sle_=000000 word=000000 for word in $( catv $3,$4,$2 | base -w +10 ) do for n from 0 to 15 repeat do if let "{{sle_&16#8000}^{[word&(1<<n)]<<(15-n)}}&16#ffff" then (( sle_= ((((sle_^2064)&2064)<<1)|(sle_<<1)) &((((sle_^2064)&2064)<<1)|~(2064<<1)), sle_&=16#ffff, sle_|=1 )) else (( sle_= ((((sle_^~2064)&2064)<<1)|(sle_<<1)) &((((sle_^~2064)&2064)<<1)|~(2064<<1)), sle_&=~1, sle_&=16#ffff )) fi done done $1=$sle_ return 0 } |
[ $# -ne 0 ] && files="$*" [ $# -eq 0 ] && files=?*.[chCH] % files="$files cbase.txt mbase.txt" read "old?ALT und NEU [aaa nnn]: " new ifset old || exit ifset new || exit expr "$old" :old '\s' += ' ' expr "$new" :new '\s' += ' ' for file in $files do expr "$file" =:: 'sl%D%{2,%}%.h$' && continue grep -qm -e "%<$old%>" "$file" || continue cat "$file" | { 3> "$file" while readl Z do expr "$Z" :Z "%<$old%>" + "$new" print -ru3 "$Z" done >< } done exit 0 |
#!/u/bin/bsh start=0 inc=1 muster='@' width=2 fill=' ' neq=1 [ -t 0 ] &| expr "$1" :: '[^0-9-]' && { print -u2 ninc.bsh: usage: start inc.neq muster % width fillchar exit 0 } [ $# -gt 0 ] && { [ -n "$1" ] && start="$1" [ -n "$2" ] && inc="$2" [ -n "$3" ] && muster="$3" width="$4" fill="$5" } ifset fill && fill="f$fill" expr "$width" :width '^-' = '' && sign=- expr "$inc" :neq '%D%.%(%D%{1,}%)' expr "$inc" :inc '^%(%D%{1,}%)' neqd=$neq cat | { while readl Z do prints "vs$sign$fill"$width subst "$start" expr "$Z" :Z "$muster" = "$subst" && { let "--neqd==0" && let "start+=inc" "neqd=neq" } catv Z /%j done } exit 0 |
#......... [ -n "$4" ] && : >$4 >d__2 4>d__3 print -u4 '%n%n%nconst struct cdata_t '"$1"'data[]= {' <$2 while seek + 0 sk read id dd typ bytelen darst nbit bitpos % dflt1 min1 max1 dflt2 min2 max2 % sgrpn flags einheit name % Tinfo Tgrp Tsgrp Tbit Text text do expr "$id" :: '^%$' && break expr "$id" :: '^}$' && { [ von -ge bis ] && inc=0 continue seek $skvb 0; let 'von+=inc'; continue } expr "$id" :: '^{#$' && { von=$dd bis=$typ inc=$bytelen inc2=$darst ifset inc2 || inc2=1 seek + 0 skvb; continue } #......... prints su4sbsbsbsbsbsbsbsbsbs ' { ' % #......... done #......... |
[ $# -eq 0 ] && exit 0 Zeile() { local a:17.1 b:19.1 comment:.200 local n:.100 if expr "$Z" :comment '[^\]%(%%.*%)$' then expr "$Z" :Z '%([^\]%)%%.*$' '%1' else comment= fi expr "$N" :n '^%(.%)%(.*%)$' '%1%L%2' expr "$n" :n ' %([a-z]%)' + ' %U%1' expr "$Z" :Z "%<$N%>" + "$a&$b" expr "$Z" :Z "\index{$a$N$b" += "\index{$N" expr "$Z" :Z "\textsc{$a$N$b" += "\textsc{$N" expr "$Z" :Z "\verb%(.%)$a$N$b" + "\verb%1$N" expr "$Z" :Z "\label{%([^}]*%)$a$N$b" + "\label{%1$N" expr "$Z" :Z "\pageref{%([^}]*%)$a$N$b" + "\pageref{%1$N" expr "$Z" :Z "\ref{%([^}]*%)$a$N$b" + "\ref{%1$N" expr "$Z" :Z "\textbf{%([^}]*%)$a$N$b" + "\textbf{%1$N" expr "$Z" :Z "$a$N$b" += "\textsc{$n}" ifset comment && catv comment =:,,Z: return 0 } UseNot() { ifset Z || { catv /%n; return 0; } expr "$Z" :: '^[ %t]%{0,}%%' &| expr "$Z" :: '\[a-z]*section[{[]' &| expr "$Z" :: '\[a-z]*section%*[{[]' &| expr "$Z" :: '\chapter[{[]' && { catv Z /%n; return 0 } return 1 } set Z:.300 set Zcmp:.300 set F:.50 set N:.50 V=v for F in kap/*.tex do [ -s "$F" ] || continue [ $# -eq 1 ] && grep -qm "%<$1%>" "$F" || continue cat "$F" | { > "$F" while readl Z Zcmp do if [ $V == V ] then expr "$Z" :: '\end{verbatim}' && V=v catv Z /%n; continue else UseNot && continue expr "$Z" :: '\begin{verbatim}' || goend V=V catv Z /%n; continue fi for N in "$@" do [ ${#N} -ge 2 ] || continue expr "$Z" :: "%<$N%>" || continue Zeile done cmpv Z Zcmp || print -u2 "$F:$Zcmp%n$F:$Z%n" catv Z /%n done >< } done exit 0 |
#!/u/bin/bsh #ctex.bsh: Hauptscript Syntax Highlight in .tex DIR=kap [ -s /tmp/$DIR.tar -o -s /tmp/$DIR.tar.bz2 ] || { print -u2 tar ... tar cf /tmp/$DIR.tar $DIR || exit 1 print -u2 bzip2 ... bzip2 -f /tmp/$DIR.tar || exit 1 } FILES=$DIR/?*.tex CTEX=ctex_l [ $# -eq 2 ] && CMD=$1 LANG=$2 shift 2 [ $# -gt 0 ] && exit 2 C="del prep clear" L="c cpp bsh sh perl tex vim html" ifset CMD && expr "$C" :: "%<$CMD%>" || exit 3 ifset LANG && expr "$L" :: "%<$LANG%>" || exit 4 SetLangKz() { local le=$1 expr "$le" :: '^[a-z]%{1,4}$' || return case "$le" in c|cpp|html) KZ='//' ;; bsh|sh|perl) KZ='##' ;; tex) KZ='%%' ;; vim) KZ='""' ;; *) return 2 ;; esac LE="$le" expr "$LES" :: "%%<$le%%>" || { LES="$LES$le " : 3>$CTEX.$LE } return 0 } PutKode() { let "OFFS<=0 || ${#KODE}<OFFS" && return 0 catv .$KZ@+ NAME ._ TN .@$KZ /%n $OFFS,KODE % .$KZ@- NAME ._ TN .@$KZ /%n =3 3>> "$CTEX.$LE" return 0 } |
set KODE:.30000 set Z:.500 set INAME:.100 set LES:' '100 set FILE:.20 set NAME:.20 set LE:.20 set Le:.20 set N:020 set TN:020 set OFFS:020 z=0 o=0 Beg='\begin{verbatim}' End='\end{verbatim}' Inp='\input{..*%.ctex}' Pv='%%v%%' Pl='%%l%%' LES= for FILE in $FILES do expr "$FILE" :NAME '%([^/]%{1,}%)%.tex$' || continue [ -s "$FILE" ] || continue [ -z "$CMD" -o "$CMD" == clear ] && grep -qm "^${Pl}[a-z]" "$FILE" || continue print -u2 "%t$FILE" N=$((36#a9)) z=0 [ "$CMD" == del ] && z=D [ "$CMD" == prep ] && z=P [ "$CMD" == clear ] && z=C cat $FILE | { > $FILE while readl Z do while : do case $z in 0) expr "$Z" :Le "^$Pl"'%(..*%)$' && z=1 ;; 1) expr "$Z" :: "^$Pv$Beg" &| expr "$Z" :: "^$Beg" || z=0 goend SetLangKz "$Le" || z=0 goend TN=$((36#, ++N)) OFFS=0 INAME="$DIR/${NAME}_$TN.ctex" z=v continue ;; |
v|V) expr "$Z" :: "^$Pv$End" &| expr "$Z" :: "^$End" && z=I if expr "$Z" :: "^$Pv" then o=3 else o=0 catv '.%v%' fi let "OFFS+${#Z}+1>=${#KODE}" && { z=- print -u2 "OFFS=$OFFS" } [ $z == V ] && { catv $o,,Z /%n =$OFFS,,KODE let "OFFS+=${#Z}+1-o" } [ $z == v ] && z=V ;; I) if expr "$Z" :: "$Inp" then Z="\input{$INAME}" else catv '.\input{' INAME '/}%n' fi PutKode z=0 continue ;; P|p) expr "$Z" :: "^$Beg%$" && [ "$z" == P ] && catv '.%l%' LANG /%n z=P expr "$Z" :: "^$Pl$LANG%$" && z=p ;; D) expr "$Z" :: "^$Pl$LANG%$" && z=d ;; d) expr "$Z" :: "$Inp" && z=D continue 2 if expr "$Z" :: "^$Pv" then catv 3,,Z =Z: else z=D fi ;; C) expr "$Z" :: "^$Pl$LANG%$" && continue 2 ;; esac catv Z /%n break done done [ $z == I ] && { catv '.\input{' INAME '/}%n'; PutKode; } >< } done |
ifset CMD && exit 0 for LE in $LES do [ -s $CTEX.$LE ] || continue print -u2 " $CTEX.$LE -> ctex_$LE.htm" gvim -n -f +'set nonu' +TOhtml +"w! ctex_$LE.htm" % +'q!' +'q!' $CTEX.$LE done for LE in $LES do [ -s "ctex_$LE.htm" ] || continue print -u2 " $DIR, ctex_$LE.htm" bsh ./chtm2tex.bsh "$DIR" "ctex_$LE.htm" done exit 0 |
#!/u/bin/bsh #chtm2tex.bsh [ $# -eq 0 ] && exit 0 DIR=. [ $# -gt 1 ] && DIR="$1" shift FILES="$*" set Z:.500 set Text:.100 set Leer:.100 set FILE:.100 set OFILE:.100 set HexC:010 R=000000000 G=000000000 B=000000000 PutText() { local l:20.1 expr "$Text" :Text '"' += '"' expr "$Text" :Text '<' += '<' expr "$Text" :Text '>' += '>' expr "$Text" :Text '&' += '&' expr "$Text" :Text ' ' += "$l" expr "$Text" :Text '\' += '\textbackslash ' expr "$Text" :Text '''' += '\textquoteright ' expr "$Text" :Text '`' += '\textquoteleft ' expr "$Text" :Text '"' += '\textquotedblright ' expr "$Text" :Text '%^' += '\textasciicircum ' expr "$Text" :Text '~' += '\textasciitilde ' expr "$Text" :Text '&' += '\&' expr "$Text" :Text '#' += '\#' expr "$Text" :Text '%$' += '\$' expr "$Text" :Text '%%' += '\%' expr "$Text" :Text '_' += '\_' expr "$Text" :Text '{' += '\{' expr "$Text" :Text '}' += '\}' expr "$Text" :Text '%('"$l"'%{1,}%)' + '\verb:%1:' expr "$Text" :Text "$l" += ' ' ifset Text || return 1 catv Text return 0 } |
MkRgb() { expr "$HexC" :R '^%(..%)....' expr "$HexC" :G '^..%(..%)..' expr "$HexC" :B '^....%(..%)' let "R=16#$R" "G=16#$G" "B=16#$B" let "R=(R*1000+127)/255" % "G=(G*1000+127)/255" % "B=(B*1000+127)/255" [ ${#R} -eq 1 ] && R=0.00$R [ ${#R} -eq 2 ] && R=0.0$R [ ${#R} -eq 3 ] && R=0.$R [ ${#R} -eq 4 ] && R=1.000 [ ${#G} -eq 1 ] && G=0.00$G [ ${#G} -eq 2 ] && G=0.0$G [ ${#G} -eq 3 ] && G=0.$G [ ${#G} -eq 4 ] && G=1.000 [ ${#B} -eq 1 ] && B=0.00$B [ ${#B} -eq 2 ] && B=0.0$B [ ${#B} -eq 3 ] && B=0.$B [ ${#B} -eq 4 ] && B=1.000 return 0 } RAlez='%( %{1,}%)' RAtxt='%([^< ]%{1,}%)' RAfcc='<font color="#%(......%)">' RAbgc='<span style="background-color: #%(......%)">' KZ='[%/*#(;"]%{2}' Leerz() { local k:.10 rek=$1 shift expr "$rek" :k '.' += '}' || k= catv k /\verb: Text /: while ifset rek do catv 1,rek =k: expr "$rek" :rek '^.%(.*%)$' case "$k" in B) catv ".\colorbox[rgb]{$1,$2,$3}{"; shift 3 ;; f) catv ".\textcolor[rgb]{$1,$2,$3}{"; shift 3 ;; b) catv '.\textbf{' ;; esac done return 0 } |
Zeile() { local k=. rek=$1 shift while : do ifset Z || return 0 expr "$rek" :k '%(.%)$' || k=. case "$k" in B) expr "$Z" :Z '^</span>' = '' && k=R ;; f) expr "$Z" :Z '^</font>' = '' && k=R ;; b) expr "$Z" :Z '^</b>' = '' && k=R ;; esac [ "$k" == R ] && { catv '.}'; return 0; } expr "$Z" :Text "^$RAlez" && { Leerz $rek $* expr "$Z" :Z "^$RAlez" = '' } expr "$Z" :Text "^$RAtxt" && { PutText expr "$Z" :Z "^$RAtxt" = '' } expr "$Z" :HexC "^$RAbgc" && { expr "$Z" :Z "^$RAbgc" = '' MkRgb catv ".\colorbox[rgb]{$R,$G,$B}{" Zeile ${rek}B $* $R $G $B } expr "$Z" :HexC "^$RAfcc" && { expr "$Z" :Z "^$RAfcc" = '' MkRgb catv ".\textcolor[rgb]{$R,$G,$B}{" Zeile ${rek}f $* $R $G $B } expr "$Z" :: "^<b>" && { expr "$Z" :Z "^<b>" = '' catv ".\textbf{" Zeile ${rek}b $* } done return 0 } |
for FILE in $FILES do < $FILE while : do OFILE= while readl Z do expr "$Z" :OFILE "$KZ"'@+%(%W%{4,}%)@'"$KZ" && break done ifset OFILE || break print -u2 "%t$DIR/$OFILE.ctex" > $DIR/$OFILE.ctex catv '/\begin{flushleft}%n\begin{ttfamily}%n' while readl Z do expr "$Z" :: "$KZ@-$OFILE@$KZ" && break catv "/\verb: :" Zeile catv /\\%n done catv '/\end{ttfamily}%n\end{flushleft}%n' >< done >< done exit 0 |
154# bsh -E prints s4s4s16 $(( 355)) '' $((2#, 355)) 355 101100011 prints s4s4s16 $(( 355%256)) '' $((2#, 355%256)) 99 1100011 prints s4s4s16 $((-355)) '' $((2#,-355)) -355 1111111010011101 prints s4s4s16 $((-355%256)) '' $((2#,-355%256)) -99 1111111110011101 |
187# bsh -E echo $((36#aa)) $((36#ab)) $((36#zz)) 370 371 1295 echo $((10*36+10*1)) $((10*36+11*1)) $((35*36+35*1)) 370 371 1295 |
new and reinterpret_cast delete and_eq static_cast inline bitand throw class bitor true private bool try public catch typeid protected compl typename friend wchar_t virtual xor operator explicit xor_eq this export or_eq namespace false const_cast using not dynamic_cast mutable not_eq template or |
int operator + (args) { /*...*/ }; class Kunden { /*...*/ }; Kunden K; K+="Hans Mustermann,..."; K.print(NEU); |
for ($N=0; $N<10000; $N++) { $version=""; @list=split /\n/, $V; foreach $_ (@list) { next unless s/^[ \t]*product[ \t]+version[ \t]*://i; s/[^0-9]//g; $version=$version . " " . $_; } $version =~ s/^ //; } #0.53 s |
[ ] ( ) { } . -> ++ -- & * + - ~ ! / % << >> < > <= >= == != ^ | && || ? : ; ... = *= /= %= += -= <<= >>= &= ^= |= , # ## <: :> <% %> %: %:%: |
<: :> <% %> %: %:%: [ ] { } # ## |
() [] -> . L * + - ! ~ ++ -- & (typ) sizeof R (unär) * / % L + - L << >> L < <= > >= L == != L & L ^ L | L && L || L ?: R (ternär) = += -= *= /= %= &= ^= |= <<= >>= R , L |
dec edx # sz js .L6 .p2align 2 .L4: movzx eax, BYTE PTR [esp+edx] # vla mov BYTE PTR e[edx], al # e dec edx # sz jns .L4 .L6: |
lea -1(edx), eax testl eax, eax jl ..B1.9 ..B1.2: lea -1(edx), edx cmpl $6, edx jl ..B1.7 ..B1.4: movzbl (esp,eax), edx movzbl -1(esp,eax), ecx movb dl, e(eax) movzbl -2(esp,eax), edx movb cl, e-1(eax) movb dl, e-2(eax) movzbl -3(esp,eax), edx movb dl, e-3(eax) movzbl -4(esp,eax), edx movb dl, e-4(eax) addl $-5, eax cmpl $6, eax jge ..B1.4 ..B1.7: movzbl (esp,eax), edx movb dl, e(eax) decl eax testl eax, eax jge ..B1.7 ..B1.9: |
#include <opwords.h> eq == ne != lt < le <= gt > ge >= and & or | xor ^ not ~ AND && OR || NOT ! |
Funktion: push ebp mov ebp, esp push ebx sub esp, 4 mov edx, DWORD PTR [ebp+8] # sz, sz mov ebx, esp lea eax, [edx+30] and eax, -16 sub esp, eax lea ecx, [esp+15] and ecx, -16 dec edx # sz js .L6 .p2align 2 .L4: movzx eax, BYTE PTR [ecx+edx] # vla mov BYTE PTR e[edx], al # e dec edx # sz jns .L4 .L6: movsx eax, BYTE PTR e+5 # e, e mov esp, ebx mov ebx, DWORD PTR [ebp-4] leave ret |
.globl Fc .type Fc,@function Fc: #APP push eax pop eax #NO_APP ret .Lfe4: .size Fc,.Lfe4-Fc |
a64l, l64a - convert between long integer and base-64 ASCII a64l - gets long from base-64 representation abort - generate an abort fault abs - return integer absolute value acceptable_password - determine if password is cryptic access, eaccess - determine accessibility of a file addwstr - write a character string with attributes to the adf_gttok - convert word to token adf_gtwrd - get next word from string and copy to buffer adf_gtxcd - get next text code from string and copy to buff advance - pattern match given a compiled regular expressi alarm - set a process alarm clock altzone - difference in seconds between UTC and alternate ascftime - convert date and time to string asctime - converts a tm structure to a 26-character strin atexit - register function to be called at termination atof - converts ASCII to floating point numbers atoi - converts ASCII to integers atol - converts ASCII to long integer numbers bessel: j0, j1, jn, y0, y1, yn - bessel functions brk, sbrk - change data segment space allocation bsearch - binary search a sorted table bstring: bcopy, bcmp, bzero - bit and byte string operations calloc - allocate unused space for an array cftime - convert date and time to string chdir, fchdir - change working directory chdir - change working directory using pathname chmod, fchmod - change mode of file chmod - change mode of file using pathname chown, lchown, fchown - change owner and group of a file chown - change owner and group ID of a file chroot - change root directory chsize - changes the size of a file clock - report CPU time used close - close a file descriptor closedir - closes the named directory stream and frees the compile - compile string for use with advance or step creat - create a new file or rewrite an existing one create_file_securely - create a file using an attribute specification creatsem - creates an instance of a binary semaphore crmode - put terminal into CBREAK mode ctime, localtime, gmtime, asctime, tzset - convert date and time t ctime - converts UNIX epoch time to local time ctype - character handling routines curses - CRT screen handling and optimization package cuserid - get character login name of the user daylight - set to non-zero value if alternate time zone ex dial - establish an outgoing terminal line connection difftime - computes the difference between time values directory: closedir, opendir, readdir, rewinddir, seekdir, telldir - drand48, erand48, jrand48, lcong48, lrand48, nrand48, mrand48, srand48 drand48 - returns non-negative double-precision floating- dup - duplicate an open file descriptor dup2 - duplicate an open file descriptor eaccess - check file accessibility using EUID ecvt, fcvt, gcvt - convert floating-point number to string elf - object file access library encrypt - encrypts a password end, etext, edata - last locations in program endgrent - closes group file when processing is complete endpwent - closes password file when processing is complet environ - array of character pointers to the environment erf, erfc - error function and complementary error function errno - system error messages exec: execl, execv, execle, execve, execlp, execvp - execute a file exit, _exit - terminate process fchdir - change working directory using file descriptor fchmod - change mode of file using file descriptor fchown - change owner and group ID of a file using a fil fclose, fflush - close or flush a stream fclose - writes buffered data and closes stream fcntl - file control ffs - find first set bit fgetgrent - returns pointer to next group structure fgetpasswd - read or clear a password from a file fgetpwent - gets pointer to next matching passwd structure field - FIELD library routines fileno - returns integer file descriptor flushinp - discard current typeahead characters fnmatch - find matching filename or pathname fork - create a new process form - create and display a form forms - character-based-forms package frexp, frexpl, ldexp, ldexpl, logb, logbl, modf, modff, modfl, nextaft fstat - returns information about an open file fstatfs - get file system information fstatvfs - report on a filesystem using a file descriptor fsync - synchronize changes to a file ftime - return time in a structure ftok - standard interprocess communication package ftruncate - set a file to a specified length using a file d ftw - walk a file tree getc, getchar, fgetc, getw - get character or word from a stream getch - read character from terminal associated with a getchar - return next character from stdin getcwd - get pathname of current working directory getdate - convert user format date and time getenv - return value for environment name gethz - return the frequency of the system clock in tic getitimer, setitimer - get and set value of interval timers getpasswd, fgetpasswd, bigcrypt, bigcryptmax - read or clear a getpid, getpgrp, getppid, getpgid - get process, process group, and getprpwuid - searches for numerical user ID matching uid getpw - get user info from UID gettimeofday, settimeofday - get or set the date and time getuid, geteuid, getgid, getegid - get real user, effective user, getwd - get current working directory pathname glob, globfree - generate pathnames matching a pattern gmtime - convert time to UTC gsignal - raises signal identified by its argument hsearch, hcreate, hdestroy - manage hash search tables hypot - euclidean distance function iconv_open, iconv_close, iconv - convert characters from one cod ioctl - I/O control command isastream - test a file descriptor isatty - test for a terminal device item - CRT menu-item routines itimer - interval timers kill - send a signal to a process or a group of proces killchar - return the user's kill character l3tol, ltol3 - convert between 3-byte integers and long intege lchown - change owner and group ID of a symbolic link link - link to a file localtime - converts time pointed to by clock to tm structu logname - return login name of user longjmp - restores last saved environment lsearch, lfind - linear search and update lseek - move read/write file pointer lstat - returns information about a symbolic link ltol3 - converts long integers to three-byte integers mallinfo - report allocated space usage malloc, free, realloc, calloc, cfree, mallinfo, mallopt - allocat malloc - allocate space for an object mallopt - control the space allocation algorithm memmove - copies characters between objects memory: memccpy, memchr, memcmp, memcpy, memset - memory operatio menus - character based menus package mkdir - make a directory mkfifo - make a FIFO special file mknod - make a directory or a special or ordinary file mktemp - make a unique filename mktime - converts local time to calendar time mount - mount a filesystem nap - suspends execution for a short interval napms - make the cursor sleep for ms milliseconds nice - change priority of a process open - open for reading or writing opendir - opens a directory opensem - opens a semaphore panels - character based panels package passlen - determine minimum password length of an account pause - suspend process until signal perror - system error messages pfmt, vpfmt - display error message in standard format pipe - create an interprocess channel popen, pclose - initiate a pipe to or from a process psiginfo - produce system signal messages psignal, psiginfo - system signal messages psignal - produce system signal messages ptrace - process trace putenv - change or add value to environment putpwent - write password file entry pw_nametoid, pw_idtoname, gr_nametoid, gr_idtoname - map between use qsort - quicker sort raise - send signal to the execution program random - better random number generator random, srandom, initstate, setstate - better random number ge randomword - generate a pronounceable password rdchk - checks to see if there is data to be read read - read from a file readdir - returns a pointer to the next active directory readlink - reads a symbolic link readv - read from a file using multiple buffers realloc - change the size of a memory object regcomp, regexec, regerror, regfree - regular expression matching regex - execute a compiled regular expression against a regexp - regular expression compile and match routines remove - removes filename rename - changes filename resetty - restore terminal to previous state rewind - sets position of next I/O operation but does no rewinddir - resets the named directory stream to the beginn rindex - character string operation rint - returns nearest integer value to floating point rmdir - remove a directory savetty - save current state of terminal to a buffer sbrk - add bytes to the break value scalb - returns the quantity value* 2^exp sc_init - scancode Application Programming Interface (API sc_raw - turns off scancode translation and returns the seekdir - sets the position of the next readdir operation setitimer - sets the specified interval timer setjmp, longjmp - non-local goto setlocale - set or read international environment settimeofday - set system date and time setuid, setgid, seteuid, setegid, setreuid, setregid - set use sigaction - detailed signal management signal - set a signal action sigset, sighold, sigrelse, sigignore, sigpause - signal manageme sigsetjmp, siglongjmp - non-local jumps sigsuspend - wait for signal(s) sleep - suspend execution for interval srandom - seed the better random number generator ssignal, gsignal - software signals stat, fstat, lstat, statlstat - returns file status statfs, fstatfs - get file system information statvfs, fstatvfs - get filesystem information stime - set time strcoll, strncoll, strnxfrm, strxfrm - handles collation of st strftime, cftime, ascftime - convert date and time to string string: strcat, strchr, strcmp, strcpy, strcspn, strdup, strlen, strnc strncoll - collates two strings until nth character is rea strptime - date and time conversion strxfrm - transforms the string from symlink - creates symbolic link to a file sync - update super block sysfs - get file system type information system - issue a shell command tcdrain, tcflow, tcflush, tcsendbreak - line control functions tdelete - deletes a node from a binary search tree telldir - returns current location associated with named tempnam - creates a filename in a named directory termattrs - return video attributes supported by the termin termios: tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, tfind - searches for a datum in the tree and returns a time, ftime - return time times - get process and child process times timezone - difference in seconds between UTC and local tim tmpfile - create a temporary file tmpnam, tempnam - create a name for a temporary file truncate, ftruncate - set a file to a specified length tsearch, tfind, tdelete, twalk - manage binary search trees ttyname - get terminal device pathname tzname - contains time zone names tzset - changes values of time variables umask - set and get file creation mask umount - unmount a file system uname - get name of current system ungetc - push character back into input stream ungetch - return a character to the input queue, to be re unlink - remove directory entry usleep - suspend execution for an interval ustat - get file system statistics utime - set file access and modification times utimes - set file times vfork - spawn new process in a virtual memory efficient vidattr - display the specified characters with video att vidputs - display the specified characters with video att wait - wait for child process to stop or terminate waitpid - wait for child process to change state wordexp, wordfree - perform word expansions write - write to a file writev - write to a file using multiple buffers |