[OpenSIPS-Devel] [opensips] ASYNC_CHANGE_FD status + db engine async state parameter + db_virtual async (#715)

Liviu Chircu notifications at github.com
Wed Feb 17 18:36:50 CET 2016


> @@ -512,3 +512,180 @@ int db_virtual_insert_update(const db_con_t* _h, const db_key_t* _k,
>  {
>      db_generic_operation2(insert_update(handle->con, _k, _v, _n),1, 1, 1);
>  }
> +
> +#define CURRCON(__ah__) (__ah__->current_con)
> +
> +#define db_generic_async_operation(__h,__ah, _resume_f, FUNC_WITH_ARGS)         \

What's the deal with all the underscores in macro params? To prevent upper function variable overriding? If yes, working out the output of the following code before running it yourself will definitely be good exercise:

```
main() {
    int a = 1, b = 2;
    #define foo(a) a = 2
    foo(b);
    printf("%d %d\n", a, b);
}
```

As a side note, prefixing a C function with `__` is actually **useful** when intending to mark that function as *"a low-level function you should use with caution"*. Take for example `set_proc_log_level`, which makes use of `__set_proc_log_level` behind the curtains.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/715/files#r53200587
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160217/4d5a2801/attachment.htm>


More information about the Devel mailing list