| 1 |
|
| ################################################################################ |
| 2 |
|
| # |
| 3 |
|
| # Copyright (c) 2002-2020 Marcus Holland-Moritz. All rights reserved. |
| 4 |
|
| # This program is free software; you can redistribute it and/or modify |
| 5 |
|
| # it under the same terms as Perl itself. |
| 6 |
|
| # |
| 7 |
|
| ################################################################################ |
| 8 |
|
| |
| 9 |
|
| |
| 10 |
|
| ################################################################################ |
| 11 |
|
| # |
| 12 |
|
| # METHOD: dependencies |
| 13 |
|
| # |
| 14 |
|
| # WRITTEN BY: Marcus Holland-Moritz ON: Sep 2002 |
| 15 |
|
| # CHANGED BY: ON: |
| 16 |
|
| # |
| 17 |
|
| ################################################################################ |
| 18 |
|
| |
| 19 |
|
| void |
| 20 |
|
| CBC::dependencies() |
| 21 |
|
| PREINIT: |
| 22 |
935 |
| CBC_METHOD(dependencies); |
| 23 |
|
| HashIterator hi; |
| 24 |
|
| const char *pKey; |
| 25 |
|
| FileInfo *pFI; |
| 26 |
|
| |
| 27 |
|
| PPCODE: |
| 28 |
|
| CT_DEBUG_METHOD; |
| 29 |
|
| |
| 30 |
935 |
▶ | CHECK_PARSE_DATA; |
Branch: 1 branch
| Branch | True | False | Total |
| CHECK_PARSE_DATA; |
3 |
932 |
935 |
|
| 31 |
932 |
▶ | CHECK_VOID_CONTEXT; |
Branch: 2 branches
| Branch | True | False | Total |
| CHECK_VOID_CONTEXT; |
3 |
929 |
932 |
| CHECK_VOID_CONTEXT; |
2 |
1 |
3 |
|
| 32 |
|
| |
| 33 |
929 |
▶ | if (GIMME_V == G_SCALAR) |
Branch: 1 branch
| Branch | True | False | Total |
| if (GIMME_V == G_SCALAR) |
926 |
3 |
929 |
|
| 34 |
|
| { |
| 35 |
926 |
| HV *hv = newHV(); |
| 36 |
|
| |
| 37 |
2043 |
▶ | HT_foreach(pKey, pFI, hi, THIS->cpi.htFiles) |
Branch: 1 branch
| Branch | True | False | Total |
| HT_foreach(pKey, pFI, hi, THIS->cpi.htFiles) |
1117 |
926 |
2043 |
|
| 38 |
|
| { |
| 39 |
1117 |
▶ | if (pFI && pFI->valid) |
Branch: 2 branches
| Branch | True | False | Total |
| if (pFI && pFI->valid) |
1117 |
0 |
1117 |
| if (pFI && pFI->valid) |
213 |
904 |
1117 |
|
| 40 |
|
| { |
| 41 |
|
| SV *attr; |
| 42 |
213 |
| HV *hattr = newHV(); |
| 43 |
|
| |
| 44 |
213 |
▶ | HV_STORE_CONST(hattr, "size", newSVuv(pFI->size)); |
Branch: 1 branch
| Branch | True | False | Total |
| HV_STORE_CONST(hattr, "size", newSVuv(pFI->size)); |
0 |
213 |
213 |
|
| 45 |
213 |
▶ | HV_STORE_CONST(hattr, "mtime", newSViv(pFI->modify_time)); |
Branch: 1 branch
| Branch | True | False | Total |
| HV_STORE_CONST(hattr, "mtime", newSViv(pFI->modify_time)); |
0 |
213 |
213 |
|
| 46 |
213 |
▶ | HV_STORE_CONST(hattr, "ctime", newSViv(pFI->change_time)); |
Branch: 1 branch
| Branch | True | False | Total |
| HV_STORE_CONST(hattr, "ctime", newSViv(pFI->change_time)); |
0 |
213 |
213 |
|
| 47 |
|
| |
| 48 |
213 |
| attr = newRV_noinc((SV *) hattr); |
| 49 |
|
| |
| 50 |
213 |
▶ | if (hv_store(hv, pFI->name, strlen(pFI->name), attr, 0) == NULL) |
Branch: 1 branch
| Branch | True | False | Total |
| if (hv_store(hv, pFI->name, strlen(pFI->name), attr, 0) == NULL) |
0 |
213 |
213 |
|
| 51 |
0 |
| SvREFCNT_dec(attr); |
| 52 |
|
| } |
| 53 |
|
| } |
| 54 |
|
| |
| 55 |
926 |
▶ | XPUSHs(sv_2mortal(newRV_noinc((SV *) hv))); |
Branch: 1 branch
| Branch | True | False | Total |
| XPUSHs(sv_2mortal(newRV_noinc((SV *) hv))); |
0 |
926 |
926 |
|
| 56 |
926 |
| XSRETURN(1); |
| 57 |
|
| } |
| 58 |
|
| else |
| 59 |
|
| { |
| 60 |
3 |
| int keylen, count = 0; |
| 61 |
|
| |
| 62 |
3 |
| HI_init(&hi, THIS->cpi.htFiles); |
| 63 |
35 |
▶ | while (HI_next(&hi, &pKey, &keylen, (void **) &pFI)) |
Branch: 1 branch
| Branch | True | False | Total |
| while (HI_next(&hi, &pKey, &keylen, (void **) &pFI)) |
32 |
3 |
35 |
|
| 64 |
32 |
▶ | if (pFI && pFI->valid) |
Branch: 2 branches
| Branch | True | False | Total |
| if (pFI && pFI->valid) |
32 |
0 |
32 |
| if (pFI && pFI->valid) |
31 |
1 |
32 |
|
| 65 |
|
| { |
| 66 |
31 |
▶ | XPUSHs(sv_2mortal(newSVpvn(CONST_CHAR(pKey), keylen))); |
Branch: 1 branch
| Branch | True | False | Total |
| XPUSHs(sv_2mortal(newSVpvn(CONST_CHAR(pKey), keylen))); |
0 |
31 |
31 |
|
| 67 |
31 |
| count++; |
| 68 |
|
| } |
| 69 |
|
| |
| 70 |
3 |
| XSRETURN(count); |
| 71 |
|
| } |
| 72 |
|
| |