File: makelist.c

package info (click to toggle)
icmake 7.21.01-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,856 kB
  • ctags: 1,498
  • sloc: ansic: 7,791; makefile: 3,879; sh: 320; cpp: 83
file content (44 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download | duplicates (2)
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
/*
                             M A K E L I S T . C

    Possibilities:
        1- makelist(int, string)
        2- makelist(int, string, older, string)     -- younger ok too

    The parser may have inserted the int-argument as int O_FILE

*/

#include "iccomp.h"

ESTRUC_ *makelist(ESTRUC_ *args, E_TYPE_ type)
{
    if
    (                                       /* first arg not int */
        !test_type(codestruc(args, 0), e_int)
        ||                                  /* or second not string */
        !test_type(codestruc(args, 1), e_str)
        ||                                  /* or three arguments, but */
            ( 
              args->type == 3
              &&                            /* last is not string */
              !test_type(codestruc(args, 2), e_str)
            )
    )
    {
        semantic(type_conflict, funstring[f_makelist]);
        return (args);
    }

    catargs(args);                          /* catenate all arguments */

    if ((OPCODE_)type != op_hlt)            /* hidden function called */
        callhidden((OPCODE_)type == op_younger, args);
    else
        callrss(args, f_makelist);

    return (args);                          /* return called function code */
}