XPRS_nml_getnames
The XPRS_nml_* functions provide a simple, generic interface to lists of names, which may be names of rows/columns on a problem or may be a list of arbitrary names provided by the user. The XPRS_nml_getnames function returns some of the names held in the name list. The names shall be returned in a character buffer, and with each name being separated by a NULL character.
int XPRS_CC XPRS_nml_getnames(XPRSnamelist nml, int pad, char buffer[], int maxbytes, int* p_nbytes, int first, int last);
nml
|
The namelist object.
|
pad
|
The minimum length of each name. If
>0 then names shorter than
pad will be concatenated with whitespace to make them this length.
|
buffer
|
Buffer of length
maxbytes into which the names shall be returned.
|
maxbytes
|
The maximum number of bytes that may be written to the character buffer
buffer.
|
p_nbytes
|
A pointer to a variable into which will be written the number of bytes required to contain the names. May be NULL if not required.
|
first
|
The index of the first name in the namelist to return. Note name list indexes always start from 0.
|
last
|
The index of the last name in the namelist to return.
|
XPRSnamelist mylist; char* cbuf; int o, i, cbuflen; ... /* Find out how much space we'll require for these names */ XPRS_nml_getnames(mylist, 0, NULL, 0, &cbuflen, 0, 5 ); /* Allocate a buffer large enough to hold the names */ cbuf = malloc(cbuflen); /* Retrieve the names */ XPRS_nml_getnames(mylist, 0, cbuf, cbuflen, NULL, 0, 5); /* Display the names */ o=0; for (i=0;i<6;i++) { printf("Name #%d = %s\n", i, cbuf+o); o += strlen(cbuf)+1; }
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.