diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/qpoe/qpastr.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/qpoe/qpastr.x')
-rw-r--r-- | sys/qpoe/qpastr.x | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/qpoe/qpastr.x b/sys/qpoe/qpastr.x new file mode 100644 index 00000000..4c856b10 --- /dev/null +++ b/sys/qpoe/qpastr.x @@ -0,0 +1,35 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +include "qpoe.h" + +# QP_ASTR -- Set the value of a string parameter, creating the parameter if +# it does not already exist. This works for the common case of string +# parameters allocated a fixed amount of space at create time (any type of +# string parameter can be written into if it already exists). Additional +# control over the parameter attributes is possible if the parameter is +# explicitly created with qp_addf before being written into. + +procedure qp_astr (qp, param, value, comment) + +pointer qp #I QPOE descriptor +char param[ARB] #I parameter name +char value[ARB] #I parameter value +char comment[ARB] #I comment field, if creating parameter + +int nchars +int qp_accessf(), strlen() +errchk qp_accessf, qp_addf + +begin + # By default we allocate a somewhat bigger storage area than needed + # to store the string, to permit updates of a similar length. If + # more control over the maximum string length is needed, QP_ADDF + # should be called explicitly. + + if (qp_accessf (qp, param) == NO) { + nchars = (strlen(value) + INC_STRLEN-1) / INC_STRLEN * INC_STRLEN + call qp_addf (qp, param, "c", nchars, comment, 0) + } + + call qp_pstr (qp, param, value) +end |