Beispiel #1
0
void formatPutString (BUFFER_PTR buffer, const char * theString)
{
  int length = strlen(theString);
  formatPutInt(buffer, length);
  if (length == 0) {
    formatPutChar(buffer, 'Z');
  } else {
    BCOPY(theString, buffer->buffer+buffer->bstart, length);
    buffer->bstart += length;
  }
}
Beispiel #2
0
JNIEXPORT void JNICALL Java_ipc_java_primFmttrs_formatPutString (JNIEnv *env, jclass c,
							jlong buf,
							jstring theString)
{
  BUFFER_PTR buffer = (BUFFER_PTR)(size_t)buf;
  const char *cstring = (*env)->GetStringUTFChars(env, theString, 0);
  int length = strlen(cstring);

  formatPutInt(buffer, length);
  if (length == 0) {
    formatPutChar(buffer, 'Z');
  } else {
    BCOPY(cstring, buffer->buffer+buffer->bstart, length);
    buffer->bstart += length;
  }
  (*env)->ReleaseStringUTFChars(env, theString, cstring);
}
Beispiel #3
0
JNIEXPORT void JNICALL Java_ipc_java_primFmttrs_formatPutChar (JNIEnv *env, jclass c,
						      jlong buffer, 
						      jchar theChar)
{
  formatPutChar((BUFFER_PTR)(size_t)buffer, (char)theChar);
}