0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #include <string.h>
0035 #include <stdio.h>
0036 #include <stdint.h>
0037 #include <stdlib.h>
0038 #include <memory.h>
0039 #include <errno.h>
0040 #include <dlfcn.h>
0041
0042 #include <atmi.h>
0043 #include <atmi_tls.h>
0044 #include <ndrstandard.h>
0045 #include <ndebug.h>
0046 #include <ndrxdcmn.h>
0047 #include <userlog.h>
0048 #include <xa_cmn.h>
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060 expublic int * Ondrx_Bget_Ferror_addr(TPCONTEXT_T *p_ctxt)
0061 {
0062 int did_set = EXFALSE;
0063 int * ret = NULL;
0064
0065
0066 #ifdef NDRX_OAPI_DEBUG
0067 NDRX_LOG(log_debug, "ENTRY: ndrx_Bget_Ferror_addr() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0068 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0069 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0070
0071 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0072 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0073
0074 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0075 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0076
0077 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0078 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0079
0080 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0081 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0082
0083 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0084 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0085
0086 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0087 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0088 #endif
0089
0090
0091
0092 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0093 {
0094
0095 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0096 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0097 {
0098 userlog("ERROR! ndrx_Bget_Ferror_addr() failed to set context");
0099 ret = NULL;
0100 goto out;
0101 }
0102 did_set = EXTRUE;
0103 }
0104 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0105 {
0106 userlog("WARNING! ndrx_Bget_Ferror_addr() context %p thinks that it is assocated "
0107 "with current thread, but thread is associated with %p context!",
0108 p_ctxt, G_atmi_tls);
0109 }
0110
0111 ret = ndrx_Bget_Ferror_addr();
0112
0113 if (did_set)
0114 {
0115 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0116 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0117 {
0118 userlog("ERROR! ndrx_Bget_Ferror_addr() failed to get context");
0119 ret = NULL;
0120 goto out;
0121 }
0122 }
0123 out:
0124
0125 #ifdef NDRX_OAPI_DEBUG
0126 NDRX_LOG(log_debug, "RETURN: ndrx_Bget_Ferror_addr() returns, context: %p, current: %p",
0127 *p_ctxt, G_atmi_tls);
0128 #endif
0129
0130
0131 return ret;
0132 }
0133
0134
0135
0136
0137
0138 expublic int * O_Bget_Ferror_addr(TPCONTEXT_T *p_ctxt)
0139 {
0140 int did_set = EXFALSE;
0141 int * ret = NULL;
0142
0143
0144 #ifdef NDRX_OAPI_DEBUG
0145 NDRX_LOG(log_debug, "ENTRY: _Bget_Ferror_addr() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0146 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0147 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0148
0149 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0150 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0151
0152 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0153 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0154
0155 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0156 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0157
0158 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0159 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0160
0161 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0162 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0163
0164 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0165 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0166 #endif
0167
0168
0169
0170 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0171 {
0172
0173 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0174 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0175 {
0176 userlog("ERROR! _Bget_Ferror_addr() failed to set context");
0177 ret = NULL;
0178 goto out;
0179 }
0180 did_set = EXTRUE;
0181 }
0182 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0183 {
0184 userlog("WARNING! _Bget_Ferror_addr() context %p thinks that it is assocated "
0185 "with current thread, but thread is associated with %p context!",
0186 p_ctxt, G_atmi_tls);
0187 }
0188
0189 ret = _Bget_Ferror_addr();
0190
0191 if (did_set)
0192 {
0193 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0194 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0195 {
0196 userlog("ERROR! _Bget_Ferror_addr() failed to get context");
0197 ret = NULL;
0198 goto out;
0199 }
0200 }
0201 out:
0202
0203 #ifdef NDRX_OAPI_DEBUG
0204 NDRX_LOG(log_debug, "RETURN: _Bget_Ferror_addr() returns, context: %p, current: %p",
0205 *p_ctxt, G_atmi_tls);
0206 #endif
0207
0208
0209 return ret;
0210 }
0211
0212
0213
0214
0215
0216 expublic int OBlen(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ)
0217 {
0218 int ret = EXSUCCEED;
0219 int did_set = EXFALSE;
0220
0221
0222 #ifdef NDRX_OAPI_DEBUG
0223 NDRX_LOG(log_debug, "ENTRY: Blen() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0224 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0225 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0226
0227 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0228 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0229
0230 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0231 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0232
0233 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0234 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0235
0236 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0237 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0238
0239 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0240 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0241
0242 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0243 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0244 #endif
0245
0246
0247
0248
0249 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0250 {
0251 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0252 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0253 {
0254 userlog("ERROR! Blen() failed to set context");
0255 EXFAIL_OUT(ret);
0256 }
0257 did_set = EXTRUE;
0258 }
0259 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0260 {
0261 userlog("WARNING! Blen() context %p thinks that it is assocated "
0262 "with current thread, but thread is associated with %p context!",
0263 p_ctxt, G_atmi_tls);
0264 }
0265
0266 ret = Blen(p_ub, bfldid, occ);
0267
0268 if (did_set)
0269 {
0270 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0271 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0272 {
0273 userlog("ERROR! Blen() failed to get context");
0274 EXFAIL_OUT(ret);
0275 }
0276 }
0277 out:
0278
0279 #ifdef NDRX_OAPI_DEBUG
0280 NDRX_LOG(log_debug, "RETURN: Blen() returns, context: %p, current: %p",
0281 *p_ctxt, G_atmi_tls);
0282 #endif
0283
0284
0285 return ret;
0286 }
0287
0288
0289
0290
0291
0292 expublic int OCBadd(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, char * buf, BFLDLEN len, int usrtype)
0293 {
0294 int ret = EXSUCCEED;
0295 int did_set = EXFALSE;
0296
0297
0298 #ifdef NDRX_OAPI_DEBUG
0299 NDRX_LOG(log_debug, "ENTRY: CBadd() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0300 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0301 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0302
0303 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0304 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0305
0306 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0307 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0308
0309 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0310 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0311
0312 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0313 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0314
0315 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0316 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0317
0318 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0319 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0320 #endif
0321
0322
0323
0324
0325 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0326 {
0327 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0328 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0329 {
0330 userlog("ERROR! CBadd() failed to set context");
0331 EXFAIL_OUT(ret);
0332 }
0333 did_set = EXTRUE;
0334 }
0335 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0336 {
0337 userlog("WARNING! CBadd() context %p thinks that it is assocated "
0338 "with current thread, but thread is associated with %p context!",
0339 p_ctxt, G_atmi_tls);
0340 }
0341
0342 ret = CBadd(p_ub, bfldid, buf, len, usrtype);
0343
0344 if (did_set)
0345 {
0346 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0347 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0348 {
0349 userlog("ERROR! CBadd() failed to get context");
0350 EXFAIL_OUT(ret);
0351 }
0352 }
0353 out:
0354
0355 #ifdef NDRX_OAPI_DEBUG
0356 NDRX_LOG(log_debug, "RETURN: CBadd() returns, context: %p, current: %p",
0357 *p_ctxt, G_atmi_tls);
0358 #endif
0359
0360
0361 return ret;
0362 }
0363
0364
0365
0366
0367
0368 expublic int OCBchg(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, char * buf, BFLDLEN len, int usrtype)
0369 {
0370 int ret = EXSUCCEED;
0371 int did_set = EXFALSE;
0372
0373
0374 #ifdef NDRX_OAPI_DEBUG
0375 NDRX_LOG(log_debug, "ENTRY: CBchg() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0376 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0377 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0378
0379 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0380 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0381
0382 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0383 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0384
0385 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0386 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0387
0388 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0389 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0390
0391 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0392 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0393
0394 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0395 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0396 #endif
0397
0398
0399
0400
0401 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0402 {
0403 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0404 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0405 {
0406 userlog("ERROR! CBchg() failed to set context");
0407 EXFAIL_OUT(ret);
0408 }
0409 did_set = EXTRUE;
0410 }
0411 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0412 {
0413 userlog("WARNING! CBchg() context %p thinks that it is assocated "
0414 "with current thread, but thread is associated with %p context!",
0415 p_ctxt, G_atmi_tls);
0416 }
0417
0418 ret = CBchg(p_ub, bfldid, occ, buf, len, usrtype);
0419
0420 if (did_set)
0421 {
0422 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0423 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0424 {
0425 userlog("ERROR! CBchg() failed to get context");
0426 EXFAIL_OUT(ret);
0427 }
0428 }
0429 out:
0430
0431 #ifdef NDRX_OAPI_DEBUG
0432 NDRX_LOG(log_debug, "RETURN: CBchg() returns, context: %p, current: %p",
0433 *p_ctxt, G_atmi_tls);
0434 #endif
0435
0436
0437 return ret;
0438 }
0439
0440
0441
0442
0443
0444 expublic int OCBget(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, char *buf, BFLDLEN *len, int usrtype)
0445 {
0446 int ret = EXSUCCEED;
0447 int did_set = EXFALSE;
0448
0449
0450 #ifdef NDRX_OAPI_DEBUG
0451 NDRX_LOG(log_debug, "ENTRY: CBget() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0452 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0453 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0454
0455 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0456 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0457
0458 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0459 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0460
0461 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0462 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0463
0464 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0465 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0466
0467 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0468 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0469
0470 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0471 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0472 #endif
0473
0474
0475
0476
0477 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0478 {
0479 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0480 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0481 {
0482 userlog("ERROR! CBget() failed to set context");
0483 EXFAIL_OUT(ret);
0484 }
0485 did_set = EXTRUE;
0486 }
0487 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0488 {
0489 userlog("WARNING! CBget() context %p thinks that it is assocated "
0490 "with current thread, but thread is associated with %p context!",
0491 p_ctxt, G_atmi_tls);
0492 }
0493
0494 ret = CBget(p_ub, bfldid, occ, buf, len, usrtype);
0495
0496 if (did_set)
0497 {
0498 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0499 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0500 {
0501 userlog("ERROR! CBget() failed to get context");
0502 EXFAIL_OUT(ret);
0503 }
0504 }
0505 out:
0506
0507 #ifdef NDRX_OAPI_DEBUG
0508 NDRX_LOG(log_debug, "RETURN: CBget() returns, context: %p, current: %p",
0509 *p_ctxt, G_atmi_tls);
0510 #endif
0511
0512
0513 return ret;
0514 }
0515
0516
0517
0518
0519
0520 expublic int OBdel(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid, BFLDOCC occ)
0521 {
0522 int ret = EXSUCCEED;
0523 int did_set = EXFALSE;
0524
0525
0526 #ifdef NDRX_OAPI_DEBUG
0527 NDRX_LOG(log_debug, "ENTRY: Bdel() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0528 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0529 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0530
0531 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0532 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0533
0534 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0535 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0536
0537 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0538 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0539
0540 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0541 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0542
0543 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0544 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0545
0546 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0547 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0548 #endif
0549
0550
0551
0552
0553 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0554 {
0555 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0556 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0557 {
0558 userlog("ERROR! Bdel() failed to set context");
0559 EXFAIL_OUT(ret);
0560 }
0561 did_set = EXTRUE;
0562 }
0563 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0564 {
0565 userlog("WARNING! Bdel() context %p thinks that it is assocated "
0566 "with current thread, but thread is associated with %p context!",
0567 p_ctxt, G_atmi_tls);
0568 }
0569
0570 ret = Bdel(p_ub, bfldid, occ);
0571
0572 if (did_set)
0573 {
0574 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0575 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0576 {
0577 userlog("ERROR! Bdel() failed to get context");
0578 EXFAIL_OUT(ret);
0579 }
0580 }
0581 out:
0582
0583 #ifdef NDRX_OAPI_DEBUG
0584 NDRX_LOG(log_debug, "RETURN: Bdel() returns, context: %p, current: %p",
0585 *p_ctxt, G_atmi_tls);
0586 #endif
0587
0588
0589 return ret;
0590 }
0591
0592
0593
0594
0595
0596 expublic int OBpres(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ)
0597 {
0598 int ret = EXSUCCEED;
0599 int did_set = EXFALSE;
0600
0601
0602 #ifdef NDRX_OAPI_DEBUG
0603 NDRX_LOG(log_debug, "ENTRY: Bpres() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0604 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0605 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0606
0607 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0608 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0609
0610 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0611 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0612
0613 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0614 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0615
0616 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0617 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0618
0619 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0620 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0621
0622 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0623 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0624 #endif
0625
0626
0627
0628
0629 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0630 {
0631 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0632 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0633 {
0634 userlog("ERROR! Bpres() failed to set context");
0635 EXFAIL_OUT(ret);
0636 }
0637 did_set = EXTRUE;
0638 }
0639 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0640 {
0641 userlog("WARNING! Bpres() context %p thinks that it is assocated "
0642 "with current thread, but thread is associated with %p context!",
0643 p_ctxt, G_atmi_tls);
0644 }
0645
0646 ret = Bpres(p_ub, bfldid, occ);
0647
0648 if (did_set)
0649 {
0650 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0651 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0652 {
0653 userlog("ERROR! Bpres() failed to get context");
0654 EXFAIL_OUT(ret);
0655 }
0656 }
0657 out:
0658
0659 #ifdef NDRX_OAPI_DEBUG
0660 NDRX_LOG(log_debug, "RETURN: Bpres() returns, context: %p, current: %p",
0661 *p_ctxt, G_atmi_tls);
0662 #endif
0663
0664
0665 return ret;
0666 }
0667
0668
0669
0670
0671
0672 expublic int OBproj(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID * fldlist)
0673 {
0674 int ret = EXSUCCEED;
0675 int did_set = EXFALSE;
0676
0677
0678 #ifdef NDRX_OAPI_DEBUG
0679 NDRX_LOG(log_debug, "ENTRY: Bproj() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0680 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0681 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0682
0683 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0684 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0685
0686 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0687 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0688
0689 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0690 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0691
0692 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0693 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0694
0695 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0696 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0697
0698 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0699 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0700 #endif
0701
0702
0703
0704
0705 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0706 {
0707 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0708 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0709 {
0710 userlog("ERROR! Bproj() failed to set context");
0711 EXFAIL_OUT(ret);
0712 }
0713 did_set = EXTRUE;
0714 }
0715 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0716 {
0717 userlog("WARNING! Bproj() context %p thinks that it is assocated "
0718 "with current thread, but thread is associated with %p context!",
0719 p_ctxt, G_atmi_tls);
0720 }
0721
0722 ret = Bproj(p_ub, fldlist);
0723
0724 if (did_set)
0725 {
0726 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0727 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0728 {
0729 userlog("ERROR! Bproj() failed to get context");
0730 EXFAIL_OUT(ret);
0731 }
0732 }
0733 out:
0734
0735 #ifdef NDRX_OAPI_DEBUG
0736 NDRX_LOG(log_debug, "RETURN: Bproj() returns, context: %p, current: %p",
0737 *p_ctxt, G_atmi_tls);
0738 #endif
0739
0740
0741 return ret;
0742 }
0743
0744
0745
0746
0747
0748 expublic int OBprojcpy(TPCONTEXT_T *p_ctxt, UBFH * p_ub_dst, UBFH * p_ub_src, BFLDID * fldlist)
0749 {
0750 int ret = EXSUCCEED;
0751 int did_set = EXFALSE;
0752
0753
0754 #ifdef NDRX_OAPI_DEBUG
0755 NDRX_LOG(log_debug, "ENTRY: Bprojcpy() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0756 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0757 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0758
0759 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0760 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0761
0762 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0763 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0764
0765 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0766 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0767
0768 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0769 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0770
0771 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0772 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0773
0774 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0775 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0776 #endif
0777
0778
0779
0780
0781 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0782 {
0783 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0784 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0785 {
0786 userlog("ERROR! Bprojcpy() failed to set context");
0787 EXFAIL_OUT(ret);
0788 }
0789 did_set = EXTRUE;
0790 }
0791 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0792 {
0793 userlog("WARNING! Bprojcpy() context %p thinks that it is assocated "
0794 "with current thread, but thread is associated with %p context!",
0795 p_ctxt, G_atmi_tls);
0796 }
0797
0798 ret = Bprojcpy(p_ub_dst, p_ub_src, fldlist);
0799
0800 if (did_set)
0801 {
0802 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0803 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0804 {
0805 userlog("ERROR! Bprojcpy() failed to get context");
0806 EXFAIL_OUT(ret);
0807 }
0808 }
0809 out:
0810
0811 #ifdef NDRX_OAPI_DEBUG
0812 NDRX_LOG(log_debug, "RETURN: Bprojcpy() returns, context: %p, current: %p",
0813 *p_ctxt, G_atmi_tls);
0814 #endif
0815
0816
0817 return ret;
0818 }
0819
0820
0821
0822
0823
0824 expublic BFLDID OBfldid(TPCONTEXT_T *p_ctxt, char *fldnm)
0825 {
0826 BFLDID ret = BBADFLDID;
0827 int did_set = EXFALSE;
0828
0829
0830 #ifdef NDRX_OAPI_DEBUG
0831 NDRX_LOG(log_debug, "ENTRY: Bfldid() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0832 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0833 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0834
0835 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0836 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0837
0838 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0839 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0840
0841 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0842 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0843
0844 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0845 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0846
0847 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0848 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0849
0850 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0851 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0852 #endif
0853
0854
0855
0856 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0857 {
0858
0859 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0860 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0861 {
0862 userlog("ERROR! Bfldid() failed to set context");
0863 ret = BBADFLDID;
0864 goto out;
0865 }
0866 did_set = EXTRUE;
0867 }
0868 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0869 {
0870 userlog("WARNING! Bfldid() context %p thinks that it is assocated "
0871 "with current thread, but thread is associated with %p context!",
0872 p_ctxt, G_atmi_tls);
0873 }
0874
0875 ret = Bfldid(fldnm);
0876
0877 if (did_set)
0878 {
0879 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0880 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0881 {
0882 userlog("ERROR! Bfldid() failed to get context");
0883 ret = BBADFLDID;
0884 goto out;
0885 }
0886 }
0887 out:
0888
0889 #ifdef NDRX_OAPI_DEBUG
0890 NDRX_LOG(log_debug, "RETURN: Bfldid() returns, context: %p, current: %p",
0891 *p_ctxt, G_atmi_tls);
0892 #endif
0893
0894
0895 return ret;
0896 }
0897
0898
0899
0900
0901
0902 expublic char * OBfname(TPCONTEXT_T *p_ctxt, BFLDID bfldid)
0903 {
0904 int did_set = EXFALSE;
0905 char * ret = NULL;
0906
0907
0908 #ifdef NDRX_OAPI_DEBUG
0909 NDRX_LOG(log_debug, "ENTRY: Bfname() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0910 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0911 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0912
0913 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0914 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0915
0916 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0917 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0918
0919 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0920 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0921
0922 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
0923 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
0924
0925 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
0926 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
0927
0928 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
0929 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
0930 #endif
0931
0932
0933
0934 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
0935 {
0936
0937 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
0938 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0939 {
0940 userlog("ERROR! Bfname() failed to set context");
0941 ret = NULL;
0942 goto out;
0943 }
0944 did_set = EXTRUE;
0945 }
0946 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
0947 {
0948 userlog("WARNING! Bfname() context %p thinks that it is assocated "
0949 "with current thread, but thread is associated with %p context!",
0950 p_ctxt, G_atmi_tls);
0951 }
0952
0953 ret = Bfname(bfldid);
0954
0955 if (did_set)
0956 {
0957 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
0958 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
0959 {
0960 userlog("ERROR! Bfname() failed to get context");
0961 ret = NULL;
0962 goto out;
0963 }
0964 }
0965 out:
0966
0967 #ifdef NDRX_OAPI_DEBUG
0968 NDRX_LOG(log_debug, "RETURN: Bfname() returns, context: %p, current: %p",
0969 *p_ctxt, G_atmi_tls);
0970 #endif
0971
0972
0973 return ret;
0974 }
0975
0976
0977
0978
0979
0980 expublic int OBcpy(TPCONTEXT_T *p_ctxt, UBFH * p_ub_dst, UBFH * p_ub_src)
0981 {
0982 int ret = EXSUCCEED;
0983 int did_set = EXFALSE;
0984
0985
0986 #ifdef NDRX_OAPI_DEBUG
0987 NDRX_LOG(log_debug, "ENTRY: Bcpy() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
0988 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
0989 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
0990
0991 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
0992 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
0993
0994 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
0995 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
0996
0997 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
0998 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
0999
1000 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1001 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1002
1003 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1004 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1005
1006 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1007 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1008 #endif
1009
1010
1011
1012
1013 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1014 {
1015 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1016 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1017 {
1018 userlog("ERROR! Bcpy() failed to set context");
1019 EXFAIL_OUT(ret);
1020 }
1021 did_set = EXTRUE;
1022 }
1023 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1024 {
1025 userlog("WARNING! Bcpy() context %p thinks that it is assocated "
1026 "with current thread, but thread is associated with %p context!",
1027 p_ctxt, G_atmi_tls);
1028 }
1029
1030 ret = Bcpy(p_ub_dst, p_ub_src);
1031
1032 if (did_set)
1033 {
1034 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1035 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1036 {
1037 userlog("ERROR! Bcpy() failed to get context");
1038 EXFAIL_OUT(ret);
1039 }
1040 }
1041 out:
1042
1043 #ifdef NDRX_OAPI_DEBUG
1044 NDRX_LOG(log_debug, "RETURN: Bcpy() returns, context: %p, current: %p",
1045 *p_ctxt, G_atmi_tls);
1046 #endif
1047
1048
1049 return ret;
1050 }
1051
1052
1053
1054
1055
1056 expublic int OBchg(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, char * buf, BFLDLEN len)
1057 {
1058 int ret = EXSUCCEED;
1059 int did_set = EXFALSE;
1060
1061
1062 #ifdef NDRX_OAPI_DEBUG
1063 NDRX_LOG(log_debug, "ENTRY: Bchg() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1064 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1065 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1066
1067 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1068 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1069
1070 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1071 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1072
1073 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1074 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1075
1076 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1077 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1078
1079 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1080 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1081
1082 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1083 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1084 #endif
1085
1086
1087
1088
1089 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1090 {
1091 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1092 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1093 {
1094 userlog("ERROR! Bchg() failed to set context");
1095 EXFAIL_OUT(ret);
1096 }
1097 did_set = EXTRUE;
1098 }
1099 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1100 {
1101 userlog("WARNING! Bchg() context %p thinks that it is assocated "
1102 "with current thread, but thread is associated with %p context!",
1103 p_ctxt, G_atmi_tls);
1104 }
1105
1106 ret = Bchg(p_ub, bfldid, occ, buf, len);
1107
1108 if (did_set)
1109 {
1110 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1111 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1112 {
1113 userlog("ERROR! Bchg() failed to get context");
1114 EXFAIL_OUT(ret);
1115 }
1116 }
1117 out:
1118
1119 #ifdef NDRX_OAPI_DEBUG
1120 NDRX_LOG(log_debug, "RETURN: Bchg() returns, context: %p, current: %p",
1121 *p_ctxt, G_atmi_tls);
1122 #endif
1123
1124
1125 return ret;
1126 }
1127
1128
1129
1130
1131
1132 expublic int OBinit(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDLEN len)
1133 {
1134 int ret = EXSUCCEED;
1135 int did_set = EXFALSE;
1136
1137
1138 #ifdef NDRX_OAPI_DEBUG
1139 NDRX_LOG(log_debug, "ENTRY: Binit() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1140 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1141 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1142
1143 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1144 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1145
1146 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1147 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1148
1149 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1150 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1151
1152 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1153 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1154
1155 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1156 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1157
1158 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1159 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1160 #endif
1161
1162
1163
1164
1165 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1166 {
1167 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1168 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1169 {
1170 userlog("ERROR! Binit() failed to set context");
1171 EXFAIL_OUT(ret);
1172 }
1173 did_set = EXTRUE;
1174 }
1175 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1176 {
1177 userlog("WARNING! Binit() context %p thinks that it is assocated "
1178 "with current thread, but thread is associated with %p context!",
1179 p_ctxt, G_atmi_tls);
1180 }
1181
1182 ret = Binit(p_ub, len);
1183
1184 if (did_set)
1185 {
1186 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1187 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1188 {
1189 userlog("ERROR! Binit() failed to get context");
1190 EXFAIL_OUT(ret);
1191 }
1192 }
1193 out:
1194
1195 #ifdef NDRX_OAPI_DEBUG
1196 NDRX_LOG(log_debug, "RETURN: Binit() returns, context: %p, current: %p",
1197 *p_ctxt, G_atmi_tls);
1198 #endif
1199
1200
1201 return ret;
1202 }
1203
1204
1205
1206
1207
1208 expublic int OBnext(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID *bfldid, BFLDOCC *occ, char *buf, BFLDLEN *len)
1209 {
1210 int ret = EXSUCCEED;
1211 int did_set = EXFALSE;
1212
1213
1214 #ifdef NDRX_OAPI_DEBUG
1215 NDRX_LOG(log_debug, "ENTRY: Bnext() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1216 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1217 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1218
1219 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1220 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1221
1222 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1223 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1224
1225 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1226 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1227
1228 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1229 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1230
1231 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1232 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1233
1234 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1235 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1236 #endif
1237
1238
1239
1240
1241 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1242 {
1243 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1244 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1245 {
1246 userlog("ERROR! Bnext() failed to set context");
1247 EXFAIL_OUT(ret);
1248 }
1249 did_set = EXTRUE;
1250 }
1251 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1252 {
1253 userlog("WARNING! Bnext() context %p thinks that it is assocated "
1254 "with current thread, but thread is associated with %p context!",
1255 p_ctxt, G_atmi_tls);
1256 }
1257
1258 ret = Bnext(p_ub, bfldid, occ, buf, len);
1259
1260 if (did_set)
1261 {
1262 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1263 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1264 {
1265 userlog("ERROR! Bnext() failed to get context");
1266 EXFAIL_OUT(ret);
1267 }
1268 }
1269 out:
1270
1271 #ifdef NDRX_OAPI_DEBUG
1272 NDRX_LOG(log_debug, "RETURN: Bnext() returns, context: %p, current: %p",
1273 *p_ctxt, G_atmi_tls);
1274 #endif
1275
1276
1277 return ret;
1278 }
1279
1280
1281
1282
1283
1284 expublic int OBnext2(TPCONTEXT_T *p_ctxt, Bnext_state_t *bnext_state, UBFH *p_ub, BFLDID *bfldid, BFLDOCC *occ, char *buf, BFLDLEN *len, char **d_ptr)
1285 {
1286 int ret = EXSUCCEED;
1287 int did_set = EXFALSE;
1288
1289
1290 #ifdef NDRX_OAPI_DEBUG
1291 NDRX_LOG(log_debug, "ENTRY: Bnext2() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1292 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1293 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1294
1295 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1296 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1297
1298 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1299 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1300
1301 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1302 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1303
1304 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1305 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1306
1307 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1308 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1309
1310 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1311 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1312 #endif
1313
1314
1315
1316
1317 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1318 {
1319 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1320 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1321 {
1322 userlog("ERROR! Bnext2() failed to set context");
1323 EXFAIL_OUT(ret);
1324 }
1325 did_set = EXTRUE;
1326 }
1327 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1328 {
1329 userlog("WARNING! Bnext2() context %p thinks that it is assocated "
1330 "with current thread, but thread is associated with %p context!",
1331 p_ctxt, G_atmi_tls);
1332 }
1333
1334 ret = Bnext2(bnext_state, p_ub, bfldid, occ, buf, len, d_ptr);
1335
1336 if (did_set)
1337 {
1338 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1339 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1340 {
1341 userlog("ERROR! Bnext2() failed to get context");
1342 EXFAIL_OUT(ret);
1343 }
1344 }
1345 out:
1346
1347 #ifdef NDRX_OAPI_DEBUG
1348 NDRX_LOG(log_debug, "RETURN: Bnext2() returns, context: %p, current: %p",
1349 *p_ctxt, G_atmi_tls);
1350 #endif
1351
1352
1353 return ret;
1354 }
1355
1356
1357
1358
1359
1360 expublic int OBget(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid, BFLDOCC occ, char * buf, BFLDLEN * buflen)
1361 {
1362 int ret = EXSUCCEED;
1363 int did_set = EXFALSE;
1364
1365
1366 #ifdef NDRX_OAPI_DEBUG
1367 NDRX_LOG(log_debug, "ENTRY: Bget() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1368 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1369 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1370
1371 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1372 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1373
1374 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1375 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1376
1377 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1378 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1379
1380 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1381 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1382
1383 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1384 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1385
1386 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1387 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1388 #endif
1389
1390
1391
1392
1393 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1394 {
1395 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1396 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1397 {
1398 userlog("ERROR! Bget() failed to set context");
1399 EXFAIL_OUT(ret);
1400 }
1401 did_set = EXTRUE;
1402 }
1403 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1404 {
1405 userlog("WARNING! Bget() context %p thinks that it is assocated "
1406 "with current thread, but thread is associated with %p context!",
1407 p_ctxt, G_atmi_tls);
1408 }
1409
1410 ret = Bget(p_ub, bfldid, occ, buf, buflen);
1411
1412 if (did_set)
1413 {
1414 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1415 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1416 {
1417 userlog("ERROR! Bget() failed to get context");
1418 EXFAIL_OUT(ret);
1419 }
1420 }
1421 out:
1422
1423 #ifdef NDRX_OAPI_DEBUG
1424 NDRX_LOG(log_debug, "RETURN: Bget() returns, context: %p, current: %p",
1425 *p_ctxt, G_atmi_tls);
1426 #endif
1427
1428
1429 return ret;
1430 }
1431
1432
1433
1434
1435
1436 expublic char * OBboolco(TPCONTEXT_T *p_ctxt, char * expr)
1437 {
1438 int did_set = EXFALSE;
1439 char * ret = NULL;
1440
1441
1442 #ifdef NDRX_OAPI_DEBUG
1443 NDRX_LOG(log_debug, "ENTRY: Bboolco() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1444 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1445 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1446
1447 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1448 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1449
1450 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1451 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1452
1453 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1454 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1455
1456 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1457 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1458
1459 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1460 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1461
1462 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1463 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1464 #endif
1465
1466
1467
1468 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1469 {
1470
1471 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1472 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1473 {
1474 userlog("ERROR! Bboolco() failed to set context");
1475 ret = NULL;
1476 goto out;
1477 }
1478 did_set = EXTRUE;
1479 }
1480 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1481 {
1482 userlog("WARNING! Bboolco() context %p thinks that it is assocated "
1483 "with current thread, but thread is associated with %p context!",
1484 p_ctxt, G_atmi_tls);
1485 }
1486
1487 ret = Bboolco(expr);
1488
1489 if (did_set)
1490 {
1491 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1492 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1493 {
1494 userlog("ERROR! Bboolco() failed to get context");
1495 ret = NULL;
1496 goto out;
1497 }
1498 }
1499 out:
1500
1501 #ifdef NDRX_OAPI_DEBUG
1502 NDRX_LOG(log_debug, "RETURN: Bboolco() returns, context: %p, current: %p",
1503 *p_ctxt, G_atmi_tls);
1504 #endif
1505
1506
1507 return ret;
1508 }
1509
1510
1511
1512
1513
1514 expublic char * OBfind(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid, BFLDOCC occ, BFLDLEN * p_len)
1515 {
1516 int did_set = EXFALSE;
1517 char * ret = NULL;
1518
1519
1520 #ifdef NDRX_OAPI_DEBUG
1521 NDRX_LOG(log_debug, "ENTRY: Bfind() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1522 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1523 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1524
1525 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1526 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1527
1528 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1529 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1530
1531 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1532 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1533
1534 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1535 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1536
1537 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1538 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1539
1540 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1541 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1542 #endif
1543
1544
1545
1546 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1547 {
1548
1549 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1550 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1551 {
1552 userlog("ERROR! Bfind() failed to set context");
1553 ret = NULL;
1554 goto out;
1555 }
1556 did_set = EXTRUE;
1557 }
1558 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1559 {
1560 userlog("WARNING! Bfind() context %p thinks that it is assocated "
1561 "with current thread, but thread is associated with %p context!",
1562 p_ctxt, G_atmi_tls);
1563 }
1564
1565 ret = Bfind(p_ub, bfldid, occ, p_len);
1566
1567 if (did_set)
1568 {
1569 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1570 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1571 {
1572 userlog("ERROR! Bfind() failed to get context");
1573 ret = NULL;
1574 goto out;
1575 }
1576 }
1577 out:
1578
1579 #ifdef NDRX_OAPI_DEBUG
1580 NDRX_LOG(log_debug, "RETURN: Bfind() returns, context: %p, current: %p",
1581 *p_ctxt, G_atmi_tls);
1582 #endif
1583
1584
1585 return ret;
1586 }
1587
1588
1589
1590
1591
1592 expublic int OBboolev(TPCONTEXT_T *p_ctxt, UBFH * p_ub, char *tree)
1593 {
1594 int ret = EXSUCCEED;
1595 int did_set = EXFALSE;
1596
1597
1598 #ifdef NDRX_OAPI_DEBUG
1599 NDRX_LOG(log_debug, "ENTRY: Bboolev() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1600 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1601 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1602
1603 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1604 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1605
1606 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1607 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1608
1609 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1610 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1611
1612 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1613 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1614
1615 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1616 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1617
1618 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1619 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1620 #endif
1621
1622
1623
1624
1625 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1626 {
1627 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1628 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1629 {
1630 userlog("ERROR! Bboolev() failed to set context");
1631 EXFAIL_OUT(ret);
1632 }
1633 did_set = EXTRUE;
1634 }
1635 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1636 {
1637 userlog("WARNING! Bboolev() context %p thinks that it is assocated "
1638 "with current thread, but thread is associated with %p context!",
1639 p_ctxt, G_atmi_tls);
1640 }
1641
1642 ret = Bboolev(p_ub, tree);
1643
1644 if (did_set)
1645 {
1646 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1647 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1648 {
1649 userlog("ERROR! Bboolev() failed to get context");
1650 EXFAIL_OUT(ret);
1651 }
1652 }
1653 out:
1654
1655 #ifdef NDRX_OAPI_DEBUG
1656 NDRX_LOG(log_debug, "RETURN: Bboolev() returns, context: %p, current: %p",
1657 *p_ctxt, G_atmi_tls);
1658 #endif
1659
1660
1661 return ret;
1662 }
1663
1664
1665
1666
1667
1668 expublic double OBfloatev(TPCONTEXT_T *p_ctxt, UBFH * p_ub, char *tree)
1669 {
1670 double ret = EXSUCCEED;
1671 int did_set = EXFALSE;
1672
1673
1674 #ifdef NDRX_OAPI_DEBUG
1675 NDRX_LOG(log_debug, "ENTRY: Bfloatev() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1676 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1677 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1678
1679 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1680 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1681
1682 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1683 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1684
1685 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1686 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1687
1688 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1689 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1690
1691 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1692 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1693
1694 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1695 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1696 #endif
1697
1698
1699
1700
1701 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1702 {
1703 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1704 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1705 {
1706 userlog("ERROR! Bfloatev() failed to set context");
1707 EXFAIL_OUT(ret);
1708 }
1709 did_set = EXTRUE;
1710 }
1711 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1712 {
1713 userlog("WARNING! Bfloatev() context %p thinks that it is assocated "
1714 "with current thread, but thread is associated with %p context!",
1715 p_ctxt, G_atmi_tls);
1716 }
1717
1718 ret = Bfloatev(p_ub, tree);
1719
1720 if (did_set)
1721 {
1722 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1723 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1724 {
1725 userlog("ERROR! Bfloatev() failed to get context");
1726 EXFAIL_OUT(ret);
1727 }
1728 }
1729 out:
1730
1731 #ifdef NDRX_OAPI_DEBUG
1732 NDRX_LOG(log_debug, "RETURN: Bfloatev() returns, context: %p, current: %p",
1733 *p_ctxt, G_atmi_tls);
1734 #endif
1735
1736
1737 return ret;
1738 }
1739
1740
1741
1742
1743
1744 expublic int OBadd(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, char *buf, BFLDLEN len)
1745 {
1746 int ret = EXSUCCEED;
1747 int did_set = EXFALSE;
1748
1749
1750 #ifdef NDRX_OAPI_DEBUG
1751 NDRX_LOG(log_debug, "ENTRY: Badd() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1752 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1753 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1754
1755 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1756 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1757
1758 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1759 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1760
1761 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1762 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1763
1764 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1765 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1766
1767 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1768 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1769
1770 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1771 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1772 #endif
1773
1774
1775
1776
1777 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1778 {
1779 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1780 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1781 {
1782 userlog("ERROR! Badd() failed to set context");
1783 EXFAIL_OUT(ret);
1784 }
1785 did_set = EXTRUE;
1786 }
1787 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1788 {
1789 userlog("WARNING! Badd() context %p thinks that it is assocated "
1790 "with current thread, but thread is associated with %p context!",
1791 p_ctxt, G_atmi_tls);
1792 }
1793
1794 ret = Badd(p_ub, bfldid, buf, len);
1795
1796 if (did_set)
1797 {
1798 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1799 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1800 {
1801 userlog("ERROR! Badd() failed to get context");
1802 EXFAIL_OUT(ret);
1803 }
1804 }
1805 out:
1806
1807 #ifdef NDRX_OAPI_DEBUG
1808 NDRX_LOG(log_debug, "RETURN: Badd() returns, context: %p, current: %p",
1809 *p_ctxt, G_atmi_tls);
1810 #endif
1811
1812
1813 return ret;
1814 }
1815
1816
1817
1818
1819
1820 expublic int OBaddfast(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, char *buf, BFLDLEN len, Bfld_loc_info_t *next_fld)
1821 {
1822 int ret = EXSUCCEED;
1823 int did_set = EXFALSE;
1824
1825
1826 #ifdef NDRX_OAPI_DEBUG
1827 NDRX_LOG(log_debug, "ENTRY: Baddfast() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1828 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1829 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1830
1831 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1832 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1833
1834 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1835 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1836
1837 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1838 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1839
1840 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1841 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1842
1843 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1844 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1845
1846 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1847 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1848 #endif
1849
1850
1851
1852
1853 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1854 {
1855 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1856 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1857 {
1858 userlog("ERROR! Baddfast() failed to set context");
1859 EXFAIL_OUT(ret);
1860 }
1861 did_set = EXTRUE;
1862 }
1863 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1864 {
1865 userlog("WARNING! Baddfast() context %p thinks that it is assocated "
1866 "with current thread, but thread is associated with %p context!",
1867 p_ctxt, G_atmi_tls);
1868 }
1869
1870 ret = Baddfast(p_ub, bfldid, buf, len, next_fld);
1871
1872 if (did_set)
1873 {
1874 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1875 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1876 {
1877 userlog("ERROR! Baddfast() failed to get context");
1878 EXFAIL_OUT(ret);
1879 }
1880 }
1881 out:
1882
1883 #ifdef NDRX_OAPI_DEBUG
1884 NDRX_LOG(log_debug, "RETURN: Baddfast() returns, context: %p, current: %p",
1885 *p_ctxt, G_atmi_tls);
1886 #endif
1887
1888
1889 return ret;
1890 }
1891
1892
1893
1894
1895
1896 expublic char * OBecodestr(TPCONTEXT_T *p_ctxt, int err)
1897 {
1898 int did_set = EXFALSE;
1899 char * ret = NULL;
1900
1901
1902 #ifdef NDRX_OAPI_DEBUG
1903 NDRX_LOG(log_debug, "ENTRY: Becodestr() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1904 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1905 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1906
1907 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1908 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1909
1910 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1911 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1912
1913 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1914 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1915
1916 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1917 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1918
1919 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1920 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1921
1922 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1923 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
1924 #endif
1925
1926
1927
1928 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
1929 {
1930
1931 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
1932 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1933 {
1934 userlog("ERROR! Becodestr() failed to set context");
1935 ret = NULL;
1936 goto out;
1937 }
1938 did_set = EXTRUE;
1939 }
1940 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
1941 {
1942 userlog("WARNING! Becodestr() context %p thinks that it is assocated "
1943 "with current thread, but thread is associated with %p context!",
1944 p_ctxt, G_atmi_tls);
1945 }
1946
1947 ret = Becodestr(err);
1948
1949 if (did_set)
1950 {
1951 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
1952 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
1953 {
1954 userlog("ERROR! Becodestr() failed to get context");
1955 ret = NULL;
1956 goto out;
1957 }
1958 }
1959 out:
1960
1961 #ifdef NDRX_OAPI_DEBUG
1962 NDRX_LOG(log_debug, "RETURN: Becodestr() returns, context: %p, current: %p",
1963 *p_ctxt, G_atmi_tls);
1964 #endif
1965
1966
1967 return ret;
1968 }
1969
1970
1971
1972
1973 expublic void OB_error(TPCONTEXT_T *p_ctxt, char *str)
1974 {
1975 int did_set = EXFALSE;
1976
1977
1978 #ifdef NDRX_OAPI_DEBUG
1979 NDRX_LOG(log_debug, "ENTRY: B_error() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
1980 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
1981 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
1982
1983 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
1984 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
1985
1986 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
1987 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
1988
1989 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
1990 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
1991
1992 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
1993 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
1994
1995 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
1996 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
1997
1998 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
1999 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2000 #endif
2001
2002
2003
2004
2005 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2006 {
2007
2008 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2009 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2010 {
2011 userlog("ERROR! B_error() failed to set context");
2012 }
2013 did_set = EXTRUE;
2014 }
2015 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2016 {
2017 userlog("WARNING! B_error() context %p thinks that it is assocated "
2018 "with current thread, but thread is associated with %p context!",
2019 p_ctxt, G_atmi_tls);
2020 }
2021
2022 B_error(str);
2023
2024 if (did_set)
2025 {
2026 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2027 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2028 {
2029 userlog("ERROR! B_error() failed to get context");
2030 }
2031 }
2032 out:
2033
2034 #ifdef NDRX_OAPI_DEBUG
2035 NDRX_LOG(log_debug, "RETURN: B_error() returns, context: %p, current: %p",
2036 *p_ctxt, G_atmi_tls);
2037 #endif
2038
2039
2040 return;
2041 }
2042
2043
2044
2045
2046
2047 expublic char * OBstrerror(TPCONTEXT_T *p_ctxt, int err)
2048 {
2049 int did_set = EXFALSE;
2050 char * ret = NULL;
2051
2052
2053 #ifdef NDRX_OAPI_DEBUG
2054 NDRX_LOG(log_debug, "ENTRY: Bstrerror() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2055 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2056 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2057
2058 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2059 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2060
2061 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2062 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2063
2064 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2065 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2066
2067 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2068 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2069
2070 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2071 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2072
2073 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2074 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2075 #endif
2076
2077
2078
2079 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2080 {
2081
2082 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2083 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2084 {
2085 userlog("ERROR! Bstrerror() failed to set context");
2086 ret = NULL;
2087 goto out;
2088 }
2089 did_set = EXTRUE;
2090 }
2091 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2092 {
2093 userlog("WARNING! Bstrerror() context %p thinks that it is assocated "
2094 "with current thread, but thread is associated with %p context!",
2095 p_ctxt, G_atmi_tls);
2096 }
2097
2098 ret = Bstrerror(err);
2099
2100 if (did_set)
2101 {
2102 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2103 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2104 {
2105 userlog("ERROR! Bstrerror() failed to get context");
2106 ret = NULL;
2107 goto out;
2108 }
2109 }
2110 out:
2111
2112 #ifdef NDRX_OAPI_DEBUG
2113 NDRX_LOG(log_debug, "RETURN: Bstrerror() returns, context: %p, current: %p",
2114 *p_ctxt, G_atmi_tls);
2115 #endif
2116
2117
2118 return ret;
2119 }
2120
2121
2122
2123
2124
2125 expublic BFLDID OBmkfldid(TPCONTEXT_T *p_ctxt, int fldtype, BFLDID bfldid)
2126 {
2127 BFLDID ret = BBADFLDID;
2128 int did_set = EXFALSE;
2129
2130
2131 #ifdef NDRX_OAPI_DEBUG
2132 NDRX_LOG(log_debug, "ENTRY: Bmkfldid() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2133 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2134 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2135
2136 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2137 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2138
2139 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2140 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2141
2142 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2143 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2144
2145 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2146 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2147
2148 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2149 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2150
2151 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2152 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2153 #endif
2154
2155
2156
2157 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2158 {
2159
2160 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2161 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2162 {
2163 userlog("ERROR! Bmkfldid() failed to set context");
2164 ret = BBADFLDID;
2165 goto out;
2166 }
2167 did_set = EXTRUE;
2168 }
2169 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2170 {
2171 userlog("WARNING! Bmkfldid() context %p thinks that it is assocated "
2172 "with current thread, but thread is associated with %p context!",
2173 p_ctxt, G_atmi_tls);
2174 }
2175
2176 ret = Bmkfldid(fldtype, bfldid);
2177
2178 if (did_set)
2179 {
2180 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2181 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2182 {
2183 userlog("ERROR! Bmkfldid() failed to get context");
2184 ret = BBADFLDID;
2185 goto out;
2186 }
2187 }
2188 out:
2189
2190 #ifdef NDRX_OAPI_DEBUG
2191 NDRX_LOG(log_debug, "RETURN: Bmkfldid() returns, context: %p, current: %p",
2192 *p_ctxt, G_atmi_tls);
2193 #endif
2194
2195
2196 return ret;
2197 }
2198
2199
2200
2201
2202
2203 expublic BFLDOCC OBoccur(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid)
2204 {
2205 BFLDOCC ret = EXSUCCEED;
2206 int did_set = EXFALSE;
2207
2208
2209 #ifdef NDRX_OAPI_DEBUG
2210 NDRX_LOG(log_debug, "ENTRY: Boccur() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2211 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2212 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2213
2214 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2215 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2216
2217 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2218 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2219
2220 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2221 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2222
2223 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2224 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2225
2226 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2227 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2228
2229 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2230 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2231 #endif
2232
2233
2234
2235
2236 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2237 {
2238 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2239 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2240 {
2241 userlog("ERROR! Boccur() failed to set context");
2242 EXFAIL_OUT(ret);
2243 }
2244 did_set = EXTRUE;
2245 }
2246 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2247 {
2248 userlog("WARNING! Boccur() context %p thinks that it is assocated "
2249 "with current thread, but thread is associated with %p context!",
2250 p_ctxt, G_atmi_tls);
2251 }
2252
2253 ret = Boccur(p_ub, bfldid);
2254
2255 if (did_set)
2256 {
2257 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2258 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2259 {
2260 userlog("ERROR! Boccur() failed to get context");
2261 EXFAIL_OUT(ret);
2262 }
2263 }
2264 out:
2265
2266 #ifdef NDRX_OAPI_DEBUG
2267 NDRX_LOG(log_debug, "RETURN: Boccur() returns, context: %p, current: %p",
2268 *p_ctxt, G_atmi_tls);
2269 #endif
2270
2271
2272 return ret;
2273 }
2274
2275
2276
2277
2278
2279 expublic long OBused(TPCONTEXT_T *p_ctxt, UBFH *p_ub)
2280 {
2281 long ret = EXSUCCEED;
2282 int did_set = EXFALSE;
2283
2284
2285 #ifdef NDRX_OAPI_DEBUG
2286 NDRX_LOG(log_debug, "ENTRY: Bused() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2287 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2288 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2289
2290 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2291 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2292
2293 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2294 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2295
2296 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2297 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2298
2299 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2300 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2301
2302 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2303 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2304
2305 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2306 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2307 #endif
2308
2309
2310
2311
2312 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2313 {
2314 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2315 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2316 {
2317 userlog("ERROR! Bused() failed to set context");
2318 EXFAIL_OUT(ret);
2319 }
2320 did_set = EXTRUE;
2321 }
2322 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2323 {
2324 userlog("WARNING! Bused() context %p thinks that it is assocated "
2325 "with current thread, but thread is associated with %p context!",
2326 p_ctxt, G_atmi_tls);
2327 }
2328
2329 ret = Bused(p_ub);
2330
2331 if (did_set)
2332 {
2333 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2334 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2335 {
2336 userlog("ERROR! Bused() failed to get context");
2337 EXFAIL_OUT(ret);
2338 }
2339 }
2340 out:
2341
2342 #ifdef NDRX_OAPI_DEBUG
2343 NDRX_LOG(log_debug, "RETURN: Bused() returns, context: %p, current: %p",
2344 *p_ctxt, G_atmi_tls);
2345 #endif
2346
2347
2348 return ret;
2349 }
2350
2351
2352
2353
2354
2355 expublic int OBfldtype(TPCONTEXT_T *p_ctxt, BFLDID bfldid)
2356 {
2357 int ret = EXSUCCEED;
2358 int did_set = EXFALSE;
2359
2360
2361 #ifdef NDRX_OAPI_DEBUG
2362 NDRX_LOG(log_debug, "ENTRY: Bfldtype() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2363 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2364 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2365
2366 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2367 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2368
2369 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2370 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2371
2372 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2373 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2374
2375 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2376 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2377
2378 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2379 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2380
2381 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2382 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2383 #endif
2384
2385
2386
2387
2388 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2389 {
2390 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2391 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2392 {
2393 userlog("ERROR! Bfldtype() failed to set context");
2394 EXFAIL_OUT(ret);
2395 }
2396 did_set = EXTRUE;
2397 }
2398 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2399 {
2400 userlog("WARNING! Bfldtype() context %p thinks that it is assocated "
2401 "with current thread, but thread is associated with %p context!",
2402 p_ctxt, G_atmi_tls);
2403 }
2404
2405 ret = Bfldtype(bfldid);
2406
2407 if (did_set)
2408 {
2409 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2410 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2411 {
2412 userlog("ERROR! Bfldtype() failed to get context");
2413 EXFAIL_OUT(ret);
2414 }
2415 }
2416 out:
2417
2418 #ifdef NDRX_OAPI_DEBUG
2419 NDRX_LOG(log_debug, "RETURN: Bfldtype() returns, context: %p, current: %p",
2420 *p_ctxt, G_atmi_tls);
2421 #endif
2422
2423
2424 return ret;
2425 }
2426
2427
2428
2429
2430
2431 expublic int OBdelall(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid)
2432 {
2433 int ret = EXSUCCEED;
2434 int did_set = EXFALSE;
2435
2436
2437 #ifdef NDRX_OAPI_DEBUG
2438 NDRX_LOG(log_debug, "ENTRY: Bdelall() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2439 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2440 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2441
2442 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2443 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2444
2445 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2446 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2447
2448 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2449 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2450
2451 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2452 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2453
2454 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2455 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2456
2457 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2458 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2459 #endif
2460
2461
2462
2463
2464 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2465 {
2466 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2467 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2468 {
2469 userlog("ERROR! Bdelall() failed to set context");
2470 EXFAIL_OUT(ret);
2471 }
2472 did_set = EXTRUE;
2473 }
2474 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2475 {
2476 userlog("WARNING! Bdelall() context %p thinks that it is assocated "
2477 "with current thread, but thread is associated with %p context!",
2478 p_ctxt, G_atmi_tls);
2479 }
2480
2481 ret = Bdelall(p_ub, bfldid);
2482
2483 if (did_set)
2484 {
2485 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2486 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2487 {
2488 userlog("ERROR! Bdelall() failed to get context");
2489 EXFAIL_OUT(ret);
2490 }
2491 }
2492 out:
2493
2494 #ifdef NDRX_OAPI_DEBUG
2495 NDRX_LOG(log_debug, "RETURN: Bdelall() returns, context: %p, current: %p",
2496 *p_ctxt, G_atmi_tls);
2497 #endif
2498
2499
2500 return ret;
2501 }
2502
2503
2504
2505
2506
2507 expublic int OBdelete(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID *fldlist)
2508 {
2509 int ret = EXSUCCEED;
2510 int did_set = EXFALSE;
2511
2512
2513 #ifdef NDRX_OAPI_DEBUG
2514 NDRX_LOG(log_debug, "ENTRY: Bdelete() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2515 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2516 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2517
2518 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2519 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2520
2521 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2522 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2523
2524 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2525 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2526
2527 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2528 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2529
2530 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2531 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2532
2533 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2534 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2535 #endif
2536
2537
2538
2539
2540 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2541 {
2542 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2543 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2544 {
2545 userlog("ERROR! Bdelete() failed to set context");
2546 EXFAIL_OUT(ret);
2547 }
2548 did_set = EXTRUE;
2549 }
2550 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2551 {
2552 userlog("WARNING! Bdelete() context %p thinks that it is assocated "
2553 "with current thread, but thread is associated with %p context!",
2554 p_ctxt, G_atmi_tls);
2555 }
2556
2557 ret = Bdelete(p_ub, fldlist);
2558
2559 if (did_set)
2560 {
2561 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2562 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2563 {
2564 userlog("ERROR! Bdelete() failed to get context");
2565 EXFAIL_OUT(ret);
2566 }
2567 }
2568 out:
2569
2570 #ifdef NDRX_OAPI_DEBUG
2571 NDRX_LOG(log_debug, "RETURN: Bdelete() returns, context: %p, current: %p",
2572 *p_ctxt, G_atmi_tls);
2573 #endif
2574
2575
2576 return ret;
2577 }
2578
2579
2580
2581
2582
2583 expublic BFLDOCC OBfldno(TPCONTEXT_T *p_ctxt, BFLDID bfldid)
2584 {
2585 BFLDOCC ret = EXSUCCEED;
2586 int did_set = EXFALSE;
2587
2588
2589 #ifdef NDRX_OAPI_DEBUG
2590 NDRX_LOG(log_debug, "ENTRY: Bfldno() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2591 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2592 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2593
2594 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2595 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2596
2597 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2598 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2599
2600 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2601 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2602
2603 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2604 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2605
2606 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2607 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2608
2609 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2610 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2611 #endif
2612
2613
2614
2615
2616 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2617 {
2618 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2619 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2620 {
2621 userlog("ERROR! Bfldno() failed to set context");
2622 EXFAIL_OUT(ret);
2623 }
2624 did_set = EXTRUE;
2625 }
2626 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2627 {
2628 userlog("WARNING! Bfldno() context %p thinks that it is assocated "
2629 "with current thread, but thread is associated with %p context!",
2630 p_ctxt, G_atmi_tls);
2631 }
2632
2633 ret = Bfldno(bfldid);
2634
2635 if (did_set)
2636 {
2637 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2638 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2639 {
2640 userlog("ERROR! Bfldno() failed to get context");
2641 EXFAIL_OUT(ret);
2642 }
2643 }
2644 out:
2645
2646 #ifdef NDRX_OAPI_DEBUG
2647 NDRX_LOG(log_debug, "RETURN: Bfldno() returns, context: %p, current: %p",
2648 *p_ctxt, G_atmi_tls);
2649 #endif
2650
2651
2652 return ret;
2653 }
2654
2655
2656
2657
2658
2659 expublic long OBunused(TPCONTEXT_T *p_ctxt, UBFH *p_ub)
2660 {
2661 long ret = EXSUCCEED;
2662 int did_set = EXFALSE;
2663
2664
2665 #ifdef NDRX_OAPI_DEBUG
2666 NDRX_LOG(log_debug, "ENTRY: Bunused() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2667 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2668 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2669
2670 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2671 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2672
2673 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2674 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2675
2676 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2677 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2678
2679 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2680 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2681
2682 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2683 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2684
2685 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2686 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2687 #endif
2688
2689
2690
2691
2692 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2693 {
2694 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2695 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2696 {
2697 userlog("ERROR! Bunused() failed to set context");
2698 EXFAIL_OUT(ret);
2699 }
2700 did_set = EXTRUE;
2701 }
2702 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2703 {
2704 userlog("WARNING! Bunused() context %p thinks that it is assocated "
2705 "with current thread, but thread is associated with %p context!",
2706 p_ctxt, G_atmi_tls);
2707 }
2708
2709 ret = Bunused(p_ub);
2710
2711 if (did_set)
2712 {
2713 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2714 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2715 {
2716 userlog("ERROR! Bunused() failed to get context");
2717 EXFAIL_OUT(ret);
2718 }
2719 }
2720 out:
2721
2722 #ifdef NDRX_OAPI_DEBUG
2723 NDRX_LOG(log_debug, "RETURN: Bunused() returns, context: %p, current: %p",
2724 *p_ctxt, G_atmi_tls);
2725 #endif
2726
2727
2728 return ret;
2729 }
2730
2731
2732
2733
2734
2735 expublic long OBsizeof(TPCONTEXT_T *p_ctxt, UBFH *p_ub)
2736 {
2737 long ret = EXSUCCEED;
2738 int did_set = EXFALSE;
2739
2740
2741 #ifdef NDRX_OAPI_DEBUG
2742 NDRX_LOG(log_debug, "ENTRY: Bsizeof() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2743 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2744 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2745
2746 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2747 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2748
2749 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2750 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2751
2752 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2753 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2754
2755 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2756 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2757
2758 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2759 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2760
2761 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2762 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2763 #endif
2764
2765
2766
2767
2768 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2769 {
2770 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2771 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2772 {
2773 userlog("ERROR! Bsizeof() failed to set context");
2774 EXFAIL_OUT(ret);
2775 }
2776 did_set = EXTRUE;
2777 }
2778 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2779 {
2780 userlog("WARNING! Bsizeof() context %p thinks that it is assocated "
2781 "with current thread, but thread is associated with %p context!",
2782 p_ctxt, G_atmi_tls);
2783 }
2784
2785 ret = Bsizeof(p_ub);
2786
2787 if (did_set)
2788 {
2789 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2790 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2791 {
2792 userlog("ERROR! Bsizeof() failed to get context");
2793 EXFAIL_OUT(ret);
2794 }
2795 }
2796 out:
2797
2798 #ifdef NDRX_OAPI_DEBUG
2799 NDRX_LOG(log_debug, "RETURN: Bsizeof() returns, context: %p, current: %p",
2800 *p_ctxt, G_atmi_tls);
2801 #endif
2802
2803
2804 return ret;
2805 }
2806
2807
2808
2809
2810
2811 expublic char * OBtype(TPCONTEXT_T *p_ctxt, BFLDID bfldid)
2812 {
2813 int did_set = EXFALSE;
2814 char * ret = NULL;
2815
2816
2817 #ifdef NDRX_OAPI_DEBUG
2818 NDRX_LOG(log_debug, "ENTRY: Btype() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2819 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2820 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2821
2822 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2823 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2824
2825 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2826 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2827
2828 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2829 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2830
2831 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2832 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2833
2834 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2835 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2836
2837 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2838 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2839 #endif
2840
2841
2842
2843 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2844 {
2845
2846 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2847 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2848 {
2849 userlog("ERROR! Btype() failed to set context");
2850 ret = NULL;
2851 goto out;
2852 }
2853 did_set = EXTRUE;
2854 }
2855 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2856 {
2857 userlog("WARNING! Btype() context %p thinks that it is assocated "
2858 "with current thread, but thread is associated with %p context!",
2859 p_ctxt, G_atmi_tls);
2860 }
2861
2862 ret = Btype(bfldid);
2863
2864 if (did_set)
2865 {
2866 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2867 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2868 {
2869 userlog("ERROR! Btype() failed to get context");
2870 ret = NULL;
2871 goto out;
2872 }
2873 }
2874 out:
2875
2876 #ifdef NDRX_OAPI_DEBUG
2877 NDRX_LOG(log_debug, "RETURN: Btype() returns, context: %p, current: %p",
2878 *p_ctxt, G_atmi_tls);
2879 #endif
2880
2881
2882 return ret;
2883 }
2884
2885
2886
2887
2888
2889 expublic int OBfree(TPCONTEXT_T *p_ctxt, UBFH *p_ub)
2890 {
2891 int ret = EXSUCCEED;
2892 int did_set = EXFALSE;
2893
2894
2895 #ifdef NDRX_OAPI_DEBUG
2896 NDRX_LOG(log_debug, "ENTRY: Bfree() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2897 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2898 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2899
2900 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2901 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2902
2903 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2904 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2905
2906 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2907 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2908
2909 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2910 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2911
2912 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2913 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2914
2915 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2916 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2917 #endif
2918
2919
2920
2921
2922 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2923 {
2924 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
2925 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2926 {
2927 userlog("ERROR! Bfree() failed to set context");
2928 EXFAIL_OUT(ret);
2929 }
2930 did_set = EXTRUE;
2931 }
2932 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
2933 {
2934 userlog("WARNING! Bfree() context %p thinks that it is assocated "
2935 "with current thread, but thread is associated with %p context!",
2936 p_ctxt, G_atmi_tls);
2937 }
2938
2939 ret = Bfree(p_ub);
2940
2941 if (did_set)
2942 {
2943 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
2944 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
2945 {
2946 userlog("ERROR! Bfree() failed to get context");
2947 EXFAIL_OUT(ret);
2948 }
2949 }
2950 out:
2951
2952 #ifdef NDRX_OAPI_DEBUG
2953 NDRX_LOG(log_debug, "RETURN: Bfree() returns, context: %p, current: %p",
2954 *p_ctxt, G_atmi_tls);
2955 #endif
2956
2957
2958 return ret;
2959 }
2960
2961
2962
2963
2964
2965 expublic UBFH * OBalloc(TPCONTEXT_T *p_ctxt, BFLDOCC f, BFLDLEN v)
2966 {
2967 int did_set = EXFALSE;
2968 UBFH * ret = NULL;
2969
2970
2971 #ifdef NDRX_OAPI_DEBUG
2972 NDRX_LOG(log_debug, "ENTRY: Balloc() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
2973 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
2974 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
2975
2976 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
2977 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
2978
2979 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
2980 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
2981
2982 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
2983 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
2984
2985 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
2986 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
2987
2988 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
2989 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
2990
2991 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
2992 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
2993 #endif
2994
2995
2996
2997 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
2998 {
2999
3000 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3001 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3002 {
3003 userlog("ERROR! Balloc() failed to set context");
3004 ret = NULL;
3005 goto out;
3006 }
3007 did_set = EXTRUE;
3008 }
3009 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3010 {
3011 userlog("WARNING! Balloc() context %p thinks that it is assocated "
3012 "with current thread, but thread is associated with %p context!",
3013 p_ctxt, G_atmi_tls);
3014 }
3015
3016 ret = Balloc(f, v);
3017
3018 if (did_set)
3019 {
3020 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3021 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3022 {
3023 userlog("ERROR! Balloc() failed to get context");
3024 ret = NULL;
3025 goto out;
3026 }
3027 }
3028 out:
3029
3030 #ifdef NDRX_OAPI_DEBUG
3031 NDRX_LOG(log_debug, "RETURN: Balloc() returns, context: %p, current: %p",
3032 *p_ctxt, G_atmi_tls);
3033 #endif
3034
3035
3036 return ret;
3037 }
3038
3039
3040
3041
3042
3043 expublic UBFH * OBrealloc(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDOCC f, BFLDLEN v)
3044 {
3045 int did_set = EXFALSE;
3046 UBFH * ret = NULL;
3047
3048
3049 #ifdef NDRX_OAPI_DEBUG
3050 NDRX_LOG(log_debug, "ENTRY: Brealloc() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3051 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3052 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3053
3054 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3055 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3056
3057 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3058 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3059
3060 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3061 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3062
3063 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3064 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3065
3066 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3067 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3068
3069 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3070 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3071 #endif
3072
3073
3074
3075 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3076 {
3077
3078 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3079 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3080 {
3081 userlog("ERROR! Brealloc() failed to set context");
3082 ret = NULL;
3083 goto out;
3084 }
3085 did_set = EXTRUE;
3086 }
3087 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3088 {
3089 userlog("WARNING! Brealloc() context %p thinks that it is assocated "
3090 "with current thread, but thread is associated with %p context!",
3091 p_ctxt, G_atmi_tls);
3092 }
3093
3094 ret = Brealloc(p_ub, f, v);
3095
3096 if (did_set)
3097 {
3098 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3099 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3100 {
3101 userlog("ERROR! Brealloc() failed to get context");
3102 ret = NULL;
3103 goto out;
3104 }
3105 }
3106 out:
3107
3108 #ifdef NDRX_OAPI_DEBUG
3109 NDRX_LOG(log_debug, "RETURN: Brealloc() returns, context: %p, current: %p",
3110 *p_ctxt, G_atmi_tls);
3111 #endif
3112
3113
3114 return ret;
3115 }
3116
3117
3118
3119
3120
3121 expublic int OBupdate(TPCONTEXT_T *p_ctxt, UBFH *p_ub_dst, UBFH *p_ub_src)
3122 {
3123 int ret = EXSUCCEED;
3124 int did_set = EXFALSE;
3125
3126
3127 #ifdef NDRX_OAPI_DEBUG
3128 NDRX_LOG(log_debug, "ENTRY: Bupdate() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3129 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3130 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3131
3132 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3133 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3134
3135 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3136 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3137
3138 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3139 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3140
3141 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3142 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3143
3144 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3145 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3146
3147 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3148 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3149 #endif
3150
3151
3152
3153
3154 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3155 {
3156 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3157 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3158 {
3159 userlog("ERROR! Bupdate() failed to set context");
3160 EXFAIL_OUT(ret);
3161 }
3162 did_set = EXTRUE;
3163 }
3164 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3165 {
3166 userlog("WARNING! Bupdate() context %p thinks that it is assocated "
3167 "with current thread, but thread is associated with %p context!",
3168 p_ctxt, G_atmi_tls);
3169 }
3170
3171 ret = Bupdate(p_ub_dst, p_ub_src);
3172
3173 if (did_set)
3174 {
3175 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3176 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3177 {
3178 userlog("ERROR! Bupdate() failed to get context");
3179 EXFAIL_OUT(ret);
3180 }
3181 }
3182 out:
3183
3184 #ifdef NDRX_OAPI_DEBUG
3185 NDRX_LOG(log_debug, "RETURN: Bupdate() returns, context: %p, current: %p",
3186 *p_ctxt, G_atmi_tls);
3187 #endif
3188
3189
3190 return ret;
3191 }
3192
3193
3194
3195
3196
3197 expublic int OBconcat(TPCONTEXT_T *p_ctxt, UBFH *p_ub_dst, UBFH *p_ub_src)
3198 {
3199 int ret = EXSUCCEED;
3200 int did_set = EXFALSE;
3201
3202
3203 #ifdef NDRX_OAPI_DEBUG
3204 NDRX_LOG(log_debug, "ENTRY: Bconcat() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3205 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3206 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3207
3208 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3209 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3210
3211 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3212 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3213
3214 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3215 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3216
3217 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3218 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3219
3220 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3221 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3222
3223 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3224 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3225 #endif
3226
3227
3228
3229
3230 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3231 {
3232 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3233 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3234 {
3235 userlog("ERROR! Bconcat() failed to set context");
3236 EXFAIL_OUT(ret);
3237 }
3238 did_set = EXTRUE;
3239 }
3240 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3241 {
3242 userlog("WARNING! Bconcat() context %p thinks that it is assocated "
3243 "with current thread, but thread is associated with %p context!",
3244 p_ctxt, G_atmi_tls);
3245 }
3246
3247 ret = Bconcat(p_ub_dst, p_ub_src);
3248
3249 if (did_set)
3250 {
3251 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3252 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3253 {
3254 userlog("ERROR! Bconcat() failed to get context");
3255 EXFAIL_OUT(ret);
3256 }
3257 }
3258 out:
3259
3260 #ifdef NDRX_OAPI_DEBUG
3261 NDRX_LOG(log_debug, "RETURN: Bconcat() returns, context: %p, current: %p",
3262 *p_ctxt, G_atmi_tls);
3263 #endif
3264
3265
3266 return ret;
3267 }
3268
3269
3270
3271
3272
3273 expublic char * OCBfind(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid, BFLDOCC occ, BFLDLEN * len, int usrtype)
3274 {
3275 int did_set = EXFALSE;
3276 char * ret = NULL;
3277
3278
3279 #ifdef NDRX_OAPI_DEBUG
3280 NDRX_LOG(log_debug, "ENTRY: CBfind() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3281 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3282 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3283
3284 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3285 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3286
3287 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3288 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3289
3290 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3291 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3292
3293 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3294 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3295
3296 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3297 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3298
3299 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3300 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3301 #endif
3302
3303
3304
3305 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3306 {
3307
3308 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3309 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3310 {
3311 userlog("ERROR! CBfind() failed to set context");
3312 ret = NULL;
3313 goto out;
3314 }
3315 did_set = EXTRUE;
3316 }
3317 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3318 {
3319 userlog("WARNING! CBfind() context %p thinks that it is assocated "
3320 "with current thread, but thread is associated with %p context!",
3321 p_ctxt, G_atmi_tls);
3322 }
3323
3324 ret = CBfind(p_ub, bfldid, occ, len, usrtype);
3325
3326 if (did_set)
3327 {
3328 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3329 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3330 {
3331 userlog("ERROR! CBfind() failed to get context");
3332 ret = NULL;
3333 goto out;
3334 }
3335 }
3336 out:
3337
3338 #ifdef NDRX_OAPI_DEBUG
3339 NDRX_LOG(log_debug, "RETURN: CBfind() returns, context: %p, current: %p",
3340 *p_ctxt, G_atmi_tls);
3341 #endif
3342
3343
3344 return ret;
3345 }
3346
3347
3348
3349
3350
3351 expublic char * OCBgetalloc(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid, BFLDOCC occ, int usrtype, BFLDLEN *extralen)
3352 {
3353 int did_set = EXFALSE;
3354 char * ret = NULL;
3355
3356
3357 #ifdef NDRX_OAPI_DEBUG
3358 NDRX_LOG(log_debug, "ENTRY: CBgetalloc() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3359 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3360 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3361
3362 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3363 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3364
3365 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3366 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3367
3368 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3369 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3370
3371 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3372 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3373
3374 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3375 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3376
3377 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3378 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3379 #endif
3380
3381
3382
3383 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3384 {
3385
3386 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3387 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3388 {
3389 userlog("ERROR! CBgetalloc() failed to set context");
3390 ret = NULL;
3391 goto out;
3392 }
3393 did_set = EXTRUE;
3394 }
3395 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3396 {
3397 userlog("WARNING! CBgetalloc() context %p thinks that it is assocated "
3398 "with current thread, but thread is associated with %p context!",
3399 p_ctxt, G_atmi_tls);
3400 }
3401
3402 ret = CBgetalloc(p_ub, bfldid, occ, usrtype, extralen);
3403
3404 if (did_set)
3405 {
3406 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3407 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3408 {
3409 userlog("ERROR! CBgetalloc() failed to get context");
3410 ret = NULL;
3411 goto out;
3412 }
3413 }
3414 out:
3415
3416 #ifdef NDRX_OAPI_DEBUG
3417 NDRX_LOG(log_debug, "RETURN: CBgetalloc() returns, context: %p, current: %p",
3418 *p_ctxt, G_atmi_tls);
3419 #endif
3420
3421
3422 return ret;
3423 }
3424
3425
3426
3427
3428
3429 expublic BFLDOCC OCBfindocc(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid,char * buf, BFLDLEN len, int usrtype)
3430 {
3431 BFLDOCC ret = EXSUCCEED;
3432 int did_set = EXFALSE;
3433
3434
3435 #ifdef NDRX_OAPI_DEBUG
3436 NDRX_LOG(log_debug, "ENTRY: CBfindocc() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3437 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3438 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3439
3440 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3441 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3442
3443 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3444 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3445
3446 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3447 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3448
3449 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3450 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3451
3452 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3453 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3454
3455 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3456 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3457 #endif
3458
3459
3460
3461
3462 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3463 {
3464 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3465 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3466 {
3467 userlog("ERROR! CBfindocc() failed to set context");
3468 EXFAIL_OUT(ret);
3469 }
3470 did_set = EXTRUE;
3471 }
3472 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3473 {
3474 userlog("WARNING! CBfindocc() context %p thinks that it is assocated "
3475 "with current thread, but thread is associated with %p context!",
3476 p_ctxt, G_atmi_tls);
3477 }
3478
3479 ret = CBfindocc(p_ub, bfldid, buf, len, usrtype);
3480
3481 if (did_set)
3482 {
3483 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3484 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3485 {
3486 userlog("ERROR! CBfindocc() failed to get context");
3487 EXFAIL_OUT(ret);
3488 }
3489 }
3490 out:
3491
3492 #ifdef NDRX_OAPI_DEBUG
3493 NDRX_LOG(log_debug, "RETURN: CBfindocc() returns, context: %p, current: %p",
3494 *p_ctxt, G_atmi_tls);
3495 #endif
3496
3497
3498 return ret;
3499 }
3500
3501
3502
3503
3504
3505 expublic BFLDOCC OBfindocc(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid,char * buf, BFLDLEN len)
3506 {
3507 BFLDOCC ret = EXSUCCEED;
3508 int did_set = EXFALSE;
3509
3510
3511 #ifdef NDRX_OAPI_DEBUG
3512 NDRX_LOG(log_debug, "ENTRY: Bfindocc() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3513 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3514 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3515
3516 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3517 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3518
3519 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3520 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3521
3522 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3523 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3524
3525 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3526 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3527
3528 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3529 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3530
3531 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3532 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3533 #endif
3534
3535
3536
3537
3538 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3539 {
3540 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3541 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3542 {
3543 userlog("ERROR! Bfindocc() failed to set context");
3544 EXFAIL_OUT(ret);
3545 }
3546 did_set = EXTRUE;
3547 }
3548 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3549 {
3550 userlog("WARNING! Bfindocc() context %p thinks that it is assocated "
3551 "with current thread, but thread is associated with %p context!",
3552 p_ctxt, G_atmi_tls);
3553 }
3554
3555 ret = Bfindocc(p_ub, bfldid, buf, len);
3556
3557 if (did_set)
3558 {
3559 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3560 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3561 {
3562 userlog("ERROR! Bfindocc() failed to get context");
3563 EXFAIL_OUT(ret);
3564 }
3565 }
3566 out:
3567
3568 #ifdef NDRX_OAPI_DEBUG
3569 NDRX_LOG(log_debug, "RETURN: Bfindocc() returns, context: %p, current: %p",
3570 *p_ctxt, G_atmi_tls);
3571 #endif
3572
3573
3574 return ret;
3575 }
3576
3577
3578
3579
3580
3581 expublic char * OBgetalloc(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid, BFLDOCC occ, BFLDLEN *extralen)
3582 {
3583 int did_set = EXFALSE;
3584 char * ret = NULL;
3585
3586
3587 #ifdef NDRX_OAPI_DEBUG
3588 NDRX_LOG(log_debug, "ENTRY: Bgetalloc() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3589 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3590 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3591
3592 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3593 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3594
3595 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3596 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3597
3598 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3599 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3600
3601 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3602 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3603
3604 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3605 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3606
3607 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3608 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3609 #endif
3610
3611
3612
3613 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3614 {
3615
3616 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3617 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3618 {
3619 userlog("ERROR! Bgetalloc() failed to set context");
3620 ret = NULL;
3621 goto out;
3622 }
3623 did_set = EXTRUE;
3624 }
3625 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3626 {
3627 userlog("WARNING! Bgetalloc() context %p thinks that it is assocated "
3628 "with current thread, but thread is associated with %p context!",
3629 p_ctxt, G_atmi_tls);
3630 }
3631
3632 ret = Bgetalloc(p_ub, bfldid, occ, extralen);
3633
3634 if (did_set)
3635 {
3636 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3637 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3638 {
3639 userlog("ERROR! Bgetalloc() failed to get context");
3640 ret = NULL;
3641 goto out;
3642 }
3643 }
3644 out:
3645
3646 #ifdef NDRX_OAPI_DEBUG
3647 NDRX_LOG(log_debug, "RETURN: Bgetalloc() returns, context: %p, current: %p",
3648 *p_ctxt, G_atmi_tls);
3649 #endif
3650
3651
3652 return ret;
3653 }
3654
3655
3656
3657
3658
3659 expublic char * OBfindlast(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDID bfldid,BFLDOCC *occ, BFLDLEN *len)
3660 {
3661 int did_set = EXFALSE;
3662 char * ret = NULL;
3663
3664
3665 #ifdef NDRX_OAPI_DEBUG
3666 NDRX_LOG(log_debug, "ENTRY: Bfindlast() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3667 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3668 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3669
3670 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3671 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3672
3673 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3674 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3675
3676 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3677 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3678
3679 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3680 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3681
3682 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3683 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3684
3685 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3686 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3687 #endif
3688
3689
3690
3691 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3692 {
3693
3694 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3695 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3696 {
3697 userlog("ERROR! Bfindlast() failed to set context");
3698 ret = NULL;
3699 goto out;
3700 }
3701 did_set = EXTRUE;
3702 }
3703 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3704 {
3705 userlog("WARNING! Bfindlast() context %p thinks that it is assocated "
3706 "with current thread, but thread is associated with %p context!",
3707 p_ctxt, G_atmi_tls);
3708 }
3709
3710 ret = Bfindlast(p_ub, bfldid, occ, len);
3711
3712 if (did_set)
3713 {
3714 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3715 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3716 {
3717 userlog("ERROR! Bfindlast() failed to get context");
3718 ret = NULL;
3719 goto out;
3720 }
3721 }
3722 out:
3723
3724 #ifdef NDRX_OAPI_DEBUG
3725 NDRX_LOG(log_debug, "RETURN: Bfindlast() returns, context: %p, current: %p",
3726 *p_ctxt, G_atmi_tls);
3727 #endif
3728
3729
3730 return ret;
3731 }
3732
3733
3734
3735
3736
3737 expublic int OBgetlast(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid,BFLDOCC *occ, char *buf, BFLDLEN *len)
3738 {
3739 int ret = EXSUCCEED;
3740 int did_set = EXFALSE;
3741
3742
3743 #ifdef NDRX_OAPI_DEBUG
3744 NDRX_LOG(log_debug, "ENTRY: Bgetlast() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3745 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3746 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3747
3748 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3749 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3750
3751 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3752 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3753
3754 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3755 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3756
3757 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3758 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3759
3760 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3761 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3762
3763 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3764 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3765 #endif
3766
3767
3768
3769
3770 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3771 {
3772 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3773 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3774 {
3775 userlog("ERROR! Bgetlast() failed to set context");
3776 EXFAIL_OUT(ret);
3777 }
3778 did_set = EXTRUE;
3779 }
3780 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3781 {
3782 userlog("WARNING! Bgetlast() context %p thinks that it is assocated "
3783 "with current thread, but thread is associated with %p context!",
3784 p_ctxt, G_atmi_tls);
3785 }
3786
3787 ret = Bgetlast(p_ub, bfldid, occ, buf, len);
3788
3789 if (did_set)
3790 {
3791 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3792 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3793 {
3794 userlog("ERROR! Bgetlast() failed to get context");
3795 EXFAIL_OUT(ret);
3796 }
3797 }
3798 out:
3799
3800 #ifdef NDRX_OAPI_DEBUG
3801 NDRX_LOG(log_debug, "RETURN: Bgetlast() returns, context: %p, current: %p",
3802 *p_ctxt, G_atmi_tls);
3803 #endif
3804
3805
3806 return ret;
3807 }
3808
3809
3810
3811
3812
3813 expublic int OBprint(TPCONTEXT_T *p_ctxt, UBFH *p_ub)
3814 {
3815 int ret = EXSUCCEED;
3816 int did_set = EXFALSE;
3817
3818
3819 #ifdef NDRX_OAPI_DEBUG
3820 NDRX_LOG(log_debug, "ENTRY: Bprint() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3821 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3822 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3823
3824 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3825 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3826
3827 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3828 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3829
3830 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3831 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3832
3833 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3834 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3835
3836 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3837 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3838
3839 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3840 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3841 #endif
3842
3843
3844
3845
3846 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3847 {
3848 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3849 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3850 {
3851 userlog("ERROR! Bprint() failed to set context");
3852 EXFAIL_OUT(ret);
3853 }
3854 did_set = EXTRUE;
3855 }
3856 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3857 {
3858 userlog("WARNING! Bprint() context %p thinks that it is assocated "
3859 "with current thread, but thread is associated with %p context!",
3860 p_ctxt, G_atmi_tls);
3861 }
3862
3863 ret = Bprint(p_ub);
3864
3865 if (did_set)
3866 {
3867 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3868 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3869 {
3870 userlog("ERROR! Bprint() failed to get context");
3871 EXFAIL_OUT(ret);
3872 }
3873 }
3874 out:
3875
3876 #ifdef NDRX_OAPI_DEBUG
3877 NDRX_LOG(log_debug, "RETURN: Bprint() returns, context: %p, current: %p",
3878 *p_ctxt, G_atmi_tls);
3879 #endif
3880
3881
3882 return ret;
3883 }
3884
3885
3886
3887
3888
3889 expublic int OBfprint(TPCONTEXT_T *p_ctxt, UBFH *p_ub, FILE * outf)
3890 {
3891 int ret = EXSUCCEED;
3892 int did_set = EXFALSE;
3893
3894
3895 #ifdef NDRX_OAPI_DEBUG
3896 NDRX_LOG(log_debug, "ENTRY: Bfprint() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3897 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3898 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3899
3900 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3901 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3902
3903 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3904 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3905
3906 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3907 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3908
3909 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3910 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3911
3912 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3913 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3914
3915 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3916 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3917 #endif
3918
3919
3920
3921
3922 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3923 {
3924 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
3925 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3926 {
3927 userlog("ERROR! Bfprint() failed to set context");
3928 EXFAIL_OUT(ret);
3929 }
3930 did_set = EXTRUE;
3931 }
3932 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
3933 {
3934 userlog("WARNING! Bfprint() context %p thinks that it is assocated "
3935 "with current thread, but thread is associated with %p context!",
3936 p_ctxt, G_atmi_tls);
3937 }
3938
3939 ret = Bfprint(p_ub, outf);
3940
3941 if (did_set)
3942 {
3943 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
3944 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
3945 {
3946 userlog("ERROR! Bfprint() failed to get context");
3947 EXFAIL_OUT(ret);
3948 }
3949 }
3950 out:
3951
3952 #ifdef NDRX_OAPI_DEBUG
3953 NDRX_LOG(log_debug, "RETURN: Bfprint() returns, context: %p, current: %p",
3954 *p_ctxt, G_atmi_tls);
3955 #endif
3956
3957
3958 return ret;
3959 }
3960
3961
3962
3963
3964
3965 expublic int OBfprintcb(TPCONTEXT_T *p_ctxt, UBFH *p_ub, ndrx_plugin_tplogprintubf_hook_t p_writef, void *dataptr1)
3966 {
3967 int ret = EXSUCCEED;
3968 int did_set = EXFALSE;
3969
3970
3971 #ifdef NDRX_OAPI_DEBUG
3972 NDRX_LOG(log_debug, "ENTRY: Bfprintcb() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
3973 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
3974 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
3975
3976 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
3977 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
3978
3979 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
3980 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
3981
3982 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
3983 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
3984
3985 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
3986 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
3987
3988 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
3989 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
3990
3991 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
3992 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
3993 #endif
3994
3995
3996
3997
3998 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
3999 {
4000 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4001 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4002 {
4003 userlog("ERROR! Bfprintcb() failed to set context");
4004 EXFAIL_OUT(ret);
4005 }
4006 did_set = EXTRUE;
4007 }
4008 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4009 {
4010 userlog("WARNING! Bfprintcb() context %p thinks that it is assocated "
4011 "with current thread, but thread is associated with %p context!",
4012 p_ctxt, G_atmi_tls);
4013 }
4014
4015 ret = Bfprintcb(p_ub, p_writef, dataptr1);
4016
4017 if (did_set)
4018 {
4019 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4020 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4021 {
4022 userlog("ERROR! Bfprintcb() failed to get context");
4023 EXFAIL_OUT(ret);
4024 }
4025 }
4026 out:
4027
4028 #ifdef NDRX_OAPI_DEBUG
4029 NDRX_LOG(log_debug, "RETURN: Bfprintcb() returns, context: %p, current: %p",
4030 *p_ctxt, G_atmi_tls);
4031 #endif
4032
4033
4034 return ret;
4035 }
4036
4037
4038
4039
4040
4041 expublic char * OBtypcvt(TPCONTEXT_T *p_ctxt, BFLDLEN * to_len, int to_type,char *from_buf, int from_type, BFLDLEN from_len)
4042 {
4043 int did_set = EXFALSE;
4044 char * ret = NULL;
4045
4046
4047 #ifdef NDRX_OAPI_DEBUG
4048 NDRX_LOG(log_debug, "ENTRY: Btypcvt() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4049 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4050 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4051
4052 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4053 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4054
4055 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4056 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4057
4058 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4059 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4060
4061 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4062 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4063
4064 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4065 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4066
4067 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4068 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4069 #endif
4070
4071
4072
4073 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4074 {
4075
4076 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4077 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4078 {
4079 userlog("ERROR! Btypcvt() failed to set context");
4080 ret = NULL;
4081 goto out;
4082 }
4083 did_set = EXTRUE;
4084 }
4085 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4086 {
4087 userlog("WARNING! Btypcvt() context %p thinks that it is assocated "
4088 "with current thread, but thread is associated with %p context!",
4089 p_ctxt, G_atmi_tls);
4090 }
4091
4092 ret = Btypcvt(to_len, to_type, from_buf, from_type, from_len);
4093
4094 if (did_set)
4095 {
4096 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4097 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4098 {
4099 userlog("ERROR! Btypcvt() failed to get context");
4100 ret = NULL;
4101 goto out;
4102 }
4103 }
4104 out:
4105
4106 #ifdef NDRX_OAPI_DEBUG
4107 NDRX_LOG(log_debug, "RETURN: Btypcvt() returns, context: %p, current: %p",
4108 *p_ctxt, G_atmi_tls);
4109 #endif
4110
4111
4112 return ret;
4113 }
4114
4115
4116
4117
4118
4119 expublic int OBextread(TPCONTEXT_T *p_ctxt, UBFH * p_ub, FILE *inf)
4120 {
4121 int ret = EXSUCCEED;
4122 int did_set = EXFALSE;
4123
4124
4125 #ifdef NDRX_OAPI_DEBUG
4126 NDRX_LOG(log_debug, "ENTRY: Bextread() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4127 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4128 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4129
4130 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4131 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4132
4133 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4134 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4135
4136 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4137 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4138
4139 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4140 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4141
4142 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4143 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4144
4145 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4146 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4147 #endif
4148
4149
4150
4151
4152 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4153 {
4154 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4155 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4156 {
4157 userlog("ERROR! Bextread() failed to set context");
4158 EXFAIL_OUT(ret);
4159 }
4160 did_set = EXTRUE;
4161 }
4162 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4163 {
4164 userlog("WARNING! Bextread() context %p thinks that it is assocated "
4165 "with current thread, but thread is associated with %p context!",
4166 p_ctxt, G_atmi_tls);
4167 }
4168
4169 ret = Bextread(p_ub, inf);
4170
4171 if (did_set)
4172 {
4173 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4174 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4175 {
4176 userlog("ERROR! Bextread() failed to get context");
4177 EXFAIL_OUT(ret);
4178 }
4179 }
4180 out:
4181
4182 #ifdef NDRX_OAPI_DEBUG
4183 NDRX_LOG(log_debug, "RETURN: Bextread() returns, context: %p, current: %p",
4184 *p_ctxt, G_atmi_tls);
4185 #endif
4186
4187
4188 return ret;
4189 }
4190
4191
4192
4193
4194
4195 expublic int OBextreadcb(TPCONTEXT_T *p_ctxt, UBFH * p_ub, long (*p_readf)(char *buffer, long bufsz, void *dataptr1), void *dataptr1)
4196 {
4197 int ret = EXSUCCEED;
4198 int did_set = EXFALSE;
4199
4200
4201 #ifdef NDRX_OAPI_DEBUG
4202 NDRX_LOG(log_debug, "ENTRY: Bextreadcb() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4203 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4204 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4205
4206 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4207 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4208
4209 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4210 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4211
4212 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4213 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4214
4215 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4216 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4217
4218 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4219 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4220
4221 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4222 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4223 #endif
4224
4225
4226
4227
4228 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4229 {
4230 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4231 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4232 {
4233 userlog("ERROR! Bextreadcb() failed to set context");
4234 EXFAIL_OUT(ret);
4235 }
4236 did_set = EXTRUE;
4237 }
4238 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4239 {
4240 userlog("WARNING! Bextreadcb() context %p thinks that it is assocated "
4241 "with current thread, but thread is associated with %p context!",
4242 p_ctxt, G_atmi_tls);
4243 }
4244
4245 ret = Bextreadcb(p_ub, p_readf, dataptr1);
4246
4247 if (did_set)
4248 {
4249 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4250 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4251 {
4252 userlog("ERROR! Bextreadcb() failed to get context");
4253 EXFAIL_OUT(ret);
4254 }
4255 }
4256 out:
4257
4258 #ifdef NDRX_OAPI_DEBUG
4259 NDRX_LOG(log_debug, "RETURN: Bextreadcb() returns, context: %p, current: %p",
4260 *p_ctxt, G_atmi_tls);
4261 #endif
4262
4263
4264 return ret;
4265 }
4266
4267
4268
4269
4270 expublic void OBboolpr(TPCONTEXT_T *p_ctxt, char * tree, FILE *outf)
4271 {
4272 int did_set = EXFALSE;
4273
4274
4275 #ifdef NDRX_OAPI_DEBUG
4276 NDRX_LOG(log_debug, "ENTRY: Bboolpr() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4277 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4278 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4279
4280 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4281 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4282
4283 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4284 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4285
4286 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4287 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4288
4289 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4290 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4291
4292 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4293 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4294
4295 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4296 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4297 #endif
4298
4299
4300
4301
4302 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4303 {
4304
4305 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4306 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4307 {
4308 userlog("ERROR! Bboolpr() failed to set context");
4309 }
4310 did_set = EXTRUE;
4311 }
4312 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4313 {
4314 userlog("WARNING! Bboolpr() context %p thinks that it is assocated "
4315 "with current thread, but thread is associated with %p context!",
4316 p_ctxt, G_atmi_tls);
4317 }
4318
4319 Bboolpr(tree, outf);
4320
4321 if (did_set)
4322 {
4323 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4324 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4325 {
4326 userlog("ERROR! Bboolpr() failed to get context");
4327 }
4328 }
4329 out:
4330
4331 #ifdef NDRX_OAPI_DEBUG
4332 NDRX_LOG(log_debug, "RETURN: Bboolpr() returns, context: %p, current: %p",
4333 *p_ctxt, G_atmi_tls);
4334 #endif
4335
4336
4337 return;
4338 }
4339
4340
4341
4342
4343 expublic void OBboolprcb(TPCONTEXT_T *p_ctxt, char * tree, int (*p_writef)(char *buffer, long datalen, void *dataptr1), void *dataptr1)
4344 {
4345 int did_set = EXFALSE;
4346
4347
4348 #ifdef NDRX_OAPI_DEBUG
4349 NDRX_LOG(log_debug, "ENTRY: Bboolprcb() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4350 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4351 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4352
4353 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4354 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4355
4356 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4357 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4358
4359 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4360 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4361
4362 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4363 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4364
4365 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4366 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4367
4368 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4369 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4370 #endif
4371
4372
4373
4374
4375 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4376 {
4377
4378 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4379 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4380 {
4381 userlog("ERROR! Bboolprcb() failed to set context");
4382 }
4383 did_set = EXTRUE;
4384 }
4385 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4386 {
4387 userlog("WARNING! Bboolprcb() context %p thinks that it is assocated "
4388 "with current thread, but thread is associated with %p context!",
4389 p_ctxt, G_atmi_tls);
4390 }
4391
4392 Bboolprcb(tree, p_writef, dataptr1);
4393
4394 if (did_set)
4395 {
4396 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4397 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4398 {
4399 userlog("ERROR! Bboolprcb() failed to get context");
4400 }
4401 }
4402 out:
4403
4404 #ifdef NDRX_OAPI_DEBUG
4405 NDRX_LOG(log_debug, "RETURN: Bboolprcb() returns, context: %p, current: %p",
4406 *p_ctxt, G_atmi_tls);
4407 #endif
4408
4409
4410 return;
4411 }
4412
4413
4414
4415
4416
4417 expublic int OBread(TPCONTEXT_T *p_ctxt, UBFH * p_ub, FILE * inf)
4418 {
4419 int ret = EXSUCCEED;
4420 int did_set = EXFALSE;
4421
4422
4423 #ifdef NDRX_OAPI_DEBUG
4424 NDRX_LOG(log_debug, "ENTRY: Bread() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4425 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4426 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4427
4428 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4429 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4430
4431 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4432 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4433
4434 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4435 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4436
4437 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4438 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4439
4440 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4441 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4442
4443 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4444 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4445 #endif
4446
4447
4448
4449
4450 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4451 {
4452 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4453 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4454 {
4455 userlog("ERROR! Bread() failed to set context");
4456 EXFAIL_OUT(ret);
4457 }
4458 did_set = EXTRUE;
4459 }
4460 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4461 {
4462 userlog("WARNING! Bread() context %p thinks that it is assocated "
4463 "with current thread, but thread is associated with %p context!",
4464 p_ctxt, G_atmi_tls);
4465 }
4466
4467 ret = Bread(p_ub, inf);
4468
4469 if (did_set)
4470 {
4471 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4472 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4473 {
4474 userlog("ERROR! Bread() failed to get context");
4475 EXFAIL_OUT(ret);
4476 }
4477 }
4478 out:
4479
4480 #ifdef NDRX_OAPI_DEBUG
4481 NDRX_LOG(log_debug, "RETURN: Bread() returns, context: %p, current: %p",
4482 *p_ctxt, G_atmi_tls);
4483 #endif
4484
4485
4486 return ret;
4487 }
4488
4489
4490
4491
4492
4493 expublic int OBwrite(TPCONTEXT_T *p_ctxt, UBFH *p_ub, FILE * outf)
4494 {
4495 int ret = EXSUCCEED;
4496 int did_set = EXFALSE;
4497
4498
4499 #ifdef NDRX_OAPI_DEBUG
4500 NDRX_LOG(log_debug, "ENTRY: Bwrite() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4501 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4502 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4503
4504 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4505 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4506
4507 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4508 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4509
4510 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4511 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4512
4513 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4514 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4515
4516 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4517 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4518
4519 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4520 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4521 #endif
4522
4523
4524
4525
4526 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4527 {
4528 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4529 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4530 {
4531 userlog("ERROR! Bwrite() failed to set context");
4532 EXFAIL_OUT(ret);
4533 }
4534 did_set = EXTRUE;
4535 }
4536 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4537 {
4538 userlog("WARNING! Bwrite() context %p thinks that it is assocated "
4539 "with current thread, but thread is associated with %p context!",
4540 p_ctxt, G_atmi_tls);
4541 }
4542
4543 ret = Bwrite(p_ub, outf);
4544
4545 if (did_set)
4546 {
4547 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4548 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4549 {
4550 userlog("ERROR! Bwrite() failed to get context");
4551 EXFAIL_OUT(ret);
4552 }
4553 }
4554 out:
4555
4556 #ifdef NDRX_OAPI_DEBUG
4557 NDRX_LOG(log_debug, "RETURN: Bwrite() returns, context: %p, current: %p",
4558 *p_ctxt, G_atmi_tls);
4559 #endif
4560
4561
4562 return ret;
4563 }
4564
4565
4566
4567
4568
4569 expublic int OBwritecb(TPCONTEXT_T *p_ctxt, UBFH *p_ub, long (*p_writef)(char *buffer, long bufsz, void *dataptr1), void *dataptr1)
4570 {
4571 int ret = EXSUCCEED;
4572 int did_set = EXFALSE;
4573
4574
4575 #ifdef NDRX_OAPI_DEBUG
4576 NDRX_LOG(log_debug, "ENTRY: Bwritecb() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4577 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4578 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4579
4580 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4581 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4582
4583 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4584 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4585
4586 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4587 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4588
4589 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4590 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4591
4592 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4593 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4594
4595 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4596 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4597 #endif
4598
4599
4600
4601
4602 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4603 {
4604 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4605 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4606 {
4607 userlog("ERROR! Bwritecb() failed to set context");
4608 EXFAIL_OUT(ret);
4609 }
4610 did_set = EXTRUE;
4611 }
4612 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4613 {
4614 userlog("WARNING! Bwritecb() context %p thinks that it is assocated "
4615 "with current thread, but thread is associated with %p context!",
4616 p_ctxt, G_atmi_tls);
4617 }
4618
4619 ret = Bwritecb(p_ub, p_writef, dataptr1);
4620
4621 if (did_set)
4622 {
4623 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4624 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4625 {
4626 userlog("ERROR! Bwritecb() failed to get context");
4627 EXFAIL_OUT(ret);
4628 }
4629 }
4630 out:
4631
4632 #ifdef NDRX_OAPI_DEBUG
4633 NDRX_LOG(log_debug, "RETURN: Bwritecb() returns, context: %p, current: %p",
4634 *p_ctxt, G_atmi_tls);
4635 #endif
4636
4637
4638 return ret;
4639 }
4640
4641
4642
4643
4644 expublic void OBtreefree(TPCONTEXT_T *p_ctxt, char *tree)
4645 {
4646 int did_set = EXFALSE;
4647
4648
4649 #ifdef NDRX_OAPI_DEBUG
4650 NDRX_LOG(log_debug, "ENTRY: Btreefree() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4651 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4652 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4653
4654 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4655 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4656
4657 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4658 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4659
4660 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4661 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4662
4663 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4664 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4665
4666 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4667 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4668
4669 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4670 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4671 #endif
4672
4673
4674
4675
4676 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4677 {
4678
4679 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4680 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4681 {
4682 userlog("ERROR! Btreefree() failed to set context");
4683 }
4684 did_set = EXTRUE;
4685 }
4686 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4687 {
4688 userlog("WARNING! Btreefree() context %p thinks that it is assocated "
4689 "with current thread, but thread is associated with %p context!",
4690 p_ctxt, G_atmi_tls);
4691 }
4692
4693 Btreefree(tree);
4694
4695 if (did_set)
4696 {
4697 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4698 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4699 {
4700 userlog("ERROR! Btreefree() failed to get context");
4701 }
4702 }
4703 out:
4704
4705 #ifdef NDRX_OAPI_DEBUG
4706 NDRX_LOG(log_debug, "RETURN: Btreefree() returns, context: %p, current: %p",
4707 *p_ctxt, G_atmi_tls);
4708 #endif
4709
4710
4711 return;
4712 }
4713
4714
4715
4716
4717
4718 expublic int OBboolsetcbf(TPCONTEXT_T *p_ctxt, char *funcname, long (*functionPtr)(UBFH *p_ub, char *funcname))
4719 {
4720 int ret = EXSUCCEED;
4721 int did_set = EXFALSE;
4722
4723
4724 #ifdef NDRX_OAPI_DEBUG
4725 NDRX_LOG(log_debug, "ENTRY: Bboolsetcbf() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4726 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4727 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4728
4729 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4730 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4731
4732 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4733 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4734
4735 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4736 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4737
4738 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4739 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4740
4741 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4742 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4743
4744 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4745 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4746 #endif
4747
4748
4749
4750
4751 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4752 {
4753 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4754 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4755 {
4756 userlog("ERROR! Bboolsetcbf() failed to set context");
4757 EXFAIL_OUT(ret);
4758 }
4759 did_set = EXTRUE;
4760 }
4761 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4762 {
4763 userlog("WARNING! Bboolsetcbf() context %p thinks that it is assocated "
4764 "with current thread, but thread is associated with %p context!",
4765 p_ctxt, G_atmi_tls);
4766 }
4767
4768 ret = Bboolsetcbf(funcname, functionPtr);
4769
4770 if (did_set)
4771 {
4772 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4773 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4774 {
4775 userlog("ERROR! Bboolsetcbf() failed to get context");
4776 EXFAIL_OUT(ret);
4777 }
4778 }
4779 out:
4780
4781 #ifdef NDRX_OAPI_DEBUG
4782 NDRX_LOG(log_debug, "RETURN: Bboolsetcbf() returns, context: %p, current: %p",
4783 *p_ctxt, G_atmi_tls);
4784 #endif
4785
4786
4787 return ret;
4788 }
4789
4790
4791
4792
4793
4794 expublic int OBboolsetcbf2(TPCONTEXT_T *p_ctxt, char *funcname, long (*functionPtr)(UBFH *p_ub, char *funcname, char *arg1))
4795 {
4796 int ret = EXSUCCEED;
4797 int did_set = EXFALSE;
4798
4799
4800 #ifdef NDRX_OAPI_DEBUG
4801 NDRX_LOG(log_debug, "ENTRY: Bboolsetcbf2() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4802 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4803 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4804
4805 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4806 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4807
4808 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4809 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4810
4811 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4812 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4813
4814 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4815 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4816
4817 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4818 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4819
4820 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4821 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4822 #endif
4823
4824
4825
4826
4827 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4828 {
4829 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4830 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4831 {
4832 userlog("ERROR! Bboolsetcbf2() failed to set context");
4833 EXFAIL_OUT(ret);
4834 }
4835 did_set = EXTRUE;
4836 }
4837 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4838 {
4839 userlog("WARNING! Bboolsetcbf2() context %p thinks that it is assocated "
4840 "with current thread, but thread is associated with %p context!",
4841 p_ctxt, G_atmi_tls);
4842 }
4843
4844 ret = Bboolsetcbf2(funcname, functionPtr);
4845
4846 if (did_set)
4847 {
4848 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4849 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4850 {
4851 userlog("ERROR! Bboolsetcbf2() failed to get context");
4852 EXFAIL_OUT(ret);
4853 }
4854 }
4855 out:
4856
4857 #ifdef NDRX_OAPI_DEBUG
4858 NDRX_LOG(log_debug, "RETURN: Bboolsetcbf2() returns, context: %p, current: %p",
4859 *p_ctxt, G_atmi_tls);
4860 #endif
4861
4862
4863 return ret;
4864 }
4865
4866
4867
4868
4869
4870 expublic int OBadds(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, char *buf)
4871 {
4872 int ret = EXSUCCEED;
4873 int did_set = EXFALSE;
4874
4875
4876 #ifdef NDRX_OAPI_DEBUG
4877 NDRX_LOG(log_debug, "ENTRY: Badds() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4878 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4879 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4880
4881 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4882 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4883
4884 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4885 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4886
4887 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4888 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4889
4890 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4891 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4892
4893 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4894 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4895
4896 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4897 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4898 #endif
4899
4900
4901
4902
4903 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4904 {
4905 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4906 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4907 {
4908 userlog("ERROR! Badds() failed to set context");
4909 EXFAIL_OUT(ret);
4910 }
4911 did_set = EXTRUE;
4912 }
4913 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4914 {
4915 userlog("WARNING! Badds() context %p thinks that it is assocated "
4916 "with current thread, but thread is associated with %p context!",
4917 p_ctxt, G_atmi_tls);
4918 }
4919
4920 ret = Badds(p_ub, bfldid, buf);
4921
4922 if (did_set)
4923 {
4924 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
4925 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4926 {
4927 userlog("ERROR! Badds() failed to get context");
4928 EXFAIL_OUT(ret);
4929 }
4930 }
4931 out:
4932
4933 #ifdef NDRX_OAPI_DEBUG
4934 NDRX_LOG(log_debug, "RETURN: Badds() returns, context: %p, current: %p",
4935 *p_ctxt, G_atmi_tls);
4936 #endif
4937
4938
4939 return ret;
4940 }
4941
4942
4943
4944
4945
4946 expublic int OBchgs(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, char *buf)
4947 {
4948 int ret = EXSUCCEED;
4949 int did_set = EXFALSE;
4950
4951
4952 #ifdef NDRX_OAPI_DEBUG
4953 NDRX_LOG(log_debug, "ENTRY: Bchgs() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
4954 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
4955 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
4956
4957 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
4958 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
4959
4960 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
4961 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
4962
4963 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
4964 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
4965
4966 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
4967 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
4968
4969 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
4970 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
4971
4972 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
4973 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
4974 #endif
4975
4976
4977
4978
4979 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
4980 {
4981 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
4982 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
4983 {
4984 userlog("ERROR! Bchgs() failed to set context");
4985 EXFAIL_OUT(ret);
4986 }
4987 did_set = EXTRUE;
4988 }
4989 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
4990 {
4991 userlog("WARNING! Bchgs() context %p thinks that it is assocated "
4992 "with current thread, but thread is associated with %p context!",
4993 p_ctxt, G_atmi_tls);
4994 }
4995
4996 ret = Bchgs(p_ub, bfldid, occ, buf);
4997
4998 if (did_set)
4999 {
5000 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5001 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5002 {
5003 userlog("ERROR! Bchgs() failed to get context");
5004 EXFAIL_OUT(ret);
5005 }
5006 }
5007 out:
5008
5009 #ifdef NDRX_OAPI_DEBUG
5010 NDRX_LOG(log_debug, "RETURN: Bchgs() returns, context: %p, current: %p",
5011 *p_ctxt, G_atmi_tls);
5012 #endif
5013
5014
5015 return ret;
5016 }
5017
5018
5019
5020
5021
5022 expublic int OBgets(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, char *buf)
5023 {
5024 int ret = EXSUCCEED;
5025 int did_set = EXFALSE;
5026
5027
5028 #ifdef NDRX_OAPI_DEBUG
5029 NDRX_LOG(log_debug, "ENTRY: Bgets() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5030 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5031 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5032
5033 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5034 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5035
5036 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5037 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5038
5039 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5040 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5041
5042 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5043 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5044
5045 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5046 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5047
5048 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5049 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5050 #endif
5051
5052
5053
5054
5055 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5056 {
5057 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5058 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5059 {
5060 userlog("ERROR! Bgets() failed to set context");
5061 EXFAIL_OUT(ret);
5062 }
5063 did_set = EXTRUE;
5064 }
5065 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5066 {
5067 userlog("WARNING! Bgets() context %p thinks that it is assocated "
5068 "with current thread, but thread is associated with %p context!",
5069 p_ctxt, G_atmi_tls);
5070 }
5071
5072 ret = Bgets(p_ub, bfldid, occ, buf);
5073
5074 if (did_set)
5075 {
5076 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5077 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5078 {
5079 userlog("ERROR! Bgets() failed to get context");
5080 EXFAIL_OUT(ret);
5081 }
5082 }
5083 out:
5084
5085 #ifdef NDRX_OAPI_DEBUG
5086 NDRX_LOG(log_debug, "RETURN: Bgets() returns, context: %p, current: %p",
5087 *p_ctxt, G_atmi_tls);
5088 #endif
5089
5090
5091 return ret;
5092 }
5093
5094
5095
5096
5097
5098 expublic char * OBgetsa(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ, BFLDLEN *extralen)
5099 {
5100 int did_set = EXFALSE;
5101 char * ret = NULL;
5102
5103
5104 #ifdef NDRX_OAPI_DEBUG
5105 NDRX_LOG(log_debug, "ENTRY: Bgetsa() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5106 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5107 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5108
5109 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5110 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5111
5112 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5113 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5114
5115 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5116 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5117
5118 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5119 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5120
5121 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5122 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5123
5124 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5125 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5126 #endif
5127
5128
5129
5130 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5131 {
5132
5133 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5134 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5135 {
5136 userlog("ERROR! Bgetsa() failed to set context");
5137 ret = NULL;
5138 goto out;
5139 }
5140 did_set = EXTRUE;
5141 }
5142 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5143 {
5144 userlog("WARNING! Bgetsa() context %p thinks that it is assocated "
5145 "with current thread, but thread is associated with %p context!",
5146 p_ctxt, G_atmi_tls);
5147 }
5148
5149 ret = Bgetsa(p_ub, bfldid, occ, extralen);
5150
5151 if (did_set)
5152 {
5153 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5154 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5155 {
5156 userlog("ERROR! Bgetsa() failed to get context");
5157 ret = NULL;
5158 goto out;
5159 }
5160 }
5161 out:
5162
5163 #ifdef NDRX_OAPI_DEBUG
5164 NDRX_LOG(log_debug, "RETURN: Bgetsa() returns, context: %p, current: %p",
5165 *p_ctxt, G_atmi_tls);
5166 #endif
5167
5168
5169 return ret;
5170 }
5171
5172
5173
5174
5175
5176 expublic char * OBfinds(TPCONTEXT_T *p_ctxt, UBFH *p_ub, BFLDID bfldid, BFLDOCC occ)
5177 {
5178 int did_set = EXFALSE;
5179 char * ret = NULL;
5180
5181
5182 #ifdef NDRX_OAPI_DEBUG
5183 NDRX_LOG(log_debug, "ENTRY: Bfinds() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5184 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5185 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5186
5187 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5188 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5189
5190 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5191 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5192
5193 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5194 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5195
5196 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5197 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5198
5199 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5200 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5201
5202 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5203 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5204 #endif
5205
5206
5207
5208 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5209 {
5210
5211 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5212 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5213 {
5214 userlog("ERROR! Bfinds() failed to set context");
5215 ret = NULL;
5216 goto out;
5217 }
5218 did_set = EXTRUE;
5219 }
5220 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5221 {
5222 userlog("WARNING! Bfinds() context %p thinks that it is assocated "
5223 "with current thread, but thread is associated with %p context!",
5224 p_ctxt, G_atmi_tls);
5225 }
5226
5227 ret = Bfinds(p_ub, bfldid, occ);
5228
5229 if (did_set)
5230 {
5231 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5232 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5233 {
5234 userlog("ERROR! Bfinds() failed to get context");
5235 ret = NULL;
5236 goto out;
5237 }
5238 }
5239 out:
5240
5241 #ifdef NDRX_OAPI_DEBUG
5242 NDRX_LOG(log_debug, "RETURN: Bfinds() returns, context: %p, current: %p",
5243 *p_ctxt, G_atmi_tls);
5244 #endif
5245
5246
5247 return ret;
5248 }
5249
5250
5251
5252
5253
5254 expublic int OBisubf(TPCONTEXT_T *p_ctxt, UBFH *p_ub)
5255 {
5256 int ret = EXSUCCEED;
5257 int did_set = EXFALSE;
5258
5259
5260 #ifdef NDRX_OAPI_DEBUG
5261 NDRX_LOG(log_debug, "ENTRY: Bisubf() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5262 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5263 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5264
5265 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5266 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5267
5268 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5269 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5270
5271 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5272 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5273
5274 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5275 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5276
5277 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5278 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5279
5280 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5281 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5282 #endif
5283
5284
5285
5286
5287 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5288 {
5289 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5290 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5291 {
5292 userlog("ERROR! Bisubf() failed to set context");
5293 EXFAIL_OUT(ret);
5294 }
5295 did_set = EXTRUE;
5296 }
5297 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5298 {
5299 userlog("WARNING! Bisubf() context %p thinks that it is assocated "
5300 "with current thread, but thread is associated with %p context!",
5301 p_ctxt, G_atmi_tls);
5302 }
5303
5304 ret = Bisubf(p_ub);
5305
5306 if (did_set)
5307 {
5308 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5309 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5310 {
5311 userlog("ERROR! Bisubf() failed to get context");
5312 EXFAIL_OUT(ret);
5313 }
5314 }
5315 out:
5316
5317 #ifdef NDRX_OAPI_DEBUG
5318 NDRX_LOG(log_debug, "RETURN: Bisubf() returns, context: %p, current: %p",
5319 *p_ctxt, G_atmi_tls);
5320 #endif
5321
5322
5323 return ret;
5324 }
5325
5326
5327
5328
5329
5330 expublic int OBindex(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDOCC occ)
5331 {
5332 int ret = EXSUCCEED;
5333 int did_set = EXFALSE;
5334
5335
5336 #ifdef NDRX_OAPI_DEBUG
5337 NDRX_LOG(log_debug, "ENTRY: Bindex() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5338 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5339 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5340
5341 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5342 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5343
5344 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5345 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5346
5347 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5348 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5349
5350 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5351 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5352
5353 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5354 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5355
5356 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5357 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5358 #endif
5359
5360
5361
5362
5363 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5364 {
5365 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5366 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5367 {
5368 userlog("ERROR! Bindex() failed to set context");
5369 EXFAIL_OUT(ret);
5370 }
5371 did_set = EXTRUE;
5372 }
5373 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5374 {
5375 userlog("WARNING! Bindex() context %p thinks that it is assocated "
5376 "with current thread, but thread is associated with %p context!",
5377 p_ctxt, G_atmi_tls);
5378 }
5379
5380 ret = Bindex(p_ub, occ);
5381
5382 if (did_set)
5383 {
5384 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5385 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5386 {
5387 userlog("ERROR! Bindex() failed to get context");
5388 EXFAIL_OUT(ret);
5389 }
5390 }
5391 out:
5392
5393 #ifdef NDRX_OAPI_DEBUG
5394 NDRX_LOG(log_debug, "RETURN: Bindex() returns, context: %p, current: %p",
5395 *p_ctxt, G_atmi_tls);
5396 #endif
5397
5398
5399 return ret;
5400 }
5401
5402
5403
5404
5405
5406 expublic BFLDOCC OBunindex(TPCONTEXT_T *p_ctxt, UBFH * p_ub)
5407 {
5408 BFLDOCC ret = EXSUCCEED;
5409 int did_set = EXFALSE;
5410
5411
5412 #ifdef NDRX_OAPI_DEBUG
5413 NDRX_LOG(log_debug, "ENTRY: Bunindex() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5414 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5415 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5416
5417 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5418 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5419
5420 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5421 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5422
5423 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5424 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5425
5426 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5427 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5428
5429 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5430 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5431
5432 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5433 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5434 #endif
5435
5436
5437
5438
5439 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5440 {
5441 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5442 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5443 {
5444 userlog("ERROR! Bunindex() failed to set context");
5445 EXFAIL_OUT(ret);
5446 }
5447 did_set = EXTRUE;
5448 }
5449 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5450 {
5451 userlog("WARNING! Bunindex() context %p thinks that it is assocated "
5452 "with current thread, but thread is associated with %p context!",
5453 p_ctxt, G_atmi_tls);
5454 }
5455
5456 ret = Bunindex(p_ub);
5457
5458 if (did_set)
5459 {
5460 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5461 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5462 {
5463 userlog("ERROR! Bunindex() failed to get context");
5464 EXFAIL_OUT(ret);
5465 }
5466 }
5467 out:
5468
5469 #ifdef NDRX_OAPI_DEBUG
5470 NDRX_LOG(log_debug, "RETURN: Bunindex() returns, context: %p, current: %p",
5471 *p_ctxt, G_atmi_tls);
5472 #endif
5473
5474
5475 return ret;
5476 }
5477
5478
5479
5480
5481
5482 expublic long OBidxused(TPCONTEXT_T *p_ctxt, UBFH * p_ub)
5483 {
5484 long ret = EXSUCCEED;
5485 int did_set = EXFALSE;
5486
5487
5488 #ifdef NDRX_OAPI_DEBUG
5489 NDRX_LOG(log_debug, "ENTRY: Bidxused() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5490 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5491 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5492
5493 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5494 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5495
5496 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5497 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5498
5499 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5500 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5501
5502 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5503 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5504
5505 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5506 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5507
5508 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5509 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5510 #endif
5511
5512
5513
5514
5515 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5516 {
5517 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5518 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5519 {
5520 userlog("ERROR! Bidxused() failed to set context");
5521 EXFAIL_OUT(ret);
5522 }
5523 did_set = EXTRUE;
5524 }
5525 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5526 {
5527 userlog("WARNING! Bidxused() context %p thinks that it is assocated "
5528 "with current thread, but thread is associated with %p context!",
5529 p_ctxt, G_atmi_tls);
5530 }
5531
5532 ret = Bidxused(p_ub);
5533
5534 if (did_set)
5535 {
5536 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5537 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5538 {
5539 userlog("ERROR! Bidxused() failed to get context");
5540 EXFAIL_OUT(ret);
5541 }
5542 }
5543 out:
5544
5545 #ifdef NDRX_OAPI_DEBUG
5546 NDRX_LOG(log_debug, "RETURN: Bidxused() returns, context: %p, current: %p",
5547 *p_ctxt, G_atmi_tls);
5548 #endif
5549
5550
5551 return ret;
5552 }
5553
5554
5555
5556
5557
5558 expublic int OBrstrindex(TPCONTEXT_T *p_ctxt, UBFH * p_ub, BFLDOCC occ)
5559 {
5560 int ret = EXSUCCEED;
5561 int did_set = EXFALSE;
5562
5563
5564 #ifdef NDRX_OAPI_DEBUG
5565 NDRX_LOG(log_debug, "ENTRY: Brstrindex() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5566 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5567 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5568
5569 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5570 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5571
5572 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5573 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5574
5575 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5576 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5577
5578 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5579 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5580
5581 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5582 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5583
5584 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5585 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5586 #endif
5587
5588
5589
5590
5591 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5592 {
5593 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5594 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5595 {
5596 userlog("ERROR! Brstrindex() failed to set context");
5597 EXFAIL_OUT(ret);
5598 }
5599 did_set = EXTRUE;
5600 }
5601 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5602 {
5603 userlog("WARNING! Brstrindex() context %p thinks that it is assocated "
5604 "with current thread, but thread is associated with %p context!",
5605 p_ctxt, G_atmi_tls);
5606 }
5607
5608 ret = Brstrindex(p_ub, occ);
5609
5610 if (did_set)
5611 {
5612 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5613 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5614 {
5615 userlog("ERROR! Brstrindex() failed to get context");
5616 EXFAIL_OUT(ret);
5617 }
5618 }
5619 out:
5620
5621 #ifdef NDRX_OAPI_DEBUG
5622 NDRX_LOG(log_debug, "RETURN: Brstrindex() returns, context: %p, current: %p",
5623 *p_ctxt, G_atmi_tls);
5624 #endif
5625
5626
5627 return ret;
5628 }
5629
5630
5631
5632
5633
5634 expublic int OBjoin(TPCONTEXT_T *p_ctxt, UBFH *dest, UBFH *src)
5635 {
5636 int ret = EXSUCCEED;
5637 int did_set = EXFALSE;
5638
5639
5640 #ifdef NDRX_OAPI_DEBUG
5641 NDRX_LOG(log_debug, "ENTRY: Bjoin() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5642 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5643 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5644
5645 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5646 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5647
5648 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5649 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5650
5651 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5652 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5653
5654 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5655 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5656
5657 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5658 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5659
5660 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5661 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5662 #endif
5663
5664
5665
5666
5667 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5668 {
5669 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5670 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5671 {
5672 userlog("ERROR! Bjoin() failed to set context");
5673 EXFAIL_OUT(ret);
5674 }
5675 did_set = EXTRUE;
5676 }
5677 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5678 {
5679 userlog("WARNING! Bjoin() context %p thinks that it is assocated "
5680 "with current thread, but thread is associated with %p context!",
5681 p_ctxt, G_atmi_tls);
5682 }
5683
5684 ret = Bjoin(dest, src);
5685
5686 if (did_set)
5687 {
5688 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5689 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5690 {
5691 userlog("ERROR! Bjoin() failed to get context");
5692 EXFAIL_OUT(ret);
5693 }
5694 }
5695 out:
5696
5697 #ifdef NDRX_OAPI_DEBUG
5698 NDRX_LOG(log_debug, "RETURN: Bjoin() returns, context: %p, current: %p",
5699 *p_ctxt, G_atmi_tls);
5700 #endif
5701
5702
5703 return ret;
5704 }
5705
5706
5707
5708
5709
5710 expublic int OBojoin(TPCONTEXT_T *p_ctxt, UBFH *dest, UBFH *src)
5711 {
5712 int ret = EXSUCCEED;
5713 int did_set = EXFALSE;
5714
5715
5716 #ifdef NDRX_OAPI_DEBUG
5717 NDRX_LOG(log_debug, "ENTRY: Bojoin() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5718 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5719 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5720
5721 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5722 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5723
5724 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5725 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5726
5727 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5728 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5729
5730 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5731 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5732
5733 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5734 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5735
5736 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5737 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5738 #endif
5739
5740
5741
5742
5743 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5744 {
5745 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5746 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5747 {
5748 userlog("ERROR! Bojoin() failed to set context");
5749 EXFAIL_OUT(ret);
5750 }
5751 did_set = EXTRUE;
5752 }
5753 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5754 {
5755 userlog("WARNING! Bojoin() context %p thinks that it is assocated "
5756 "with current thread, but thread is associated with %p context!",
5757 p_ctxt, G_atmi_tls);
5758 }
5759
5760 ret = Bojoin(dest, src);
5761
5762 if (did_set)
5763 {
5764 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5765 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5766 {
5767 userlog("ERROR! Bojoin() failed to get context");
5768 EXFAIL_OUT(ret);
5769 }
5770 }
5771 out:
5772
5773 #ifdef NDRX_OAPI_DEBUG
5774 NDRX_LOG(log_debug, "RETURN: Bojoin() returns, context: %p, current: %p",
5775 *p_ctxt, G_atmi_tls);
5776 #endif
5777
5778
5779 return ret;
5780 }
5781
5782
5783
5784
5785
5786 expublic int OBcmp(TPCONTEXT_T *p_ctxt, UBFH *p_ubf1, UBFH *p_ubf2)
5787 {
5788 int ret = EXSUCCEED;
5789 int did_set = EXFALSE;
5790
5791
5792 #ifdef NDRX_OAPI_DEBUG
5793 NDRX_LOG(log_debug, "ENTRY: Bcmp() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5794 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5795 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5796
5797 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5798 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5799
5800 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5801 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5802
5803 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5804 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5805
5806 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5807 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5808
5809 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5810 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5811
5812 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5813 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5814 #endif
5815
5816
5817
5818
5819 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5820 {
5821 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5822 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5823 {
5824 userlog("ERROR! Bcmp() failed to set context");
5825 EXFAIL_OUT(ret);
5826 }
5827 did_set = EXTRUE;
5828 }
5829 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5830 {
5831 userlog("WARNING! Bcmp() context %p thinks that it is assocated "
5832 "with current thread, but thread is associated with %p context!",
5833 p_ctxt, G_atmi_tls);
5834 }
5835
5836 ret = Bcmp(p_ubf1, p_ubf2);
5837
5838 if (did_set)
5839 {
5840 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5841 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5842 {
5843 userlog("ERROR! Bcmp() failed to get context");
5844 EXFAIL_OUT(ret);
5845 }
5846 }
5847 out:
5848
5849 #ifdef NDRX_OAPI_DEBUG
5850 NDRX_LOG(log_debug, "RETURN: Bcmp() returns, context: %p, current: %p",
5851 *p_ctxt, G_atmi_tls);
5852 #endif
5853
5854
5855 return ret;
5856 }
5857
5858
5859
5860
5861
5862 expublic int OBsubset(TPCONTEXT_T *p_ctxt, UBFH *p_ubf1, UBFH *p_ubf2)
5863 {
5864 int ret = EXSUCCEED;
5865 int did_set = EXFALSE;
5866
5867
5868 #ifdef NDRX_OAPI_DEBUG
5869 NDRX_LOG(log_debug, "ENTRY: Bsubset() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5870 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5871 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5872
5873 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5874 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5875
5876 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5877 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5878
5879 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5880 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5881
5882 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5883 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5884
5885 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5886 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5887
5888 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5889 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5890 #endif
5891
5892
5893
5894
5895 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5896 {
5897 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5898 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5899 {
5900 userlog("ERROR! Bsubset() failed to set context");
5901 EXFAIL_OUT(ret);
5902 }
5903 did_set = EXTRUE;
5904 }
5905 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5906 {
5907 userlog("WARNING! Bsubset() context %p thinks that it is assocated "
5908 "with current thread, but thread is associated with %p context!",
5909 p_ctxt, G_atmi_tls);
5910 }
5911
5912 ret = Bsubset(p_ubf1, p_ubf2);
5913
5914 if (did_set)
5915 {
5916 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5917 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5918 {
5919 userlog("ERROR! Bsubset() failed to get context");
5920 EXFAIL_OUT(ret);
5921 }
5922 }
5923 out:
5924
5925 #ifdef NDRX_OAPI_DEBUG
5926 NDRX_LOG(log_debug, "RETURN: Bsubset() returns, context: %p, current: %p",
5927 *p_ctxt, G_atmi_tls);
5928 #endif
5929
5930
5931 return ret;
5932 }
5933
5934
5935
5936
5937
5938 expublic BFLDOCC OBnum(TPCONTEXT_T *p_ctxt, UBFH * p_ub)
5939 {
5940 BFLDOCC ret = EXSUCCEED;
5941 int did_set = EXFALSE;
5942
5943
5944 #ifdef NDRX_OAPI_DEBUG
5945 NDRX_LOG(log_debug, "ENTRY: Bnum() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
5946 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
5947 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
5948
5949 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
5950 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
5951
5952 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
5953 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
5954
5955 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
5956 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
5957
5958 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
5959 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
5960
5961 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
5962 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
5963
5964 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
5965 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
5966 #endif
5967
5968
5969
5970
5971 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
5972 {
5973 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
5974 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5975 {
5976 userlog("ERROR! Bnum() failed to set context");
5977 EXFAIL_OUT(ret);
5978 }
5979 did_set = EXTRUE;
5980 }
5981 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
5982 {
5983 userlog("WARNING! Bnum() context %p thinks that it is assocated "
5984 "with current thread, but thread is associated with %p context!",
5985 p_ctxt, G_atmi_tls);
5986 }
5987
5988 ret = Bnum(p_ub);
5989
5990 if (did_set)
5991 {
5992 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
5993 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
5994 {
5995 userlog("ERROR! Bnum() failed to get context");
5996 EXFAIL_OUT(ret);
5997 }
5998 }
5999 out:
6000
6001 #ifdef NDRX_OAPI_DEBUG
6002 NDRX_LOG(log_debug, "RETURN: Bnum() returns, context: %p, current: %p",
6003 *p_ctxt, G_atmi_tls);
6004 #endif
6005
6006
6007 return ret;
6008 }
6009
6010
6011
6012
6013
6014 expublic long OBneeded(TPCONTEXT_T *p_ctxt, BFLDOCC nrfields, BFLDLEN totsize)
6015 {
6016 long ret = EXSUCCEED;
6017 int did_set = EXFALSE;
6018
6019
6020 #ifdef NDRX_OAPI_DEBUG
6021 NDRX_LOG(log_debug, "ENTRY: Bneeded() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6022 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6023 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6024
6025 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6026 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6027
6028 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6029 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6030
6031 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6032 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6033
6034 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6035 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6036
6037 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6038 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6039
6040 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6041 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6042 #endif
6043
6044
6045
6046
6047 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6048 {
6049 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6050 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6051 {
6052 userlog("ERROR! Bneeded() failed to set context");
6053 EXFAIL_OUT(ret);
6054 }
6055 did_set = EXTRUE;
6056 }
6057 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6058 {
6059 userlog("WARNING! Bneeded() context %p thinks that it is assocated "
6060 "with current thread, but thread is associated with %p context!",
6061 p_ctxt, G_atmi_tls);
6062 }
6063
6064 ret = Bneeded(nrfields, totsize);
6065
6066 if (did_set)
6067 {
6068 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6069 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6070 {
6071 userlog("ERROR! Bneeded() failed to get context");
6072 EXFAIL_OUT(ret);
6073 }
6074 }
6075 out:
6076
6077 #ifdef NDRX_OAPI_DEBUG
6078 NDRX_LOG(log_debug, "RETURN: Bneeded() returns, context: %p, current: %p",
6079 *p_ctxt, G_atmi_tls);
6080 #endif
6081
6082
6083 return ret;
6084 }
6085
6086
6087
6088
6089
6090 expublic int OBvnull(TPCONTEXT_T *p_ctxt, char *cstruct, char *cname, BFLDOCC occ, char *view)
6091 {
6092 int ret = EXSUCCEED;
6093 int did_set = EXFALSE;
6094
6095
6096 #ifdef NDRX_OAPI_DEBUG
6097 NDRX_LOG(log_debug, "ENTRY: Bvnull() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6098 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6099 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6100
6101 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6102 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6103
6104 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6105 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6106
6107 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6108 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6109
6110 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6111 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6112
6113 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6114 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6115
6116 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6117 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6118 #endif
6119
6120
6121
6122
6123 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6124 {
6125 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6126 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6127 {
6128 userlog("ERROR! Bvnull() failed to set context");
6129 EXFAIL_OUT(ret);
6130 }
6131 did_set = EXTRUE;
6132 }
6133 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6134 {
6135 userlog("WARNING! Bvnull() context %p thinks that it is assocated "
6136 "with current thread, but thread is associated with %p context!",
6137 p_ctxt, G_atmi_tls);
6138 }
6139
6140 ret = Bvnull(cstruct, cname, occ, view);
6141
6142 if (did_set)
6143 {
6144 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6145 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6146 {
6147 userlog("ERROR! Bvnull() failed to get context");
6148 EXFAIL_OUT(ret);
6149 }
6150 }
6151 out:
6152
6153 #ifdef NDRX_OAPI_DEBUG
6154 NDRX_LOG(log_debug, "RETURN: Bvnull() returns, context: %p, current: %p",
6155 *p_ctxt, G_atmi_tls);
6156 #endif
6157
6158
6159 return ret;
6160 }
6161
6162
6163
6164
6165
6166 expublic int OBvselinit(TPCONTEXT_T *p_ctxt, char *cstruct, char *cname, char *view)
6167 {
6168 int ret = EXSUCCEED;
6169 int did_set = EXFALSE;
6170
6171
6172 #ifdef NDRX_OAPI_DEBUG
6173 NDRX_LOG(log_debug, "ENTRY: Bvselinit() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6174 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6175 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6176
6177 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6178 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6179
6180 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6181 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6182
6183 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6184 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6185
6186 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6187 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6188
6189 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6190 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6191
6192 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6193 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6194 #endif
6195
6196
6197
6198
6199 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6200 {
6201 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6202 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6203 {
6204 userlog("ERROR! Bvselinit() failed to set context");
6205 EXFAIL_OUT(ret);
6206 }
6207 did_set = EXTRUE;
6208 }
6209 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6210 {
6211 userlog("WARNING! Bvselinit() context %p thinks that it is assocated "
6212 "with current thread, but thread is associated with %p context!",
6213 p_ctxt, G_atmi_tls);
6214 }
6215
6216 ret = Bvselinit(cstruct, cname, view);
6217
6218 if (did_set)
6219 {
6220 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6221 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6222 {
6223 userlog("ERROR! Bvselinit() failed to get context");
6224 EXFAIL_OUT(ret);
6225 }
6226 }
6227 out:
6228
6229 #ifdef NDRX_OAPI_DEBUG
6230 NDRX_LOG(log_debug, "RETURN: Bvselinit() returns, context: %p, current: %p",
6231 *p_ctxt, G_atmi_tls);
6232 #endif
6233
6234
6235 return ret;
6236 }
6237
6238
6239
6240
6241
6242 expublic int OBvsinit(TPCONTEXT_T *p_ctxt, char *cstruct, char *view)
6243 {
6244 int ret = EXSUCCEED;
6245 int did_set = EXFALSE;
6246
6247
6248 #ifdef NDRX_OAPI_DEBUG
6249 NDRX_LOG(log_debug, "ENTRY: Bvsinit() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6250 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6251 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6252
6253 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6254 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6255
6256 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6257 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6258
6259 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6260 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6261
6262 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6263 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6264
6265 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6266 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6267
6268 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6269 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6270 #endif
6271
6272
6273
6274
6275 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6276 {
6277 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6278 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6279 {
6280 userlog("ERROR! Bvsinit() failed to set context");
6281 EXFAIL_OUT(ret);
6282 }
6283 did_set = EXTRUE;
6284 }
6285 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6286 {
6287 userlog("WARNING! Bvsinit() context %p thinks that it is assocated "
6288 "with current thread, but thread is associated with %p context!",
6289 p_ctxt, G_atmi_tls);
6290 }
6291
6292 ret = Bvsinit(cstruct, view);
6293
6294 if (did_set)
6295 {
6296 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6297 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6298 {
6299 userlog("ERROR! Bvsinit() failed to get context");
6300 EXFAIL_OUT(ret);
6301 }
6302 }
6303 out:
6304
6305 #ifdef NDRX_OAPI_DEBUG
6306 NDRX_LOG(log_debug, "RETURN: Bvsinit() returns, context: %p, current: %p",
6307 *p_ctxt, G_atmi_tls);
6308 #endif
6309
6310
6311 return ret;
6312 }
6313
6314
6315
6316
6317 expublic void OBvrefresh(TPCONTEXT_T *p_ctxt)
6318 {
6319 int did_set = EXFALSE;
6320
6321
6322 #ifdef NDRX_OAPI_DEBUG
6323 NDRX_LOG(log_debug, "ENTRY: Bvrefresh() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6324 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6325 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6326
6327 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6328 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6329
6330 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6331 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6332
6333 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6334 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6335
6336 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6337 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6338
6339 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6340 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6341
6342 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6343 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6344 #endif
6345
6346
6347
6348
6349 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6350 {
6351
6352 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6353 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6354 {
6355 userlog("ERROR! Bvrefresh() failed to set context");
6356 }
6357 did_set = EXTRUE;
6358 }
6359 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6360 {
6361 userlog("WARNING! Bvrefresh() context %p thinks that it is assocated "
6362 "with current thread, but thread is associated with %p context!",
6363 p_ctxt, G_atmi_tls);
6364 }
6365
6366 Bvrefresh();
6367
6368 if (did_set)
6369 {
6370 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6371 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6372 {
6373 userlog("ERROR! Bvrefresh() failed to get context");
6374 }
6375 }
6376 out:
6377
6378 #ifdef NDRX_OAPI_DEBUG
6379 NDRX_LOG(log_debug, "RETURN: Bvrefresh() returns, context: %p, current: %p",
6380 *p_ctxt, G_atmi_tls);
6381 #endif
6382
6383
6384 return;
6385 }
6386
6387
6388
6389
6390
6391 expublic int OBvopt(TPCONTEXT_T *p_ctxt, char *cname, int option, char *view)
6392 {
6393 int ret = EXSUCCEED;
6394 int did_set = EXFALSE;
6395
6396
6397 #ifdef NDRX_OAPI_DEBUG
6398 NDRX_LOG(log_debug, "ENTRY: Bvopt() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6399 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6400 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6401
6402 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6403 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6404
6405 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6406 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6407
6408 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6409 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6410
6411 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6412 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6413
6414 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6415 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6416
6417 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6418 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6419 #endif
6420
6421
6422
6423
6424 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6425 {
6426 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6427 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6428 {
6429 userlog("ERROR! Bvopt() failed to set context");
6430 EXFAIL_OUT(ret);
6431 }
6432 did_set = EXTRUE;
6433 }
6434 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6435 {
6436 userlog("WARNING! Bvopt() context %p thinks that it is assocated "
6437 "with current thread, but thread is associated with %p context!",
6438 p_ctxt, G_atmi_tls);
6439 }
6440
6441 ret = Bvopt(cname, option, view);
6442
6443 if (did_set)
6444 {
6445 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6446 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6447 {
6448 userlog("ERROR! Bvopt() failed to get context");
6449 EXFAIL_OUT(ret);
6450 }
6451 }
6452 out:
6453
6454 #ifdef NDRX_OAPI_DEBUG
6455 NDRX_LOG(log_debug, "RETURN: Bvopt() returns, context: %p, current: %p",
6456 *p_ctxt, G_atmi_tls);
6457 #endif
6458
6459
6460 return ret;
6461 }
6462
6463
6464
6465
6466
6467 expublic int OBvftos(TPCONTEXT_T *p_ctxt, UBFH *p_ub, char *cstruct, char *view)
6468 {
6469 int ret = EXSUCCEED;
6470 int did_set = EXFALSE;
6471
6472
6473 #ifdef NDRX_OAPI_DEBUG
6474 NDRX_LOG(log_debug, "ENTRY: Bvftos() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6475 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6476 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6477
6478 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6479 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6480
6481 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6482 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6483
6484 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6485 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6486
6487 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6488 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6489
6490 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6491 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6492
6493 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6494 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6495 #endif
6496
6497
6498
6499
6500 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6501 {
6502 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6503 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6504 {
6505 userlog("ERROR! Bvftos() failed to set context");
6506 EXFAIL_OUT(ret);
6507 }
6508 did_set = EXTRUE;
6509 }
6510 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6511 {
6512 userlog("WARNING! Bvftos() context %p thinks that it is assocated "
6513 "with current thread, but thread is associated with %p context!",
6514 p_ctxt, G_atmi_tls);
6515 }
6516
6517 ret = Bvftos(p_ub, cstruct, view);
6518
6519 if (did_set)
6520 {
6521 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6522 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6523 {
6524 userlog("ERROR! Bvftos() failed to get context");
6525 EXFAIL_OUT(ret);
6526 }
6527 }
6528 out:
6529
6530 #ifdef NDRX_OAPI_DEBUG
6531 NDRX_LOG(log_debug, "RETURN: Bvftos() returns, context: %p, current: %p",
6532 *p_ctxt, G_atmi_tls);
6533 #endif
6534
6535
6536 return ret;
6537 }
6538
6539
6540
6541
6542
6543 expublic int OBvstof(TPCONTEXT_T *p_ctxt, UBFH *p_ub, char *cstruct, int mode, char *view)
6544 {
6545 int ret = EXSUCCEED;
6546 int did_set = EXFALSE;
6547
6548
6549 #ifdef NDRX_OAPI_DEBUG
6550 NDRX_LOG(log_debug, "ENTRY: Bvstof() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6551 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6552 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6553
6554 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6555 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6556
6557 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6558 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6559
6560 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6561 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6562
6563 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6564 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6565
6566 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6567 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6568
6569 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6570 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6571 #endif
6572
6573
6574
6575
6576 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6577 {
6578 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6579 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6580 {
6581 userlog("ERROR! Bvstof() failed to set context");
6582 EXFAIL_OUT(ret);
6583 }
6584 did_set = EXTRUE;
6585 }
6586 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6587 {
6588 userlog("WARNING! Bvstof() context %p thinks that it is assocated "
6589 "with current thread, but thread is associated with %p context!",
6590 p_ctxt, G_atmi_tls);
6591 }
6592
6593 ret = Bvstof(p_ub, cstruct, mode, view);
6594
6595 if (did_set)
6596 {
6597 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6598 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6599 {
6600 userlog("ERROR! Bvstof() failed to get context");
6601 EXFAIL_OUT(ret);
6602 }
6603 }
6604 out:
6605
6606 #ifdef NDRX_OAPI_DEBUG
6607 NDRX_LOG(log_debug, "RETURN: Bvstof() returns, context: %p, current: %p",
6608 *p_ctxt, G_atmi_tls);
6609 #endif
6610
6611
6612 return ret;
6613 }
6614
6615
6616
6617
6618
6619 expublic int OCBvget(TPCONTEXT_T *p_ctxt, char *cstruct, char *view, char *cname, BFLDOCC occ, char *buf, BFLDLEN *len, int usrtype, long flags)
6620 {
6621 int ret = EXSUCCEED;
6622 int did_set = EXFALSE;
6623
6624
6625 #ifdef NDRX_OAPI_DEBUG
6626 NDRX_LOG(log_debug, "ENTRY: CBvget() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6627 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6628 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6629
6630 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6631 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6632
6633 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6634 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6635
6636 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6637 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6638
6639 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6640 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6641
6642 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6643 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6644
6645 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6646 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6647 #endif
6648
6649
6650
6651
6652 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6653 {
6654 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6655 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6656 {
6657 userlog("ERROR! CBvget() failed to set context");
6658 EXFAIL_OUT(ret);
6659 }
6660 did_set = EXTRUE;
6661 }
6662 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6663 {
6664 userlog("WARNING! CBvget() context %p thinks that it is assocated "
6665 "with current thread, but thread is associated with %p context!",
6666 p_ctxt, G_atmi_tls);
6667 }
6668
6669 ret = CBvget(cstruct, view, cname, occ, buf, len, usrtype, flags);
6670
6671 if (did_set)
6672 {
6673 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6674 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6675 {
6676 userlog("ERROR! CBvget() failed to get context");
6677 EXFAIL_OUT(ret);
6678 }
6679 }
6680 out:
6681
6682 #ifdef NDRX_OAPI_DEBUG
6683 NDRX_LOG(log_debug, "RETURN: CBvget() returns, context: %p, current: %p",
6684 *p_ctxt, G_atmi_tls);
6685 #endif
6686
6687
6688 return ret;
6689 }
6690
6691
6692
6693
6694
6695 expublic char * OCBvgetalloc(TPCONTEXT_T *p_ctxt, char *cstruct, char *view, char *cname, BFLDOCC occ, int usrtype, long flags, BFLDLEN *extralen)
6696 {
6697 int did_set = EXFALSE;
6698 char * ret = NULL;
6699
6700
6701 #ifdef NDRX_OAPI_DEBUG
6702 NDRX_LOG(log_debug, "ENTRY: CBvgetalloc() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6703 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6704 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6705
6706 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6707 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6708
6709 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6710 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6711
6712 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6713 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6714
6715 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6716 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6717
6718 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6719 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6720
6721 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6722 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6723 #endif
6724
6725
6726
6727 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6728 {
6729
6730 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6731 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6732 {
6733 userlog("ERROR! CBvgetalloc() failed to set context");
6734 ret = NULL;
6735 goto out;
6736 }
6737 did_set = EXTRUE;
6738 }
6739 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6740 {
6741 userlog("WARNING! CBvgetalloc() context %p thinks that it is assocated "
6742 "with current thread, but thread is associated with %p context!",
6743 p_ctxt, G_atmi_tls);
6744 }
6745
6746 ret = CBvgetalloc(cstruct, view, cname, occ, usrtype, flags, extralen);
6747
6748 if (did_set)
6749 {
6750 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6751 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6752 {
6753 userlog("ERROR! CBvgetalloc() failed to get context");
6754 ret = NULL;
6755 goto out;
6756 }
6757 }
6758 out:
6759
6760 #ifdef NDRX_OAPI_DEBUG
6761 NDRX_LOG(log_debug, "RETURN: CBvgetalloc() returns, context: %p, current: %p",
6762 *p_ctxt, G_atmi_tls);
6763 #endif
6764
6765
6766 return ret;
6767 }
6768
6769
6770
6771
6772
6773 expublic int OCBvchg(TPCONTEXT_T *p_ctxt, char *cstruct, char *view, char *cname, BFLDOCC occ, char *buf, BFLDLEN len, int usrtype)
6774 {
6775 int ret = EXSUCCEED;
6776 int did_set = EXFALSE;
6777
6778
6779 #ifdef NDRX_OAPI_DEBUG
6780 NDRX_LOG(log_debug, "ENTRY: CBvchg() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6781 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6782 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6783
6784 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6785 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6786
6787 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6788 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6789
6790 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6791 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6792
6793 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6794 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6795
6796 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6797 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6798
6799 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6800 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6801 #endif
6802
6803
6804
6805
6806 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6807 {
6808 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6809 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6810 {
6811 userlog("ERROR! CBvchg() failed to set context");
6812 EXFAIL_OUT(ret);
6813 }
6814 did_set = EXTRUE;
6815 }
6816 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6817 {
6818 userlog("WARNING! CBvchg() context %p thinks that it is assocated "
6819 "with current thread, but thread is associated with %p context!",
6820 p_ctxt, G_atmi_tls);
6821 }
6822
6823 ret = CBvchg(cstruct, view, cname, occ, buf, len, usrtype);
6824
6825 if (did_set)
6826 {
6827 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6828 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6829 {
6830 userlog("ERROR! CBvchg() failed to get context");
6831 EXFAIL_OUT(ret);
6832 }
6833 }
6834 out:
6835
6836 #ifdef NDRX_OAPI_DEBUG
6837 NDRX_LOG(log_debug, "RETURN: CBvchg() returns, context: %p, current: %p",
6838 *p_ctxt, G_atmi_tls);
6839 #endif
6840
6841
6842 return ret;
6843 }
6844
6845
6846
6847
6848
6849 expublic long OBvsizeof(TPCONTEXT_T *p_ctxt, char *view)
6850 {
6851 long ret = EXSUCCEED;
6852 int did_set = EXFALSE;
6853
6854
6855 #ifdef NDRX_OAPI_DEBUG
6856 NDRX_LOG(log_debug, "ENTRY: Bvsizeof() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6857 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6858 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6859
6860 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6861 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6862
6863 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6864 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6865
6866 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6867 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6868
6869 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6870 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6871
6872 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6873 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6874
6875 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6876 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6877 #endif
6878
6879
6880
6881
6882 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6883 {
6884 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6885 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6886 {
6887 userlog("ERROR! Bvsizeof() failed to set context");
6888 EXFAIL_OUT(ret);
6889 }
6890 did_set = EXTRUE;
6891 }
6892 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6893 {
6894 userlog("WARNING! Bvsizeof() context %p thinks that it is assocated "
6895 "with current thread, but thread is associated with %p context!",
6896 p_ctxt, G_atmi_tls);
6897 }
6898
6899 ret = Bvsizeof(view);
6900
6901 if (did_set)
6902 {
6903 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6904 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6905 {
6906 userlog("ERROR! Bvsizeof() failed to get context");
6907 EXFAIL_OUT(ret);
6908 }
6909 }
6910 out:
6911
6912 #ifdef NDRX_OAPI_DEBUG
6913 NDRX_LOG(log_debug, "RETURN: Bvsizeof() returns, context: %p, current: %p",
6914 *p_ctxt, G_atmi_tls);
6915 #endif
6916
6917
6918 return ret;
6919 }
6920
6921
6922
6923
6924
6925 expublic long OBvcpy(TPCONTEXT_T *p_ctxt, char *cstruct_dst, char *cstruct_src, char *view)
6926 {
6927 long ret = EXSUCCEED;
6928 int did_set = EXFALSE;
6929
6930
6931 #ifdef NDRX_OAPI_DEBUG
6932 NDRX_LOG(log_debug, "ENTRY: Bvcpy() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
6933 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
6934 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
6935
6936 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
6937 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
6938
6939 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
6940 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
6941
6942 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
6943 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
6944
6945 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
6946 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
6947
6948 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
6949 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
6950
6951 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
6952 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
6953 #endif
6954
6955
6956
6957
6958 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
6959 {
6960 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
6961 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6962 {
6963 userlog("ERROR! Bvcpy() failed to set context");
6964 EXFAIL_OUT(ret);
6965 }
6966 did_set = EXTRUE;
6967 }
6968 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
6969 {
6970 userlog("WARNING! Bvcpy() context %p thinks that it is assocated "
6971 "with current thread, but thread is associated with %p context!",
6972 p_ctxt, G_atmi_tls);
6973 }
6974
6975 ret = Bvcpy(cstruct_dst, cstruct_src, view);
6976
6977 if (did_set)
6978 {
6979 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
6980 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
6981 {
6982 userlog("ERROR! Bvcpy() failed to get context");
6983 EXFAIL_OUT(ret);
6984 }
6985 }
6986 out:
6987
6988 #ifdef NDRX_OAPI_DEBUG
6989 NDRX_LOG(log_debug, "RETURN: Bvcpy() returns, context: %p, current: %p",
6990 *p_ctxt, G_atmi_tls);
6991 #endif
6992
6993
6994 return ret;
6995 }
6996
6997
6998
6999
7000
7001 expublic BFLDOCC OBvoccur(TPCONTEXT_T *p_ctxt, char *cstruct, char *view, char *cname, BFLDOCC *maxocc, BFLDOCC *realocc, long *dim_size, int* fldtype)
7002 {
7003 BFLDOCC ret = EXSUCCEED;
7004 int did_set = EXFALSE;
7005
7006
7007 #ifdef NDRX_OAPI_DEBUG
7008 NDRX_LOG(log_debug, "ENTRY: Bvoccur() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
7009 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
7010 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
7011
7012 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
7013 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
7014
7015 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
7016 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
7017
7018 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
7019 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
7020
7021 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
7022 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
7023
7024 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
7025 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
7026
7027 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
7028 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
7029 #endif
7030
7031
7032
7033
7034 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
7035 {
7036 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
7037 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7038 {
7039 userlog("ERROR! Bvoccur() failed to set context");
7040 EXFAIL_OUT(ret);
7041 }
7042 did_set = EXTRUE;
7043 }
7044 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
7045 {
7046 userlog("WARNING! Bvoccur() context %p thinks that it is assocated "
7047 "with current thread, but thread is associated with %p context!",
7048 p_ctxt, G_atmi_tls);
7049 }
7050
7051 ret = Bvoccur(cstruct, view, cname, maxocc, realocc, dim_size, fldtype);
7052
7053 if (did_set)
7054 {
7055 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
7056 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7057 {
7058 userlog("ERROR! Bvoccur() failed to get context");
7059 EXFAIL_OUT(ret);
7060 }
7061 }
7062 out:
7063
7064 #ifdef NDRX_OAPI_DEBUG
7065 NDRX_LOG(log_debug, "RETURN: Bvoccur() returns, context: %p, current: %p",
7066 *p_ctxt, G_atmi_tls);
7067 #endif
7068
7069
7070 return ret;
7071 }
7072
7073
7074
7075
7076
7077 expublic int OBvsetoccur(TPCONTEXT_T *p_ctxt, char *cstruct, char *view, char *cname, BFLDOCC occ)
7078 {
7079 int ret = EXSUCCEED;
7080 int did_set = EXFALSE;
7081
7082
7083 #ifdef NDRX_OAPI_DEBUG
7084 NDRX_LOG(log_debug, "ENTRY: Bvsetoccur() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
7085 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
7086 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
7087
7088 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
7089 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
7090
7091 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
7092 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
7093
7094 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
7095 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
7096
7097 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
7098 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
7099
7100 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
7101 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
7102
7103 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
7104 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
7105 #endif
7106
7107
7108
7109
7110 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
7111 {
7112 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
7113 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7114 {
7115 userlog("ERROR! Bvsetoccur() failed to set context");
7116 EXFAIL_OUT(ret);
7117 }
7118 did_set = EXTRUE;
7119 }
7120 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
7121 {
7122 userlog("WARNING! Bvsetoccur() context %p thinks that it is assocated "
7123 "with current thread, but thread is associated with %p context!",
7124 p_ctxt, G_atmi_tls);
7125 }
7126
7127 ret = Bvsetoccur(cstruct, view, cname, occ);
7128
7129 if (did_set)
7130 {
7131 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
7132 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7133 {
7134 userlog("ERROR! Bvsetoccur() failed to get context");
7135 EXFAIL_OUT(ret);
7136 }
7137 }
7138 out:
7139
7140 #ifdef NDRX_OAPI_DEBUG
7141 NDRX_LOG(log_debug, "RETURN: Bvsetoccur() returns, context: %p, current: %p",
7142 *p_ctxt, G_atmi_tls);
7143 #endif
7144
7145
7146 return ret;
7147 }
7148
7149
7150
7151
7152
7153 expublic int OBvnext(TPCONTEXT_T *p_ctxt, Bvnext_state_t *state, char *view, char *cname, int *fldtype, BFLDOCC *maxocc, long *dim_size)
7154 {
7155 int ret = EXSUCCEED;
7156 int did_set = EXFALSE;
7157
7158
7159 #ifdef NDRX_OAPI_DEBUG
7160 NDRX_LOG(log_debug, "ENTRY: Bvnext() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
7161 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
7162 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
7163
7164 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
7165 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
7166
7167 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
7168 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
7169
7170 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
7171 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
7172
7173 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
7174 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
7175
7176 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
7177 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
7178
7179 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
7180 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
7181 #endif
7182
7183
7184
7185
7186 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
7187 {
7188 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
7189 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7190 {
7191 userlog("ERROR! Bvnext() failed to set context");
7192 EXFAIL_OUT(ret);
7193 }
7194 did_set = EXTRUE;
7195 }
7196 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
7197 {
7198 userlog("WARNING! Bvnext() context %p thinks that it is assocated "
7199 "with current thread, but thread is associated with %p context!",
7200 p_ctxt, G_atmi_tls);
7201 }
7202
7203 ret = Bvnext(state, view, cname, fldtype, maxocc, dim_size);
7204
7205 if (did_set)
7206 {
7207 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
7208 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7209 {
7210 userlog("ERROR! Bvnext() failed to get context");
7211 EXFAIL_OUT(ret);
7212 }
7213 }
7214 out:
7215
7216 #ifdef NDRX_OAPI_DEBUG
7217 NDRX_LOG(log_debug, "RETURN: Bvnext() returns, context: %p, current: %p",
7218 *p_ctxt, G_atmi_tls);
7219 #endif
7220
7221
7222 return ret;
7223 }
7224
7225
7226
7227
7228
7229 expublic int OBvcmp(TPCONTEXT_T *p_ctxt, char *cstruct1, char *view1, char *cstruct2, char *view2)
7230 {
7231 int ret = EXSUCCEED;
7232 int did_set = EXFALSE;
7233
7234
7235 #ifdef NDRX_OAPI_DEBUG
7236 NDRX_LOG(log_debug, "ENTRY: Bvcmp() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
7237 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
7238 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
7239
7240 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
7241 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
7242
7243 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
7244 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
7245
7246 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
7247 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
7248
7249 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
7250 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
7251
7252 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
7253 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
7254
7255 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
7256 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
7257 #endif
7258
7259
7260
7261
7262 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
7263 {
7264 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
7265 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7266 {
7267 userlog("ERROR! Bvcmp() failed to set context");
7268 EXFAIL_OUT(ret);
7269 }
7270 did_set = EXTRUE;
7271 }
7272 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
7273 {
7274 userlog("WARNING! Bvcmp() context %p thinks that it is assocated "
7275 "with current thread, but thread is associated with %p context!",
7276 p_ctxt, G_atmi_tls);
7277 }
7278
7279 ret = Bvcmp(cstruct1, view1, cstruct2, view2);
7280
7281 if (did_set)
7282 {
7283 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
7284 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7285 {
7286 userlog("ERROR! Bvcmp() failed to get context");
7287 EXFAIL_OUT(ret);
7288 }
7289 }
7290 out:
7291
7292 #ifdef NDRX_OAPI_DEBUG
7293 NDRX_LOG(log_debug, "RETURN: Bvcmp() returns, context: %p, current: %p",
7294 *p_ctxt, G_atmi_tls);
7295 #endif
7296
7297
7298 return ret;
7299 }
7300
7301
7302
7303
7304
7305 expublic int OBvprint(TPCONTEXT_T *p_ctxt, char *cstruct, char *view)
7306 {
7307 int ret = EXSUCCEED;
7308 int did_set = EXFALSE;
7309
7310
7311 #ifdef NDRX_OAPI_DEBUG
7312 NDRX_LOG(log_debug, "ENTRY: Bvprint() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
7313 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
7314 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
7315
7316 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
7317 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
7318
7319 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
7320 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
7321
7322 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
7323 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
7324
7325 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
7326 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
7327
7328 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
7329 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
7330
7331 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
7332 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
7333 #endif
7334
7335
7336
7337
7338 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
7339 {
7340 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
7341 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7342 {
7343 userlog("ERROR! Bvprint() failed to set context");
7344 EXFAIL_OUT(ret);
7345 }
7346 did_set = EXTRUE;
7347 }
7348 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
7349 {
7350 userlog("WARNING! Bvprint() context %p thinks that it is assocated "
7351 "with current thread, but thread is associated with %p context!",
7352 p_ctxt, G_atmi_tls);
7353 }
7354
7355 ret = Bvprint(cstruct, view);
7356
7357 if (did_set)
7358 {
7359 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
7360 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7361 {
7362 userlog("ERROR! Bvprint() failed to get context");
7363 EXFAIL_OUT(ret);
7364 }
7365 }
7366 out:
7367
7368 #ifdef NDRX_OAPI_DEBUG
7369 NDRX_LOG(log_debug, "RETURN: Bvprint() returns, context: %p, current: %p",
7370 *p_ctxt, G_atmi_tls);
7371 #endif
7372
7373
7374 return ret;
7375 }
7376
7377
7378
7379
7380
7381 expublic int OBvfprint(TPCONTEXT_T *p_ctxt, char *cstruct, char *view, FILE * outf)
7382 {
7383 int ret = EXSUCCEED;
7384 int did_set = EXFALSE;
7385
7386
7387 #ifdef NDRX_OAPI_DEBUG
7388 NDRX_LOG(log_debug, "ENTRY: Bvfprint() enter, context: %p, current: %p", *p_ctxt, G_atmi_tls);
7389 NDRX_LOG(log_debug, "ENTRY: is_associated_with_thread = %d",
7390 ((atmi_tls_t *)*p_ctxt)->is_associated_with_thread);
7391
7392 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NSTD = %d",
7393 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NSTD );
7394
7395 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_UBF = %d",
7396 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_UBF );
7397
7398 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_ATMI = %d",
7399 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_ATMI );
7400
7401 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_TRAN = %d",
7402 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_TRAN );
7403
7404 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_NOCHK = %d",
7405 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_NOCHK );
7406
7407 NDRX_LOG(log_debug, "ENTRY: CTXT_PRIV_IGN = %d",
7408 (CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN) & CTXT_PRIV_IGN );
7409 #endif
7410
7411
7412
7413
7414 if (!((atmi_tls_t *)*p_ctxt)->is_associated_with_thread)
7415 {
7416 if (EXSUCCEED!=ndrx_tpsetctxt(*p_ctxt, 0,
7417 CTXT_PRIV_NSTD|CTXT_PRIV_UBF | CTXT_PRIV_IGN))
7418 {
7419 userlog("ERROR! Bvfprint() failed to set context");
7420 EXFAIL_OUT(ret);
7421 }
7422 did_set = EXTRUE;
7423 }
7424 else if ((atmi_tls_t *)*p_ctxt != G_atmi_tls)
7425 {
7426 userlog("WARNING! Bvfprint() context %p thinks that it is assocated "
7427 "with current thread, but thread is associated with %p context!",
7428 p_ctxt, G_atmi_tls);
7429 }
7430
7431 ret = Bvfprint(cstruct, view, outf);
7432
7433 if (did_set)
7434 {
7435 if (TPMULTICONTEXTS!=ndrx_tpgetctxt(p_ctxt, 0,
7436 CTXT_PRIV_NSTD|