MCPcopy Create free account
hub / github.com/csound/csound / pcopy

Function pcopy

Engine/sread.c:850–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

848}
849
850static void pcopy(CSOUND *csound, int pfno, int ncopy, SRTBLK *prvbp)
851 /* cpy pfields from prev note of this instr */
852 /* begin at pfno, copy 'ncopy' fields */
853 /* uses *nxp++; sp untouched */
854{
855 char *p, *pp, c;
856 int n;
857
858 pp = prvbp->text; /* in text of prev note, */
859 n = pfno;
860 while (n--)
861 while (*pp++ != SP) /* locate starting pfld */
862 ;
863 n = ncopy;
864 p = (csound->sread.nxp);
865 while (n--) { /* and copy n pflds */
866 if (*pp != '"')
867 while ((*p++ = c = *pp++) != SP && c != LF)
868 ;
869 else {
870 *p++ = *pp++;
871 while ((*p++ = *pp++) != '"')
872 ;
873 *p++ = *pp++;
874 }
875 switch (pfno) {
876 case 1: (csound->sread.bp)->p1val = prvbp->p1val; /* with p1-p3 vals */
877 setprv(csound);
878 break;
879 case 2:
880 if (*(p-2) == '+') /* (interpr . of +) */
881 (csound->sread.prvp2) =
882 (csound->sread.bp)->p2val = prvbp->p2val + FABS(prvbp->p3val);
883 else (csound->sread.prvp2) = (csound->sread.bp)->p2val = prvbp->p2val;
884 (csound->sread.bp)->newp2 = (csound->sread.bp)->p2val;
885 break;
886 case 3: (csound->sread.bp)->newp3 = (csound->sread.bp)->p3val = prvbp->p3val;
887 break;
888 default:
889 break;
890 }
891 (csound->sread.bp)->lineno = prvbp->lineno;
892 pfno++;
893 }
894 (csound->sread.nxp) = p; /* adjust globl nxp pntr */
895}
896
897static void salcinit(CSOUND *csound)
898{ /* init the sorter mem space for a new section */

Callers 1

ifaFunction · 0.85

Calls 1

setprvFunction · 0.85

Tested by

no test coverage detected