Пример #1
0
int main() {
    {
        boost::context::execution_context ctx1_( f1, 3);
        ctx1 = & ctx1_;
        boost::context::execution_context ctx2_( f2);
        ctx2 = & ctx2_;
        boost::context::execution_context ctx_( boost::context::execution_context::current() );
        ctx = & ctx_;
        
        ( * ctx1)();
    }
    std::cout << "main: done" << std::endl;
    return EXIT_SUCCESS;
}
Пример #2
0
void vdtext_(int *length, int char_array[])
{
  int   i, lenout, len, temp1, temp2;
  float dx, dy, temp_xcp, temp_ycp, temp3;
  int   strout[150];

  len = *length;

  if (len < 1) {
    vdicgi_errh(" SVDI Shell (VDTEXT) Error Number 212, Severity Code 5 ");
    return;
  }

  if (len > 136) {
    vdicgi_errh(" SVDI Shell (VDTEXT) Error Number 213, Severity Code 5 ");
    len = 136;
  }

  if (alpha_mode) {
    temp1 = XEAGMD;
    temp2 = 1;
    temp3 = 1.; /*  graphics  */
    cesc2_(&temp1, &temp2, &temp3);
    alpha_mode = FALSE;
  }

  lenout = 0; /*count characters in string output buffer "strout" */

  for (i = 0; i < len; i++) {
    if (char_array[i] < 32 || char_array[i] > 126) {
      switch (char_array[i]) {
      case 8:
        dx = -vector[6];
        dy = 0.;
        break;
      case 10:
        dx = 0.;
        dy = -vector[5];
        break;
      case 13:
        dx = -xcp;
        dy = 0.;
        break;
      default:
        dx = 0.;
        dy = 0.;
        vdicgi_errh(" SVDI Shell (VDTEXT) Error Number 208, Severity Code 5 ");
        break;
      }
      /*  Stuff to send, finish the string   */

      if (lenout != 0) {
        temp_xcp = map_x(xcp);
        temp_ycp = map_y(ycp);
        ctx2_(&temp_xcp, &temp_ycp, strout, &lenout);
        xcp += lenout * vector[6];
        lenout = 0;
      }
      xcp += dx;
      ycp += dy;
      vdmova_(&xcp, &ycp);
    }

    else

      strout[lenout++] = char_array[i];
  }

  /*  All done, get rid of them         */
  if (lenout != 0) {
    temp_xcp = map_x(xcp);
    temp_ycp = map_y(ycp);
    ctx2_(&temp_xcp, &temp_ycp, strout, &lenout);
    xcp += lenout * vector[6];
    lenout = 0;
  }
}