java.c

来自「RESIN 3.2 最新源码」· C语言 代码 · 共 80 行

C
80
字号
/* * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved * * @author Scott Ferguson */#ifdef WIN32#ifndef _WINSOCKAPI_ #define _WINSOCKAPI_#endif #include <windows.h>#include <winsock2.h> #else#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <unistd.h>#include <sys/time.h>#include <pwd.h>#endif#ifdef linux#include <linux/version.h>#endif#include <sys/stat.h>#include <fcntl.h>#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <signal.h>#include <errno.h>/* probably system-dependent */#include <jni.h>#include "resin.h"voidresin_throw_exception(JNIEnv *env, const char *cl, const char *buf){  jclass clazz;  if (env && ! (*env)->ExceptionOccurred(env)) {    clazz = (*env)->FindClass(env, cl);    if (clazz) {      (*env)->ThrowNew(env, clazz, buf);      return;    }  }  fprintf(stderr, "%s\n", buf);}voidresin_printf_exception(JNIEnv *env, const char *cl, const char *fmt, ...){  char buf[8192];  va_list list;  jclass clazz;  va_start(list, fmt);  vsprintf(buf, fmt, list);  va_end(list);  if (env && ! (*env)->ExceptionOccurred(env)) {    clazz = (*env)->FindClass(env, cl);    if (clazz) {      (*env)->ThrowNew(env, clazz, buf);      return;    }  }  fprintf(stderr, "%s\n", buf);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?