HP 800 ACSE/Presentation and ROSE Interface Programmer's Guide - Page 53

Do not use the udata_length part of the cdata parameter - parts

Page 53 highlights

Programming Guide 2. Manage the A/P Environment • Isolate the allocations and freeing of memory passed to the A/P library to a single function. For example: void *ubuf_ptr; user_get_osi_buf (&ubuf_ptr, len,"data to put in ubuf"); ap_snd (.., ubuf_ptr); • Do not statically initialize a cdata structure. For example, do not use the statement: a_assoc_req_env_t peer_application = {...}; • Do not use the udata_length part of the cdata parameter for inbound indications. Instead, calculate the length from the osi_buf that is returned. Isolate this calculation to one routine. Chapter 4 53

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109

Chapter 4
53
Programming Guide
2. Manage the A/P Environment
Isolate the allocations and freeing of memory passed to the A/P
library to a single function. For example:
void *ubuf_ptr;
user_get_osi_buf (&ubuf_ptr, len,”data to put in ubuf”);
ap_snd (.., ubuf_ptr);
Do not statically initialize a cdata structure. For example, do not
use the statement:
a_assoc_req_env_t peer_application = {...};
Do not use the udata_length part of the cdata parameter for
inbound indications. Instead, calculate the length from the osi_buf
that is returned. Isolate this calculation to one routine.