/ Allocate the offset block used by intermediate key columns. */ /
| 3133 | /* Allocate the offset block used by intermediate key columns. */ |
| 3134 | /***********************************************************************/ |
| 3135 | int *KXYCOL::MakeOffset(PGLOBAL g, int n) |
| 3136 | { |
| 3137 | if (!Kof) { |
| 3138 | // Calculate the initial size of the offset |
| 3139 | Koff.Size = (n + 1) * sizeof(int); |
| 3140 | |
| 3141 | // Allocate the required memory |
| 3142 | if (!PlgDBalloc(g, NULL, Koff)) { |
| 3143 | strcpy(g->Message, MSG(KEY_ALLOC_ERR)); |
| 3144 | return NULL; // Error |
| 3145 | } // endif |
| 3146 | |
| 3147 | } else if (n) { |
| 3148 | // This is a reallocation call |
| 3149 | PlgDBrealloc(g, NULL, Koff, (n + 1) * sizeof(int)); |
| 3150 | } else |
| 3151 | PlgDBfree(Koff); |
| 3152 | |
| 3153 | return (int*)Kof; |
| 3154 | } // end of MakeOffset |
| 3155 | |
| 3156 | /***********************************************************************/ |
| 3157 | /* Make a front end array of key values that are the first value of */ |
no test coverage detected