<commit_before>/*
  entry1.c:

  Copyright (C) 1991 <NAME>, <NAME>

  This file is part of Csound.

  The Csound Library is free software; you can redistribute it
  and/or modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  Csound is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with Csound; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  02110-1301 USA
*/

#include "entry1.h"             /*                      ENTRY1.C        */
#include "interlocks.h"

/* thread vals, where isub=1, ksub=2:
   0 =     1  OR   2  (B out only)
   1 =     1
   2 =             2
   3 =     1  AND  2
 */

/* inarg types include the following:

   i       irate scalar
   k       krate scalar
   a       arate vector
   f       frequency variable
   w       spectral variable
   x       krate scalar or arate vector
   S       String
   T       String or i-rate
   U       String or i/k-rate
   B       Boolean k-rate
   b       Boolean i-rate; internally generated as required
   l       Label
   .       required arg of any-type
   and codes
   ?       optional arg of any-type
   m       begins an indef list of iargs (any count)
   M       begins an indef list of args (any count/rate i,k,a)
   N       begins an indef list of args (any count/rate i,k,a,S)
   o       optional i-rate, defaulting to  0
   p              "             "          1
   q              "             "         10
   v              "             "          .5
   j              "             "         -1
   h              "             "        127
   O       optional k-rate, defaulting to  0
   J              "             "         -1
   V              "             "          .5
   P              "             "          1
   W       begins indef list of Strings (any count)
   y       begins indef list of aargs (any count)
   z       begins indef list of kargs (any count)
   Z       begins alternating kakaka...list (any count)    */

/* outarg types include:
 i, k, a, S as  above
 *       multiple out args of any-type
 m       multiple out aargs
 z       multiple out kargs
 I       multiple out irate (not implemented yet)
 s       deprecated (use a or k as required)
 X       multiple args (a, k, or i-rate)     IV - Sep 1 2002
 N       multiple args (a, k, i, or S-rate)
 F       multiple args (f-rate)#
 */


OENTRY opcodlst_1[] = {
  /* opcode   dspace  flags  thread  outarg  inargs  isub    ksub    asub    */
  { "",     0,      0,    0,      "",     "",     NULL, NULL, NULL, NULL },
  { "instr",  0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  { "endin",  0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  /* IV - Sep 8 2002 */
  { "opcode", 0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  { "endop",  0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  { "$label", S(LBLBLK),  0,0,      "",     "",   NULL, NULL, NULL, NULL },
  { "pset",   S(PVSET),   0,0,      "",     "m",  NULL, NULL, NULL, NULL },

  /* IV - Sep 8 2002 - added entries for user defined opcodes, xin, xout */
  /* and setksmps */
  { "##userOpcode", S(UOPCODE),0, 7, "", "", useropcdset, useropcd, useropcd, NULL },
  /* IV - Sep 10 2002: removed perf time routines of xin and xout */
  { "xin",  S(XIN_MAX),0,   1,  "****************", "",  xinset,  NULL, NULL, NULL },
  /* { "xin.64",   S(XIN_HIGH),0,  1,
    "****************************************************************", "",
    xinset,  NULL, NULL },
  { "##xin256",  S(XIN_MAX),0,   1,
    "****************************************************************"
    "****************************************************************"
    "****************************************************************"
    "****************************************************************", "",
    xinset,  NULL, NULL },*/
  { "xout", S(XOUT_MAX),0,  1,  "",         "*", xoutset, NULL, NULL, NULL },
  { "setksmps", S(SETKSMPS),0,  1,  "",   "i", setksmpsset, NULL, NULL },
  { "ctrlinit",S(CTLINIT),0,1,      "",  "im", ctrlinit, NULL, NULL, NULL},
  { "massign",S(MASSIGN), 0,1,      "",  "iip",massign_p, NULL, NULL, NULL},
  { "massign.iS",S(MASSIGNS), 0,1,  "",  "iSp",massign_S, NULL, NULL, NULL},
  { "turnon", S(TURNON),  0,1,      "",     "io", turnon, NULL, NULL, NULL},
  { "turnon.S", S(TURNON),  0,1,    "",     "So", turnon_S, NULL, NULL, NULL},
  { "remoteport", S(REMOTEPORT), 0,1, "",  "i", remoteport, NULL, NULL, NULL},
  { "insremot",S(INSREMOT),0,1,     "",     "SSm",insremot, NULL, NULL, NULL},
  { "midremot",S(MIDREMOT),0,1,     "",     "SSm",midremot, NULL, NULL, NULL},
  { "insglobal",S(INSGLOBAL),0,1,   "",     "Sm", insglobal, NULL, NULL, NULL},
  { "midglobal",S(MIDGLOBAL),0,1,   "",     "Sm", midglobal, NULL, NULL, NULL},
  { "ihold",  S(LINK),0,    1,      "",     "",     ihold, NULL, NULL, NULL  },
  { "turnoff",S(LINK),0,    2,      "",     "",     NULL,   turnoff, NULL, NULL },
  {  "=.S",   S(STRCPY_OP),0,   1,  "S",    "S",
     (SUBR) strcpy_opcode_S, NULL, (SUBR) NULL, NULL    },
  {  "=.T",   S(STRGET_OP),0,   1,  "S",    "i",
     (SUBR) strcpy_opcode_p, (SUBR) NULL, (SUBR) NULL, NULL                 },
  { "=.r",    S(ASSIGN),0,  1,      "r",    "i",    rassign, NULL, NULL, NULL },
  { "=.i",    S(ASSIGNM),0, 1,      "IIIIIIIIIIIIIIIIIIIIIIII", "m",
    minit, NULL, NULL, NULL  },
  { "=.k",    S(ASSIGNM),0, 2,      "zzzzzzzzzzzzzzzzzzzzzzzz", "z",
    NULL, minit, NULL, NULL },
  { "=.a",    S(ASSIGN),0,  2,      "a",    "a",    NULL, gaassign, NULL },
  { "=.l",    S(ASSIGN),0,  2,      "a",    "a",    NULL,   laassign, NULL },
  { "=.up",   S(UPSAMP),0,  2,      "a",    "k",  NULL, (SUBR)upsamp, NULL },
  { "=.down",   S(DOWNSAMP),0,  3,  "k",    "ao",   (SUBR)downset,(SUBR)downsamp },
  //  { "=.t",    S(ASSIGNT),0, 2,      "t",    "kk",   NULL,   tassign, NULL   },
  { "init.S", S(STRCPY_OP),0, 1,      "S", "S", (SUBR) strcpy_opcode_S  },
  { "init.Si", S(STRCPY_OP),0, 1,      "S", "i", (SUBR) strcpy_opcode_p  },
  { "init.i", S(ASSIGNM),0, 1,      "IIIIIIIIIIIIIIIIIIIIIIII", "m", minit  },
  { "init.k", S(ASSIGNM),0, 1,      "zzzzzzzzzzzzzzzzzzzzzzzz", "m", minit  },
  { "init.a", S(ASSIGNM),0, 1,      "mmmmmmmmmmmmmmmmmmmmmmmm", "m", mainit },
  { ">",      S(RELAT),0,   0,      "b",    "ii",   gt,     gt              },
  { ">.0",      S(RELAT),0,   0,      "B",    "kk",   gt,     gt              },
  { ">=",     S(RELAT),0,   0,      "b",    "ii",   ge,     ge              },
  { ">=.0",     S(RELAT),0,   0,      "B",    "kk",   ge,     ge              },
  { "<",      S(RELAT),0,   0,      "b",    "ii",   lt,     lt              },
  { "<.0",      S(RELAT),0,   0,      "B",    "kk",   lt,     lt              },
  { "<=",     S(RELAT),0,   0,      "b",    "ii",   le,     le              },
  { "<=.0",     S(RELAT),0,   0,      "B",    "kk",   le,     le              },
  { "==",     S(RELAT),0,   0,      "b",    "ii",   eq,     eq              },
  { "==.0",     S(RELAT),0,   0,      "B",    "kk",   eq,     eq              },
  { "!=",     S(RELAT),0,   0,      "b",    "ii",   ne,     ne              },
  { "!=.0",     S(RELAT),0,   0,      "B",    "kk",   ne,     ne              },
  { "!",      S(LOGCL),0,   0,      "b",    "b",    b_not,    b_not         },
  { "!.0",      S(LOGCL),0, 0,      "B",    "B",    b_not,    b_not         },
  { "&&",     S(LOGCL),0,   0,      "b",    "bb",   and,    and             },
  { "&&.0",     S(LOGCL),0,   0,      "B",    "BB",   and,    and             },
  { "||",     S(LOGCL),0,   0,      "b",    "bb",   or,     or              },
  { "||.0",     S(LOGCL),0,   0,      "B",    "BB",   or,     or              },
  { ":cond.i",     S(CONVAL),0,  1,      "i",    "bii",  conval                  },
  { ":cond.k",     S(CONVAL),0,  2,      "k",    "Bkk",  NULL,   conval          },
  { ":cond.a",     S(CONVAL),0,  2,      "a",    "Bxx",  NULL,   aconval },
  { ":cond.s",     S(CONVAL),0,  3,      "S",    "bSS",  conval, NULL         },
  { ":cond.S",     S(CONVAL),0,  3,      "S",    "BSS",  conval, conval       },
  { "##add.ii",  S(AOP),0,    1,      "i",    "ii",   addkk                   },
  { "##sub.ii",  S(AOP),0,    1,      "i",    "ii",   subkk                   },
  { "##mul.ii",  S(AOP),0,    1,      "i",    "ii",   mulkk                   },
  { "##div.ii",  S(AOP),0,    1,      "i",    "ii",   divkk                   },
  { "##mod.ii",  S(AOP),0,    1,      "i",    "ii",   modkk                   },
  { "##add.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   addkk           },
  { "##sub.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   subkk           },
  { "##mul.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   mulkk           },
  { "##div.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   divkk           },
  { "##mod.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   modkk           },
  { "##add.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   addka   },
  { "##sub.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   subka   },
  { "##mul.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   mulka   },
  { "##div.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   divka   },
  { "##mod.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   modka   },
  { "##add.ak",  S(AOP),0,    2,      "a",    "ak",   NULL,   addak   },
  { "##sub.ak",  S(AOP),0,    2,      "a",    "ak",   NULL,   subak   },<commit_msg>fix condition string expression<commit_after>/*
  entry1.c:

  Copyright (C) 1991 <NAME>, <NAME>

  This file is part of Csound.

  The Csound Library is free software; you can redistribute it
  and/or modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  Csound is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with Csound; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  02110-1301 USA
*/

#include "entry1.h"             /*                      ENTRY1.C        */
#include "interlocks.h"

/* thread vals, where isub=1, ksub=2:
   0 =     1  OR   2  (B out only)
   1 =     1
   2 =             2
   3 =     1  AND  2
 */

/* inarg types include the following:

   i       irate scalar
   k       krate scalar
   a       arate vector
   f       frequency variable
   w       spectral variable
   x       krate scalar or arate vector
   S       String
   T       String or i-rate
   U       String or i/k-rate
   B       Boolean k-rate
   b       Boolean i-rate; internally generated as required
   l       Label
   .       required arg of any-type
   and codes
   ?       optional arg of any-type
   m       begins an indef list of iargs (any count)
   M       begins an indef list of args (any count/rate i,k,a)
   N       begins an indef list of args (any count/rate i,k,a,S)
   o       optional i-rate, defaulting to  0
   p              "             "          1
   q              "             "         10
   v              "             "          .5
   j              "             "         -1
   h              "             "        127
   O       optional k-rate, defaulting to  0
   J              "             "         -1
   V              "             "          .5
   P              "             "          1
   W       begins indef list of Strings (any count)
   y       begins indef list of aargs (any count)
   z       begins indef list of kargs (any count)
   Z       begins alternating kakaka...list (any count)    */

/* outarg types include:
 i, k, a, S as  above
 *       multiple out args of any-type
 m       multiple out aargs
 z       multiple out kargs
 I       multiple out irate (not implemented yet)
 s       deprecated (use a or k as required)
 X       multiple args (a, k, or i-rate)     IV - Sep 1 2002
 N       multiple args (a, k, i, or S-rate)
 F       multiple args (f-rate)#
 */


OENTRY opcodlst_1[] = {
  /* opcode   dspace  flags  thread  outarg  inargs  isub    ksub    asub    */
  { "",     0,      0,    0,      "",     "",     NULL, NULL, NULL, NULL },
  { "instr",  0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  { "endin",  0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  /* IV - Sep 8 2002 */
  { "opcode", 0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  { "endop",  0,    0,      0,      "",     "",   NULL, NULL, NULL, NULL },
  { "$label", S(LBLBLK),  0,0,      "",     "",   NULL, NULL, NULL, NULL },
  { "pset",   S(PVSET),   0,0,      "",     "m",  NULL, NULL, NULL, NULL },

  /* IV - Sep 8 2002 - added entries for user defined opcodes, xin, xout */
  /* and setksmps */
  { "##userOpcode", S(UOPCODE),0, 7, "", "", useropcdset, useropcd, useropcd, NULL },
  /* IV - Sep 10 2002: removed perf time routines of xin and xout */
  { "xin",  S(XIN_MAX),0,   1,  "****************", "",  xinset,  NULL, NULL, NULL },
  /* { "xin.64",   S(XIN_HIGH),0,  1,
    "****************************************************************", "",
    xinset,  NULL, NULL },
  { "##xin256",  S(XIN_MAX),0,   1,
    "****************************************************************"
    "****************************************************************"
    "****************************************************************"
    "****************************************************************", "",
    xinset,  NULL, NULL },*/
  { "xout", S(XOUT_MAX),0,  1,  "",         "*", xoutset, NULL, NULL, NULL },
  { "setksmps", S(SETKSMPS),0,  1,  "",   "i", setksmpsset, NULL, NULL },
  { "ctrlinit",S(CTLINIT),0,1,      "",  "im", ctrlinit, NULL, NULL, NULL},
  { "massign",S(MASSIGN), 0,1,      "",  "iip",massign_p, NULL, NULL, NULL},
  { "massign.iS",S(MASSIGNS), 0,1,  "",  "iSp",massign_S, NULL, NULL, NULL},
  { "turnon", S(TURNON),  0,1,      "",     "io", turnon, NULL, NULL, NULL},
  { "turnon.S", S(TURNON),  0,1,    "",     "So", turnon_S, NULL, NULL, NULL},
  { "remoteport", S(REMOTEPORT), 0,1, "",  "i", remoteport, NULL, NULL, NULL},
  { "insremot",S(INSREMOT),0,1,     "",     "SSm",insremot, NULL, NULL, NULL},
  { "midremot",S(MIDREMOT),0,1,     "",     "SSm",midremot, NULL, NULL, NULL},
  { "insglobal",S(INSGLOBAL),0,1,   "",     "Sm", insglobal, NULL, NULL, NULL},
  { "midglobal",S(MIDGLOBAL),0,1,   "",     "Sm", midglobal, NULL, NULL, NULL},
  { "ihold",  S(LINK),0,    1,      "",     "",     ihold, NULL, NULL, NULL  },
  { "turnoff",S(LINK),0,    2,      "",     "",     NULL,   turnoff, NULL, NULL },
  {  "=.S",   S(STRCPY_OP),0,   1,  "S",    "S",
     (SUBR) strcpy_opcode_S, NULL, (SUBR) NULL, NULL    },
  {  "=.T",   S(STRGET_OP),0,   1,  "S",    "i",
     (SUBR) strcpy_opcode_p, (SUBR) NULL, (SUBR) NULL, NULL                 },
  { "=.r",    S(ASSIGN),0,  1,      "r",    "i",    rassign, NULL, NULL, NULL },
  { "=.i",    S(ASSIGNM),0, 1,      "IIIIIIIIIIIIIIIIIIIIIIII", "m",
    minit, NULL, NULL, NULL  },
  { "=.k",    S(ASSIGNM),0, 2,      "zzzzzzzzzzzzzzzzzzzzzzzz", "z",
    NULL, minit, NULL, NULL },
  { "=.a",    S(ASSIGN),0,  2,      "a",    "a",    NULL, gaassign, NULL },
  { "=.l",    S(ASSIGN),0,  2,      "a",    "a",    NULL,   laassign, NULL },
  { "=.up",   S(UPSAMP),0,  2,      "a",    "k",  NULL, (SUBR)upsamp, NULL },
  { "=.down",   S(DOWNSAMP),0,  3,  "k",    "ao",   (SUBR)downset,(SUBR)downsamp },
  //  { "=.t",    S(ASSIGNT),0, 2,      "t",    "kk",   NULL,   tassign, NULL   },
  { "init.S", S(STRCPY_OP),0, 1,      "S", "S", (SUBR) strcpy_opcode_S  },
  { "init.Si", S(STRCPY_OP),0, 1,      "S", "i", (SUBR) strcpy_opcode_p  },
  { "init.i", S(ASSIGNM),0, 1,      "IIIIIIIIIIIIIIIIIIIIIIII", "m", minit  },
  { "init.k", S(ASSIGNM),0, 1,      "zzzzzzzzzzzzzzzzzzzzzzzz", "m", minit  },
  { "init.a", S(ASSIGNM),0, 1,      "mmmmmmmmmmmmmmmmmmmmmmmm", "m", mainit },
  { ">",      S(RELAT),0,   0,      "b",    "ii",   gt,     gt              },
  { ">.0",      S(RELAT),0,   0,      "B",    "kk",   gt,     gt              },
  { ">=",     S(RELAT),0,   0,      "b",    "ii",   ge,     ge              },
  { ">=.0",     S(RELAT),0,   0,      "B",    "kk",   ge,     ge              },
  { "<",      S(RELAT),0,   0,      "b",    "ii",   lt,     lt              },
  { "<.0",      S(RELAT),0,   0,      "B",    "kk",   lt,     lt              },
  { "<=",     S(RELAT),0,   0,      "b",    "ii",   le,     le              },
  { "<=.0",     S(RELAT),0,   0,      "B",    "kk",   le,     le              },
  { "==",     S(RELAT),0,   0,      "b",    "ii",   eq,     eq              },
  { "==.0",     S(RELAT),0,   0,      "B",    "kk",   eq,     eq              },
  { "!=",     S(RELAT),0,   0,      "b",    "ii",   ne,     ne              },
  { "!=.0",     S(RELAT),0,   0,      "B",    "kk",   ne,     ne              },
  { "!",      S(LOGCL),0,   0,      "b",    "b",    b_not,    b_not         },
  { "!.0",      S(LOGCL),0, 0,      "B",    "B",    b_not,    b_not         },
  { "&&",     S(LOGCL),0,   0,      "b",    "bb",   and,    and             },
  { "&&.0",     S(LOGCL),0,   0,      "B",    "BB",   and,    and             },
  { "||",     S(LOGCL),0,   0,      "b",    "bb",   or,     or              },
  { "||.0",     S(LOGCL),0,   0,      "B",    "BB",   or,     or              },
  { ":cond.i",     S(CONVAL),0,  1,      "i",    "bii",  conval                  },
  { ":cond.k",     S(CONVAL),0,  2,      "k",    "Bkk",  NULL,   conval          },
  { ":cond.a",     S(CONVAL),0,  2,      "a",    "Bxx",  NULL,   aconval },
  { ":cond.s",     S(CONVAL),0,  1,      "S",    "bSS",  conval, NULL         },
  { ":cond.S",     S(CONVAL),0,  3,      "S",    "BSS",  conval, conval       },
  { "##add.ii",  S(AOP),0,    1,      "i",    "ii",   addkk                   },
  { "##sub.ii",  S(AOP),0,    1,      "i",    "ii",   subkk                   },
  { "##mul.ii",  S(AOP),0,    1,      "i",    "ii",   mulkk                   },
  { "##div.ii",  S(AOP),0,    1,      "i",    "ii",   divkk                   },
  { "##mod.ii",  S(AOP),0,    1,      "i",    "ii",   modkk                   },
  { "##add.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   addkk           },
  { "##sub.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   subkk           },
  { "##mul.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   mulkk           },
  { "##div.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   divkk           },
  { "##mod.kk",  S(AOP),0,    2,      "k",    "kk",   NULL,   modkk           },
  { "##add.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   addka   },
  { "##sub.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   subka   },
  { "##mul.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   mulka   },
  { "##div.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   divka   },
  { "##mod.ka",  S(AOP),0,    2,      "a",    "ka",   NULL,   modka   },
  { "##add.ak",  S(AOP),0,    2,      "a",    "ak",   NULL,   addak   },
  { "##sub.ak",  S(AOP),0,    2,      "a",    "ak",   NULL,   subak   },
{'fraction_non_alphanumeric': 0.22077658060581418, 'fraction_numerical': 0.025005082333807684, 'mean_word_length': 1.597966728280961, 'pattern_counts': {'":': 10, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 10, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3897032', 'n_tokens_mistral': 7648, 'n_tokens_neox': 7515, 'n_words': 1913}