mtapi_c_validate_arguments-snippet.h 369 Bytes
Newer Older
Michael Schmid committed
1 2 3 4 5 6 7 8 9 10 11 12
  /* check size of arguments (in this case we only expect one int
     value)*/
  mtapi_status_t status;
  if (arg_size != sizeof(int)) {
    printf("wrong size of arguments\n");
    mtapi_context_status_set(task_context, MTAPI_ERR_ARG_SIZE, &status);
    MTAPI_CHECK_STATUS(status);
    return;
  }
  
  /* cast arguments to the desired type */
  int n = *(int*)args;