1

Topic: Extremal short

It is given: here such : https://raw.githubusercontent.com/KxSys … er/c/c/k.h It is required: to use it in the project and (most important thing) of anything thus not to break. In  - criminal abusing one- both two-alphabetic macroes and typedef, functions from three letters,   and other delights. Who had with such to deal, share thoughts. I have a pair of ideas, and I will describe them after. But anyway, me does not give rest one question: what for? What can be found an explanation to such programming style? After all except as a shit, it is impossible to name it in any way.

2

Re: Extremal short

Hello, uncommon, you wrote: U> But anyway, me does not give rest one question: what for? What can be found an explanation to such programming style? After all except as a shit, it is impossible to name it in any way. This code//remove more clutter #define O printf #define R return #define Z static #define P (x, y) {if (x) R (y);} #define U (x) P (! (x), 0) #define SW switch #define CS (n, x) case n:x; break; #define CD default cannot have other explanation, except the such

3

Re: Extremal short

Hello, uncommon, you wrote: U> Who had with such to deal, share thoughts. Fortunately, it was not necessary, but I would make "filtering spacer", certain "proxy". U> What can be found an explanation to such programming style?

4

Re: Extremal short

Hello, uncommon, you wrote: U> It is given: here such : https://raw.githubusercontent.com/KxSys … er/c/c/k.h U> It is required: to use it in the project and (most important thing) of anything thus not to break. And it is impossible to throw out it on a dustbin to turn in separate , and  therefrom in the form of calls of functions and-or methods of any classes? U> but anyway, me does not give rest one question: what for? What can be found an explanation to such programming style? After all except as a shit, it is impossible to name it in any way. Should be, the mathematician wrote...

5

Re: Extremal short

Hello, uncommon, you wrote: U> It is given: here such : https://raw.githubusercontent.com/KxSys … er/c/c/k.h U> It is required: to use it in the project and (most important thing) of anything thus not to break. In  - criminal abusing one- both two-alphabetic macroes and typedef, functions from three letters,   and other delights. Who had with such to deal, share thoughts. I have a pair of ideas, and I will describe them after. There and then there are clarification https://github.com/KxSystems/kdb/blob/m … readme.txt U> But anyway, to me does not give rest one question: what for? That then so to write: BOOL INSTAPI ConfigDSN (HWND h, WORD j, LPCSTR d, LPCSTR s) {SW (j) {CS (ODBC_REMOVE_DSN, R SQLRemoveDSNFromIni (s+4)) CS (ODBC_ADD_DSN, if (dlg (111)) SQLWriteDSNToIni (b, d))} R 0;} ZS g1 (S s, S a, S v) {L n; U (s=strstr (s, a)) R s + = 4, strncpy (v, s, n = (S) strchr (s, '; ')-s), v [n] =0, v;} ZV av (S s, S a, S v) {s + = strlen (strcat (s, a)), *s ++ = ' = ', s + = strlen (strcpy (s, v)), *s ++ = '; ', *s=0;} #define N 10//1env, 2dbc, 3stmt, 4desc-1 (fail) 0 (success) 1 (successwithinfo) 0-noprompt 1-complete 2-prompt 3-required ZI c [N]; A SQLDisconnect (D d) {I h = (I) (L) d; R kclose (c [h]), c [h] =0;} ZI sj (S s, I j) {R j <0? strlen (s):j;} ZS ssj (S s, S t, I j) {R! t || j <0? t:(strncpy (s, t, j) [j] =0, s);} ZA dq (D d, S q, S u, S p) {S s=strchr (q, ': '); I a; Q (! s, "host:port") *s=0, a=khpu (q, atoi (s+1) ,u&&*u?strcat (strcat (strcpy (b, u), ":") A SQLDriverConnect (D d, HWND w, S s, H j0, S r, H j, H*j2, UH f) {Q (! g1 (s, "DBQ", q) &&!g1 (s, "DSN", q), "DBQ") if (g1 (s, "UID", u)) g1 (s, "PWD", p); else*u=0; if (r) {if (strcpy (r, "DRIVER=kdb +;"), av (r, "DBQ", q), *u) av (r, "UID", u), av (r, "PWD", p); av (r, "DSN", "default"), qj2 (j2, strlen (r));} R dq (d, q, u, p);} ZK*td [N], tk [N]; ZS*tf [N], *tb [N]; Z L*tw [N], ** tn [N]; ZI tc [N], *tu [N], ti [N], tj [N], bi [N], s [N], s0 [N], s3 [N], s5 [ ZV b1 (I h) {I j=tj [h]; tb [h] = (S *) malloc (j*SZ), tu [h] = (I *) malloc (j*4), tw [h] = (L *) malloc (j*SZ), tn [h] = (L **) malloc (j*SZ); DO (j, tb [h] [i] =0)} ZV b0 (I h) {if (tb [h]) free (tb [h]), tb [h] =0, free (tu [h]), free (tw [h]), free (tn [h]);} ZV ch (I h) {if (tk [h]) r0 (tk [h]), tk [h] =0, ti [h] =tj [h] =0;} ZV fh (I h) {ch (h), b0 (h), s [h] =s5 [h] =s6 [h] =0;} A SQLFreeStmt (D d, UH j) {SW (j) {CS (SQL_CLOSE, ch ((I) (L) d)) CS (SQL_UNBIND, b0 ((I) ; K x=k (tc [h], strcat (b, f), s? kpn (s, sj (s, n)):0, (K) 0); P (! x, QS ("08S01", "k1",-1)) Q (xt ==-128, xs) P (xt! =XT, (r0 (x), 0)) R bi [h] =-s9 [h], tk [h] =x, x=xk, tf [h] =kS (xx), x=xy, tj [h] =xn, td [h] =xK, x =*xK, ti [h] =xn, 0;} ZI nu (K x, I i) {I t=xt; R t <KH? 0:t == KH? xH [i] == nh:t == KJ? xJ [i] == nj:t == KE? isnan (xE [i]):t == KF || t == KZ? isnan (xF [i]):t == KC? xG [i] == ' ':t == KS?! *xS [i]:xI [i] == ni;} ZI Td (I f, S b, I d) {H*j = (H *) b; R d=dj (d) If interesting that use a preprocessor it tears macroes. U> what can be found an explanation to such programming style? That there hands there did not climb. Or the author earlier on a Fortran wrote U> After all except as a shit much, it is impossible to name it in any way. It is possible:  and .

6

Re: Extremal short

Hello, kov_serg, you wrote: _> There and then there are clarification _> https://github.com/KxSystems/kdb/blob/m … readme.txt Clarification how to use these macroes, but not why they such curves. By the way, this readme reminds unless marginal notes, instead of the intelligent documentation. U>> but anyway, me does not give rest one question: what for? _> That then so to write: Also what any normal person with such code makes? Throws out it on a dustbin and rewrites. Because to understand it, even if it and works, it all the same what to dig in a shit. That I, by the way, also made with this code first of all. The reasonable decision is unique. _> if interesting that use a preprocessor it tears macroes. No, it is not interesting to me. And what it was interesting to someone? U>> what can be found an explanation to such programming style? _> that there hands there did not climb. What for  the code  to clients for  with the product? That all more or less reasonable clients ?

7

Re: Extremal short

Hello, Pzz, you wrote: U>> It is required: to use it in the project and (most important thing) of anything thus not to break. Pzz> and it is impossible to throw out it on a dustbin to turn in separate , and  therefrom in the form of calls of functions and-or methods of any classes? Correctly. To write own  for their library, and them  anywhere not to include at all. Thanks to that all functions there extern "C", all  is excellent even if to place these functions in namespace, and types of parameters will not coincide. The main thing that in binary representation they were identical. There was still an idea such: namespace crappy_library {#include "k.h"} #undef Z//... undef all those crappy macros But all the same  to potter with their structures. Therefore I decided to rewrite . The blessing only two functions and one structure are necessary to me.

8

Re: Extremal short

Hello, lpd, you wrote: lpd> Hello, uncommon, you wrote: U>> But anyway, me does not give rest one question: what for? What can be found an explanation to such programming style? After all except as a shit, it is impossible to name it in any way. It at them culture such is simple. Authors To consider that the code should be as much as possible laconic. People who got used to such style, ostensibly, can read/write such code much faster. Not any woodpecker invented it, and Arthur Uitni. Here at them the den - https://github.com/kevinlawler/kona In  is coding style - https://github.com/kevinlawler/kona/wik … Guidelines enjoy

9

Re: Extremal short

Hello, uncommon, you wrote: U> It is given: here such : https://raw.githubusercontent.com/KxSys … er/c/c/k.h U> It is required: to use it in the project and (most important thing) of anything thus not to break. In  - criminal abusing one- both two-alphabetic macroes and typedef, functions from three letters,   and other delights. Who had with such to deal, share thoughts. I have a pair of ideas, and I will describe them after. Do not use this . He is necessary to write the code in their style. For certain is normal API for mere mortals.

10

Re: Extremal short

Hello, uncommon, you wrote: U> There was still an idea such: U> U> namespace crappy_library U> {U>#include "k.h" U>} U>#undef Z U>//... undef all those crappy macros U> There full single-letter macroes. The word namespace does not influence them.

11

Re: Extremal short

Hello, uncommon, you wrote: U> Also what any normal person with such code makes? Throws out it on a dustbin and rewrites. Because to understand it, even if it and works, it all the same what to dig in a shit. That I, by the way, also made with this code first of all. The reasonable decision is unique. Happens still that decisions are accepted by which other person that there inside does not interest. U>>> what can be found an explanation to such programming style? _>> that there hands there did not climb. U> what for  the code  to clients for  with the product? That all more or less reasonable clients ? , anything personal. That it what for was required to you.

12

Re: Extremal short

Hello, uncommon, you wrote: _>> If interesting that use a preprocessor it tears macroes. U> is not present, it is not interesting to me. And what it was interesting to someone? It can help to rewrite.

13

Re: Extremal short

Hello, uncommon, you wrote: U> It is given: here such : https://raw.githubusercontent.com/KxSys … er/c/c/k.h It, kdb at all of them such. , for example, on java the code. Style at them such, made such that it was possible to write in q-style. U> but anyway, me does not give rest one question: what for? What can be found an explanation to such programming style? After all except as a shit, it is impossible to name it in any way. Simply consider that it not "c", and "q", other language.

14

Re: Extremal short

Hello, uncommon, you wrote: U> But anyway, me does not give rest one question: what for? What can be found an explanation to such programming style? After all except as a shit, it is impossible to name it in any way. It Kx Database, it all such, completely. It you still their internal language did not see.

15

Re: Extremal short

Hello, Kodt, you wrote: And to lay out in public domain that at authors Kdb a little bit burned with happiness. I too think of it. More less already rewrote everything that is necessary for my purposes. But I think, kdb-shniki do not estimate

16

Re: Extremal short

Hello, uncommon, you wrote: U> It is given: here such : https://raw.githubusercontent.com/KxSys … er/c/c/k.h U> It is required: to use it in the project and (most important thing) of anything thus not to break. In  - criminal abusing one- both two-alphabetic macroes and typedef, functions from three letters,   and other delights. Who had with such to deal, share thoughts. I have a pair of ideas, and I will describe them after. You do long title for switching-on of title and one more - for sweep  in the beginning, you check all macroes which have been included in the code if they are defined - you appropriate it very long legible names, like MY_MACROS_IN_FILE_3DPARTY_INCLUDE_DKJR382R8_kG Then  initial macroes Then you connect the code you do to redefinition macroes on normal names after usage, you connect  sweeps where you return values to the saved macroes, and other it is simple  and generally, it is better to rewrite it  by means of autochangeover means in IDE, at the same time and you will check conflicts

17

Re: Extremal short

Hello, uncommon, you wrote:> And to lay out in public domain that at authors Kdb a little bit burned with happiness. U> I too think of it. More less already rewrote everything that is necessary for my purposes. But I think, kdb-shniki do not estimate I Think, will be spat from yours ""