1 /***************************************************************************
2  *  This file is automatically generated by gen-get-set.  Be sure to keep
3  *  track of any manual changes.
4  *
5  *  These generated functions are not expected to be perfect.  Check and
6  *  edit as needed before adding to your code.
7  ***************************************************************************/
8 
9 #include <string.h>
10 #include <ctype.h>
11 #include <xtend/string.h>      // strlcpy() on Linux
12 #include "fasta.h"
13 
14 
15 /***************************************************************************
16  *  Library:
17  *      #include <biolibc/fasta.h>
18  *      -lbiolibc -lxtend
19  *
20  *  Description:
21  *      Mutator for desc member in a bl_fasta_t structure.
22  *      Use this function to set desc in a bl_fasta_t variable
23  *      from non-member functions.  This function performs a direct
24  *      assignment for scalar or pointer structure members.  If
25  *      desc is a pointer, data previously pointed to should
26  *      generally be freed before calling this function to avoid memory
27  *      leaks.
28  *
29  *      Note that there is an equivalent macro (), which performs
30  *      this function with no data verification or function call overhead.
31  *      Use the macro version to maximize performance where the validity
32  *      of new_desc is guaranteed by other means.
33  *
34  *
35  *  Arguments:
36  *      bl_fasta_ptr    Pointer to the bl_bed_t structure to set
37  *      new_desc        The new value for desc
38  *
39  *  Returns:
40  *      BL_DATA_OK if the new value is acceptable and assigned
41  *      BL_DATA_OUT_OF_RANGE otherwise
42  *
43  *  Examples:
44  *      bl_fasta_t      bl_fasta;
45  *      char *          new_desc;
46  *
47  *      if ( bl_fasta_set_desc(&bl_fasta, new_desc) == BL_DATA_OK )
48  *      {
49  *      }
50  *
51  *  See also:
52  *      (3)
53  *
54  *  History:
55  *  Date        Name        Modification
56  *  2021-07-27  gen-get-set Auto-generated from fasta.h
57  ***************************************************************************/
58 
bl_fasta_set_desc(bl_fasta_t * bl_fasta_ptr,char * new_desc)59 int     bl_fasta_set_desc(bl_fasta_t *bl_fasta_ptr, char * new_desc)
60 
61 {
62     /* FIXME: Replace this with a proper sanity check */
63     if ( new_desc == NULL )
64 	return BL_DATA_OUT_OF_RANGE;
65     else
66     {
67 	bl_fasta_ptr->desc = new_desc;
68 	return BL_DATA_OK;
69     }
70 }
71 
72 
73 /***************************************************************************
74  *  Library:
75  *      #include <biolibc/fasta.h>
76  *      -lbiolibc -lxtend
77  *
78  *  Description:
79  *      Mutator for an array element of desc member in a bl_fasta_t
80  *      structure. Use this function to set an element of the array
81  *      desc in a bl_fasta_t variable from non-member functions.
82  *
83  *      Note that there is an equivalent macro BL_FASTA_SET_DESC_AE(), which performs
84  *      this function with no data verification or function call overhead.
85  *      Use the macro version to maximize performance where the validity
86  *      of new_desc_element is guaranteed by other means.
87  *
88  *  Arguments:
89  *      bl_fasta_ptr        Pointer to the bl_bed_t structure to set
90  *      c                   Subscript to the desc array
91  *      new_desc_element    The new value for desc[c]
92  *
93  *  Returns:
94  *      BL_DATA_OK if the new value is acceptable and assigned
95  *      BL_DATA_OUT_OF_RANGE otherwise
96  *
97  *  Examples:
98  *      bl_fasta_t      bl_fasta;
99  *      size_t          c;
100  *      char *          new_desc_element;
101  *
102  *      if ( bl_fasta_set_desc(&bl_fasta, c, new_desc_element) == BL_DATA_OK )
103  *      {
104  *      }
105  *
106  *  See also:
107  *      BL_FASTA_SET_DESC_AE(3)
108  *
109  *  History:
110  *  Date        Name        Modification
111  *  2021-07-27  gen-get-set Auto-generated from fasta.h
112  ***************************************************************************/
113 
bl_fasta_set_desc_ae(bl_fasta_t * bl_fasta_ptr,size_t c,char new_desc_element)114 int     bl_fasta_set_desc_ae(bl_fasta_t *bl_fasta_ptr, size_t c, char  new_desc_element)
115 
116 {
117     /* FIXME: Replace this with a proper sanity check */
118     if ( 0 )
119 	return BL_DATA_OUT_OF_RANGE;
120     else
121     {
122 	bl_fasta_ptr->desc[c] = new_desc_element;
123 	return BL_DATA_OK;
124     }
125 }
126 
127 
128 /***************************************************************************
129  *  Library:
130  *      #include <biolibc/fasta.h>
131  *      -lbiolibc -lxtend
132  *
133  *  Description:
134  *      Mutator for desc member in a bl_fasta_t structure.
135  *      Use this function to set desc in a bl_fasta_t variable
136  *      from non-member functions.  This function copies the array pointed to
137  *      by new_desc to ->desc.
138  *
139  *      Note that there is an equivalent macro BL_FASTA_SET_DESC(), which performs
140  *      this function with no data verification or function call overhead.
141  *      Use the macro version to maximize performance where the validity
142  *      of new_desc is guaranteed by other means.
143  *
144  *  Arguments:
145  *      bl_fasta_ptr    Pointer to the bl_bed_t structure to set
146  *      new_desc        The new value for desc
147  *      array_size      Size of the desc array.
148  *
149  *  Returns:
150  *      BL_DATA_OK if the new value is acceptable and assigned
151  *      BL_DATA_OUT_OF_RANGE otherwise
152  *
153  *  Examples:
154  *      bl_fasta_t      bl_fasta;
155  *      char *          new_desc;
156  *      size_t          array_size;
157  *
158  *      if ( bl_fasta_set_desc(&bl_fasta, new_desc, array_size) == BL_DATA_OK )
159  *      {
160  *      }
161  *
162  *  See also:
163  *      BL_FASTA_SET_DESC(3)
164  *
165  *  History:
166  *  Date        Name        Modification
167  *  2021-07-27  gen-get-set Auto-generated from fasta.h
168  ***************************************************************************/
169 
bl_fasta_set_desc_cpy(bl_fasta_t * bl_fasta_ptr,char * new_desc,size_t array_size)170 int     bl_fasta_set_desc_cpy(bl_fasta_t *bl_fasta_ptr, char * new_desc, size_t array_size)
171 
172 {
173     /* FIXME: Replace this with a proper sanity check */
174     if ( new_desc == NULL )
175 	return BL_DATA_OUT_OF_RANGE;
176     else
177     {
178 	// FIXME: Assuming char array is a null-terminated string
179 	strlcpy(bl_fasta_ptr->desc, new_desc, array_size);
180 	return BL_DATA_OK;
181     }
182 }
183 
184 
185 /***************************************************************************
186  *  Library:
187  *      #include <biolibc/fasta.h>
188  *      -lbiolibc -lxtend
189  *
190  *  Description:
191  *      Mutator for seq member in a bl_fasta_t structure.
192  *      Use this function to set seq in a bl_fasta_t variable
193  *      from non-member functions.  This function performs a direct
194  *      assignment for scalar or pointer structure members.  If
195  *      seq is a pointer, data previously pointed to should
196  *      generally be freed before calling this function to avoid memory
197  *      leaks.
198  *
199  *      Note that there is an equivalent macro (), which performs
200  *      this function with no data verification or function call overhead.
201  *      Use the macro version to maximize performance where the validity
202  *      of new_seq is guaranteed by other means.
203  *
204  *
205  *  Arguments:
206  *      bl_fasta_ptr    Pointer to the bl_bed_t structure to set
207  *      new_seq         The new value for seq
208  *
209  *  Returns:
210  *      BL_DATA_OK if the new value is acceptable and assigned
211  *      BL_DATA_OUT_OF_RANGE otherwise
212  *
213  *  Examples:
214  *      bl_fasta_t      bl_fasta;
215  *      char *          new_seq;
216  *
217  *      if ( bl_fasta_set_seq(&bl_fasta, new_seq) == BL_DATA_OK )
218  *      {
219  *      }
220  *
221  *  See also:
222  *      (3)
223  *
224  *  History:
225  *  Date        Name        Modification
226  *  2021-07-27  gen-get-set Auto-generated from fasta.h
227  ***************************************************************************/
228 
bl_fasta_set_seq(bl_fasta_t * bl_fasta_ptr,char * new_seq)229 int     bl_fasta_set_seq(bl_fasta_t *bl_fasta_ptr, char * new_seq)
230 
231 {
232     /* FIXME: Replace this with a proper sanity check */
233     if ( new_seq == NULL )
234 	return BL_DATA_OUT_OF_RANGE;
235     else
236     {
237 	bl_fasta_ptr->seq = new_seq;
238 	return BL_DATA_OK;
239     }
240 }
241 
242 
243 /***************************************************************************
244  *  Library:
245  *      #include <biolibc/fasta.h>
246  *      -lbiolibc -lxtend
247  *
248  *  Description:
249  *      Mutator for an array element of seq member in a bl_fasta_t
250  *      structure. Use this function to set an element of the array
251  *      seq in a bl_fasta_t variable from non-member functions.
252  *
253  *      Note that there is an equivalent macro BL_FASTA_SET_SEQ_AE(), which performs
254  *      this function with no data verification or function call overhead.
255  *      Use the macro version to maximize performance where the validity
256  *      of new_seq_element is guaranteed by other means.
257  *
258  *  Arguments:
259  *      bl_fasta_ptr    Pointer to the bl_bed_t structure to set
260  *      c               Subscript to the seq array
261  *      new_seq_element The new value for seq[c]
262  *
263  *  Returns:
264  *      BL_DATA_OK if the new value is acceptable and assigned
265  *      BL_DATA_OUT_OF_RANGE otherwise
266  *
267  *  Examples:
268  *      bl_fasta_t      bl_fasta;
269  *      size_t          c;
270  *      char *          new_seq_element;
271  *
272  *      if ( bl_fasta_set_seq(&bl_fasta, c, new_seq_element) == BL_DATA_OK )
273  *      {
274  *      }
275  *
276  *  See also:
277  *      BL_FASTA_SET_SEQ_AE(3)
278  *
279  *  History:
280  *  Date        Name        Modification
281  *  2021-07-27  gen-get-set Auto-generated from fasta.h
282  ***************************************************************************/
283 
bl_fasta_set_seq_ae(bl_fasta_t * bl_fasta_ptr,size_t c,char new_seq_element)284 int     bl_fasta_set_seq_ae(bl_fasta_t *bl_fasta_ptr, size_t c, char  new_seq_element)
285 
286 {
287     /* FIXME: Replace this with a proper sanity check */
288     if ( 0 )
289 	return BL_DATA_OUT_OF_RANGE;
290     else
291     {
292 	bl_fasta_ptr->seq[c] = new_seq_element;
293 	return BL_DATA_OK;
294     }
295 }
296 
297 
298 /***************************************************************************
299  *  Library:
300  *      #include <biolibc/fasta.h>
301  *      -lbiolibc -lxtend
302  *
303  *  Description:
304  *      Mutator for seq member in a bl_fasta_t structure.
305  *      Use this function to set seq in a bl_fasta_t variable
306  *      from non-member functions.  This function copies the array pointed to
307  *      by new_seq to ->seq.
308  *
309  *      Note that there is an equivalent macro BL_FASTA_SET_SEQ(), which performs
310  *      this function with no data verification or function call overhead.
311  *      Use the macro version to maximize performance where the validity
312  *      of new_seq is guaranteed by other means.
313  *
314  *  Arguments:
315  *      bl_fasta_ptr    Pointer to the bl_bed_t structure to set
316  *      new_seq         The new value for seq
317  *      array_size      Size of the seq array.
318  *
319  *  Returns:
320  *      BL_DATA_OK if the new value is acceptable and assigned
321  *      BL_DATA_OUT_OF_RANGE otherwise
322  *
323  *  Examples:
324  *      bl_fasta_t      bl_fasta;
325  *      char *          new_seq;
326  *      size_t          array_size;
327  *
328  *      if ( bl_fasta_set_seq(&bl_fasta, new_seq, array_size) == BL_DATA_OK )
329  *      {
330  *      }
331  *
332  *  See also:
333  *      BL_FASTA_SET_SEQ(3)
334  *
335  *  History:
336  *  Date        Name        Modification
337  *  2021-07-27  gen-get-set Auto-generated from fasta.h
338  ***************************************************************************/
339 
bl_fasta_set_seq_cpy(bl_fasta_t * bl_fasta_ptr,char * new_seq,size_t array_size)340 int     bl_fasta_set_seq_cpy(bl_fasta_t *bl_fasta_ptr, char * new_seq, size_t array_size)
341 
342 {
343     /* FIXME: Replace this with a proper sanity check */
344     if ( new_seq == NULL )
345 	return BL_DATA_OUT_OF_RANGE;
346     else
347     {
348 	// FIXME: Assuming char array is a null-terminated string
349 	strlcpy(bl_fasta_ptr->seq, new_seq, array_size);
350 	return BL_DATA_OK;
351     }
352 }
353 
354 
355 /***************************************************************************
356  *  Library:
357  *      #include <biolibc/fasta.h>
358  *      -lbiolibc -lxtend
359  *
360  *  Description:
361  *      Mutator for desc_array_size member in a bl_fasta_t structure.
362  *      Use this function to set desc_array_size in a bl_fasta_t variable
363  *      from non-member functions.  This function performs a direct
364  *      assignment for scalar or pointer structure members.  If
365  *      desc_array_size is a pointer, data previously pointed to should
366  *      generally be freed before calling this function to avoid memory
367  *      leaks.
368  *
369  *      Note that there is an equivalent macro (), which performs
370  *      this function with no data verification or function call overhead.
371  *      Use the macro version to maximize performance where the validity
372  *      of new_desc_array_size is guaranteed by other means.
373  *
374  *
375  *  Arguments:
376  *      bl_fasta_ptr        Pointer to the bl_bed_t structure to set
377  *      new_desc_array_size The new value for desc_array_size
378  *
379  *  Returns:
380  *      BL_DATA_OK if the new value is acceptable and assigned
381  *      BL_DATA_OUT_OF_RANGE otherwise
382  *
383  *  Examples:
384  *      bl_fasta_t      bl_fasta;
385  *      size_t          new_desc_array_size;
386  *
387  *      if ( bl_fasta_set_desc_array_size(&bl_fasta, new_desc_array_size) == BL_DATA_OK )
388  *      {
389  *      }
390  *
391  *  See also:
392  *      (3)
393  *
394  *  History:
395  *  Date        Name        Modification
396  *  2021-07-27  gen-get-set Auto-generated from fasta.h
397  ***************************************************************************/
398 
bl_fasta_set_desc_array_size(bl_fasta_t * bl_fasta_ptr,size_t new_desc_array_size)399 int     bl_fasta_set_desc_array_size(bl_fasta_t *bl_fasta_ptr, size_t new_desc_array_size)
400 
401 {
402     /* FIXME: Replace this with a proper sanity check */
403     if ( 0 )
404 	return BL_DATA_OUT_OF_RANGE;
405     else
406     {
407 	bl_fasta_ptr->desc_array_size = new_desc_array_size;
408 	return BL_DATA_OK;
409     }
410 }
411 
412 
413 /***************************************************************************
414  *  Library:
415  *      #include <biolibc/fasta.h>
416  *      -lbiolibc -lxtend
417  *
418  *  Description:
419  *      Mutator for seq_array_size member in a bl_fasta_t structure.
420  *      Use this function to set seq_array_size in a bl_fasta_t variable
421  *      from non-member functions.  This function performs a direct
422  *      assignment for scalar or pointer structure members.  If
423  *      seq_array_size is a pointer, data previously pointed to should
424  *      generally be freed before calling this function to avoid memory
425  *      leaks.
426  *
427  *      Note that there is an equivalent macro (), which performs
428  *      this function with no data verification or function call overhead.
429  *      Use the macro version to maximize performance where the validity
430  *      of new_seq_array_size is guaranteed by other means.
431  *
432  *
433  *  Arguments:
434  *      bl_fasta_ptr        Pointer to the bl_bed_t structure to set
435  *      new_seq_array_size  The new value for seq_array_size
436  *
437  *  Returns:
438  *      BL_DATA_OK if the new value is acceptable and assigned
439  *      BL_DATA_OUT_OF_RANGE otherwise
440  *
441  *  Examples:
442  *      bl_fasta_t      bl_fasta;
443  *      size_t          new_seq_array_size;
444  *
445  *      if ( bl_fasta_set_seq_array_size(&bl_fasta, new_seq_array_size) == BL_DATA_OK )
446  *      {
447  *      }
448  *
449  *  See also:
450  *      (3)
451  *
452  *  History:
453  *  Date        Name        Modification
454  *  2021-07-27  gen-get-set Auto-generated from fasta.h
455  ***************************************************************************/
456 
bl_fasta_set_seq_array_size(bl_fasta_t * bl_fasta_ptr,size_t new_seq_array_size)457 int     bl_fasta_set_seq_array_size(bl_fasta_t *bl_fasta_ptr, size_t new_seq_array_size)
458 
459 {
460     /* FIXME: Replace this with a proper sanity check */
461     if ( 0 )
462 	return BL_DATA_OUT_OF_RANGE;
463     else
464     {
465 	bl_fasta_ptr->seq_array_size = new_seq_array_size;
466 	return BL_DATA_OK;
467     }
468 }
469 
470 
471 /***************************************************************************
472  *  Library:
473  *      #include <biolibc/fasta.h>
474  *      -lbiolibc -lxtend
475  *
476  *  Description:
477  *      Mutator for desc_len member in a bl_fasta_t structure.
478  *      Use this function to set desc_len in a bl_fasta_t variable
479  *      from non-member functions.  This function performs a direct
480  *      assignment for scalar or pointer structure members.  If
481  *      desc_len is a pointer, data previously pointed to should
482  *      generally be freed before calling this function to avoid memory
483  *      leaks.
484  *
485  *      Note that there is an equivalent macro (), which performs
486  *      this function with no data verification or function call overhead.
487  *      Use the macro version to maximize performance where the validity
488  *      of new_desc_len is guaranteed by other means.
489  *
490  *
491  *  Arguments:
492  *      bl_fasta_ptr    Pointer to the bl_bed_t structure to set
493  *      new_desc_len    The new value for desc_len
494  *
495  *  Returns:
496  *      BL_DATA_OK if the new value is acceptable and assigned
497  *      BL_DATA_OUT_OF_RANGE otherwise
498  *
499  *  Examples:
500  *      bl_fasta_t      bl_fasta;
501  *      size_t          new_desc_len;
502  *
503  *      if ( bl_fasta_set_desc_len(&bl_fasta, new_desc_len) == BL_DATA_OK )
504  *      {
505  *      }
506  *
507  *  See also:
508  *      (3)
509  *
510  *  History:
511  *  Date        Name        Modification
512  *  2021-07-27  gen-get-set Auto-generated from fasta.h
513  ***************************************************************************/
514 
bl_fasta_set_desc_len(bl_fasta_t * bl_fasta_ptr,size_t new_desc_len)515 int     bl_fasta_set_desc_len(bl_fasta_t *bl_fasta_ptr, size_t new_desc_len)
516 
517 {
518     /* FIXME: Replace this with a proper sanity check */
519     if ( 0 )
520 	return BL_DATA_OUT_OF_RANGE;
521     else
522     {
523 	bl_fasta_ptr->desc_len = new_desc_len;
524 	return BL_DATA_OK;
525     }
526 }
527 
528 
529 /***************************************************************************
530  *  Library:
531  *      #include <biolibc/fasta.h>
532  *      -lbiolibc -lxtend
533  *
534  *  Description:
535  *      Mutator for seq_len member in a bl_fasta_t structure.
536  *      Use this function to set seq_len in a bl_fasta_t variable
537  *      from non-member functions.  This function performs a direct
538  *      assignment for scalar or pointer structure members.  If
539  *      seq_len is a pointer, data previously pointed to should
540  *      generally be freed before calling this function to avoid memory
541  *      leaks.
542  *
543  *      Note that there is an equivalent macro (), which performs
544  *      this function with no data verification or function call overhead.
545  *      Use the macro version to maximize performance where the validity
546  *      of new_seq_len is guaranteed by other means.
547  *
548  *
549  *  Arguments:
550  *      bl_fasta_ptr    Pointer to the bl_bed_t structure to set
551  *      new_seq_len     The new value for seq_len
552  *
553  *  Returns:
554  *      BL_DATA_OK if the new value is acceptable and assigned
555  *      BL_DATA_OUT_OF_RANGE otherwise
556  *
557  *  Examples:
558  *      bl_fasta_t      bl_fasta;
559  *      size_t          new_seq_len;
560  *
561  *      if ( bl_fasta_set_seq_len(&bl_fasta, new_seq_len) == BL_DATA_OK )
562  *      {
563  *      }
564  *
565  *  See also:
566  *      (3)
567  *
568  *  History:
569  *  Date        Name        Modification
570  *  2021-07-27  gen-get-set Auto-generated from fasta.h
571  ***************************************************************************/
572 
bl_fasta_set_seq_len(bl_fasta_t * bl_fasta_ptr,size_t new_seq_len)573 int     bl_fasta_set_seq_len(bl_fasta_t *bl_fasta_ptr, size_t new_seq_len)
574 
575 {
576     /* FIXME: Replace this with a proper sanity check */
577     if ( 0 )
578 	return BL_DATA_OUT_OF_RANGE;
579     else
580     {
581 	bl_fasta_ptr->seq_len = new_seq_len;
582 	return BL_DATA_OK;
583     }
584 }
585