• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ register_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中register_error函数的典型用法代码示例。如果您正苦于以下问题:C++ register_error函数的具体用法?C++ register_error怎么用?C++ register_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了register_error函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: hid_open_path

HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path)
{
	hid_device *dev;
	HIDP_CAPS caps;
	HIDP_PREPARSED_DATA *pp_data = NULL;
	BOOLEAN res;
	NTSTATUS nt_res;

#ifndef HIDAPI_USE_DDK
	if (!initialized)
		lookup_functions();
#endif

	dev = new_hid_device();

	// Open a handle to the device
	dev->device_handle = CreateFileA(path,
			GENERIC_WRITE |GENERIC_READ,
			FILE_SHARE_READ | FILE_SHARE_WRITE, /*share mode*/
			NULL,
			OPEN_EXISTING,
			FILE_FLAG_OVERLAPPED,
			/* FILE_ATTRIBUTE_NORMAL, */
			0);

	// Check validity of write_handle.
	if (dev->device_handle == INVALID_HANDLE_VALUE) {
		// Unable to open the device.
		register_error(dev, "CreateFile");
		goto err;
	}

	// Get the Input Report length for the device.
	res = HidD_GetPreparsedData(dev->device_handle, &pp_data);
	if (!res) {
		register_error(dev, "HidD_GetPreparsedData");
		goto err;
	}
	nt_res = HidP_GetCaps(pp_data, &caps);
	if (nt_res != HIDP_STATUS_SUCCESS) {
		register_error(dev, "HidP_GetCaps");	
		goto err_pp_data;
	}
	dev->input_report_length = caps.InputReportByteLength;
	HidD_FreePreparsedData(pp_data);

	return dev;

err_pp_data:
		HidD_FreePreparsedData(pp_data);
err:	
		CloseHandle(dev->device_handle);
		free(dev);
		return NULL;
}
开发者ID:FrankieChan885,项目名称:dian-zigbee-vote,代码行数:55,代码来源:hid.cpp


示例2: hid_write

int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length)
{
	DWORD bytes_written;
	BOOL res;

	OVERLAPPED ol;
	unsigned char *buf;
	memset(&ol, 0, sizeof(ol));

	/* Make sure the right number of bytes are passed to WriteFile. Windows
	   expects the number of bytes which are in the _longest_ report (plus
	   one for the report number) bytes even if the data is a report
	   which is shorter than that. Windows gives us this value in
	   caps.OutputReportByteLength. If a user passes in fewer bytes than this,
	   create a temporary buffer which is the proper size. */
	if (length >= dev->output_report_length) {
		/* The user passed the right number of bytes. Use the buffer as-is. */
		buf = (unsigned char *) data;
	} else {
		/* Create a temporary buffer and copy the user's data
		   into it, padding the rest with zeros. */
		buf = (unsigned char *) malloc(dev->output_report_length);
		memcpy(buf, data, length);
		memset(buf + length, 0, dev->output_report_length - length);
		length = dev->output_report_length;
	}

	res = WriteFile(dev->device_handle, buf, length, NULL, &ol);
	
	if (!res) {
		if (GetLastError() != ERROR_IO_PENDING) {
			/* WriteFile() failed. Return error. */
			register_error(dev, "WriteFile");
			bytes_written = -1;
			goto end_of_function;
		}
	}

	/* Wait here until the write is done. This makes
	   hid_write() synchronous. */
	res = GetOverlappedResult(dev->device_handle, &ol, &bytes_written, TRUE/*wait*/);
	if (!res) {
		/* The Write operation failed. */
		register_error(dev, "WriteFile");
		bytes_written = -1;
		goto end_of_function;
	}

end_of_function:
	if (buf != data)
		free(buf);

	return bytes_written;
}
开发者ID:trezor,项目名称:trezor-plugin,代码行数:54,代码来源:hid.c


示例3: hid_write

int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length)
{
        DWORD bytes_written;
        BOOL res;

        static OVERLAPPED ol;

Check_For_Result:
        if(!dev->blocking && dev->ioPending)
        {
            res = GetOverlappedResult(dev->device_handle, &ol, &bytes_written, FALSE/*don't wait*/);
            if(!res)
            {
                return 0;
            }
            else
            {
                dev->ioPending = false;
                return bytes_written;
            }
        }

        memset(&ol, 0, sizeof(ol));

        res = WriteFile(dev->device_handle, data, length, &bytes_written, &ol);

        if (!res) {
            if (GetLastError() != ERROR_IO_PENDING) {
                // WriteFile() failed. Return error.
                register_error(dev, "WriteFile");
                return -1;
            }
        }

        if(!dev->blocking)
        {
            dev->ioPending = true;
            goto Check_For_Result;
        }
        else
        {
            // Wait here until the write is done. This makes
            // hid_write() synchronous.
            res = GetOverlappedResult(dev->device_handle, &ol, &bytes_written, TRUE/*wait*/);
            if (!res) {
                    // The Write operation failed.
                    register_error(dev, "WriteFile");
                    return -1;
            }
        }

        return bytes_written;
}
开发者ID:NeuralSpaz,项目名称:LinzerSchnitteProgrammer,代码行数:53,代码来源:hid.cpp


示例4: hid_open_path

HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path)
{

	hid_device *dev;
	HIDP_CAPS caps;
	HIDP_PREPARSED_DATA *pp_data = NULL;
	BOOLEAN res;
	NTSTATUS nt_res;

#ifndef HIDAPI_USE_DDK
	if (!initialized)
		lookup_functions();
#endif

	dev = new_hid_device();

	// Open a handle to the device
	dev->device_handle = open_device(path);

	// Check validity of write_handle.
	if (dev->device_handle == INVALID_HANDLE_VALUE) {
		// Unable to open the device.
		register_error(dev, "CreateFile");
		goto err;
	}

	// Get the Input Report length for the device.
	res = HidD_GetPreparsedData(dev->device_handle, &pp_data);
	if (!res) {
		register_error(dev, "HidD_GetPreparsedData");
		goto err;
	}
	nt_res = HidP_GetCaps(pp_data, &caps);
	if (nt_res != HIDP_STATUS_SUCCESS) {
		register_error(dev, "HidP_GetCaps");	
		goto err_pp_data;
	}
	dev->input_report_length = caps.InputReportByteLength;
	HidD_FreePreparsedData(pp_data);

	dev->read_buf = (char*) malloc(dev->input_report_length);

	return dev;

err_pp_data:
		HidD_FreePreparsedData(pp_data);
err:	
		CloseHandle(dev->device_handle);
		free(dev);
		return NULL;
}
开发者ID:ccccjason,项目名称:my_osvr,代码行数:51,代码来源:hid.cpp


示例5: allot

Pfstream_handle *pfstream_start_write_thread(char *fname)
{
    Pfstream_handle *pfh;  /* Handle downstream functions can use to
			access data from the pfstream */
    Pfstream_control *pfsc;  /* control structure passed to new thread */

    /*These need to be created fromt he free store.  If we
    used a local variable in this function these would disappear when
    this routine went out of scope screwing up the thread it was passed
    to, and the return handle would get dropped.*/
    allot(Pfstream_handle *,pfh,1);
    allot(Pfstream_control *, pfsc, 1);

    /* brttutil routine to create a multithreaded, posix compatible thread */
    pfh->mtf = pmtfifo_create(PFSTREAM_MAXQUEUE,1,0);
    if(pfh->mtf == NULL)
    {
        register_error(1,"pfstream_start_write_thead:  Could not create mtfifo\n");
        free(pfh);
        free(pfsc);
        return(NULL);
    }
    pfsc->mtf=pfh->mtf;

    /* open the stream and put the fp into the control structure */
    pfsc->fp = fopen(fname,"r+");
    if(pfsc->fp==NULL)
    {
        register_error(1,"pfstream_start_write_thread:  Cannot open output stream %s\n",
                       fname);
        pmtfifo_destroy(pfh->mtf,free);
        free(pfh);
        free(pfsc);
        return(NULL);
    }
    /* This launches the write thread.  This is assumed to do the
    opposite of the read thread.  That is, processing modules will
    push data onto this mtfifo and the write routine handled by
    this thread will pop them off and send the contents down the
    stream now open as fp */
    if(pthread_create(&(pfh->thread_id),NULL,pfstream_write_data,(void *)pfsc)!=0)
    {
        register_error(1,"pfstream_start_write_thread: cannot create write thread\n");
        pmtfifo_destroy(pfh->mtf,free);
        fclose(pfsc->fp);
        free(pfh);
        free(pfsc);
        return(NULL);
    }
    return(pfh);
}
开发者ID:vonseg,项目名称:antelope_contrib,代码行数:51,代码来源:pthread_routines.c


示例6: hid_open_path

HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path)
{
	hid_device *dev;
	HIDP_CAPS caps;
	PHIDP_PREPARSED_DATA pp_data = NULL;
	BOOLEAN res;
	NTSTATUS nt_res;

	if (hid_init() < 0) {
		return NULL;
	}

	dev = new_hid_device();

	/* Open a handle to the device */
	dev->device_handle = open_device(path, FALSE);

	/* Check validity of write_handle. */
	if (dev->device_handle == INVALID_HANDLE_VALUE) {
		/* Unable to open the device. */
		register_error(dev, "CreateFile");
		goto err;
	}

	/* Get the Input Report length for the device. */
	res = HidD_GetPreparsedData(dev->device_handle, &pp_data);
	if (!res) {
		register_error(dev, "HidD_GetPreparsedData");
		goto err;
	}
	nt_res = HidP_GetCaps(pp_data, &caps);
	if (nt_res != HIDP_STATUS_SUCCESS) {
		register_error(dev, "HidP_GetCaps");	
		goto err_pp_data;
	}
	dev->output_report_length = caps.OutputReportByteLength;
	dev->input_report_length = caps.InputReportByteLength;
	HidD_FreePreparsedData(pp_data);

	dev->read_buf = (char*) malloc(dev->input_report_length);

	return dev;

err_pp_data:
		HidD_FreePreparsedData(pp_data);
err:	
		CloseHandle(dev->device_handle);
		free(dev);
		return NULL;
}
开发者ID:1337bacon,项目名称:open-zwave,代码行数:50,代码来源:hid.cpp


示例7: log2orbpkt

int 
log2orbpkt (char *comment, char **packet, int *nbytes, int *bufsize)

{
	int comment_length;
	unsigned short hdrsiz;
	unsigned short pktsiz;
	int bsize;
	unsigned short int usi;
	char *ptr;

	comment_length = strlen(comment);
	hdrsiz = 2 + 2 + 2 + 2;
	pktsiz = hdrsiz + comment_length + 1;
	*nbytes = pktsiz;
	bsize = *nbytes + 1;
	if (*packet == NULL) {
		*packet = (char *) malloc (bsize);
		if (*packet == NULL) {
			register_error (1, "log2orbpkt: malloc() error.\n");
			return (-1);
		}
		*bufsize = bsize;
	} else if (bsize > *bufsize) {
		*packet = (char *) realloc (*packet, bsize);
		if (*packet == NULL) {
			register_error (1, "log2orbpkt: realloc() error.\n");
			return (-1);
		}
		*bufsize = bsize;
	}

	ptr = *packet;
	H2N2 (ptr, &hdrsiz, 1);
	ptr += 2;
	H2N2 (ptr, &pktsiz, 1);
	ptr += 2;
	usi = (unsigned short int)QUANTERRA_LOG_HDR_TYPE;
	H2N2 (ptr, &usi, 1);
	ptr += 2;
	usi = (unsigned short int)QUANTERRA_LOG_PKT_TYPE;
	H2N2 (ptr, &usi, 1);
	ptr += 2;
	memcpy (ptr, comment, (int)comment_length + 1);

	/* normal exit */

	return (0);
}
开发者ID:battistuz,项目名称:antelope_contrib,代码行数:49,代码来源:quanterra_pkt.c


示例8: setupqorbpkt

int
setupqorbpkt ()

{
	if (register_pkt_handler (QUANTERRA_DATA_PKT_TYPE, NULL, unstuffqorbpkt) < 0) {
		register_error (0, "setupqorbpkt: register_pkt_handler() error.\n");
		return (-1);
	}
	if (register_pkt_handler (QUANTERRA_DATA_PKT_TYPE2, NULL, unstuffqorbpkt) < 0) {
		register_error (0, "setupqorbpkt: register_pkt_handler() error.\n");
		return (-1);
	}

	return (0);
}
开发者ID:battistuz,项目名称:antelope_contrib,代码行数:15,代码来源:quanterra_pkt.c


示例9: hid_get_feature_report

int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length)
{
	BOOL res;
#if 0
	res = HidD_GetFeature(dev->device_handle, (PVOID)data, (ULONG)length);
	if (!res) {
		register_error(dev, "HidD_GetFeature");
		return -1;
	}
	return 0; /* HidD_GetFeature() doesn't give us an actual length, unfortunately */
#else
	DWORD bytes_returned;

	OVERLAPPED ol;
	memset(&ol, 0, sizeof(ol));

	res = DeviceIoControl(dev->device_handle,
		IOCTL_HID_GET_FEATURE,
		data, (DWORD)length,
		data, (DWORD)length,
		&bytes_returned, &ol);

	if (!res) {
		if (GetLastError() != ERROR_IO_PENDING) {
			/* DeviceIoControl() failed. Return error. */
			register_error(dev, "Send Feature Report DeviceIoControl");
			return -1;
		}
	}

	/* Wait here until the write is done. This makes
	   hid_get_feature_report() synchronous. */
	res = GetOverlappedResult(dev->device_handle, &ol, &bytes_returned, TRUE/*wait*/);
	if (!res) {
		/* The operation failed. */
		register_error(dev, "Send Feature Report GetOverLappedResult");
		return -1;
	}

	/* bytes_returned does not include the first byte which contains the
	   report ID. The data buffer actually contains one more byte than
	   bytes_returned. */
	bytes_returned++;


	return bytes_returned;
#endif
}
开发者ID:GWRon,项目名称:sdl.mod,代码行数:48,代码来源:hid.c


示例10: hid_read_timeout

int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds)
{
	DWORD bytes_read = 0;
	size_t copy_len = 0;
	BOOL res;

	/* Copy the handle for convenience. */
	HANDLE ev = dev->ol.hEvent;

	if (!dev->read_pending) {
		/* Start an Overlapped I/O read. */
		dev->read_pending = TRUE;
		memset(dev->read_buf, 0, dev->input_report_length);
		ResetEvent(ev);
		res = ReadFile(dev->device_handle, dev->read_buf, dev->input_report_length, &bytes_read, &dev->ol);

        if (!res) {
            DWORD er = GetLastError();
            if (GetLastError() != ERROR_IO_PENDING) {
                /* ReadFile() has failed.
                   Clean up and return error. */
                CancelIo(dev->device_handle);
                dev->read_pending = FALSE;
                goto end_of_function;
            }
        }
	}

	if (milliseconds >= 0) {
		/* See if there is any data yet. */
		res = WaitForSingleObject(ev, milliseconds);
		if (res != WAIT_OBJECT_0) {
			/* There was no data this time. Return zero bytes available,
			   but leave the Overlapped I/O running. */
			return 0;
		}
	}

	/* Either WaitForSingleObject() told us that ReadFile has completed, or
	   we are in non-blocking mode. Get the number of bytes read. The actual
	   data has been copied to the data[] array which was passed to ReadFile(). */
	res = GetOverlappedResult(dev->device_handle, &dev->ol, &bytes_read, TRUE/*wait*/);

	/* Set pending back to false, even if GetOverlappedResult() returned error. */
	dev->read_pending = FALSE;

	if (res && bytes_read > 0) {
		/* Copy the whole buffer, report number and all. */
		copy_len = length > bytes_read ? bytes_read : length;
		memcpy(data, dev->read_buf, copy_len);
	}

end_of_function:
	if (!res) {
		register_error(dev, "GetOverlappedResult");
		return -1;
	}

	return copy_len;
}
开发者ID:bagong,项目名称:hidapi,代码行数:60,代码来源:hid.c


示例11: hid_get_feature_report

int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length)
{
	BOOL res;
#if 0
	res = HidD_GetFeature(dev->device_handle, data, length);
	if (!res) {
		register_error(dev, "HidD_GetFeature");
		return -1;
	}
	return 0; /* HidD_GetFeature() doesn't give us an actual length, unfortunately */
#else
	DWORD bytes_returned;

	OVERLAPPED ol;
	memset(&ol, 0, sizeof(ol));

	res = DeviceIoControl(dev->device_handle,
		IOCTL_HID_GET_FEATURE,
		data, length,
		data, length,
		&bytes_returned, &ol);

	if (!res) {
		if (GetLastError() != ERROR_IO_PENDING) {
			// DeviceIoControl() failed. Return error.
			register_error(dev, "Send Feature Report DeviceIoControl");
			return -1;
		}
	}

	// Wait here until the write is done. This makes
	// hid_get_feature_report() synchronous.
	res = GetOverlappedResult(dev->device_handle, &ol, &bytes_returned, TRUE/*wait*/);
	if (!res) {
		// The operation failed.
		register_error(dev, "Send Feature Report GetOverLappedResult");
		return -1;
	}

    // Get HID Stick messages
    HID_GetStick20ReceiveData (data);

    return bytes_returned;
#endif


}
开发者ID:fakedrake,项目名称:cryptostick-truecrypt,代码行数:47,代码来源:hid_win.c


示例12: hid_send_feature_report

int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *dev, const unsigned char *data, size_t length)
{
	BOOL res = HidD_SetFeature(dev->device_handle, (PVOID)data, length);
	if (!res) {
		register_error(dev, "HidD_SetFeature");
		return -1;
	}

	return length;
}
开发者ID:trezor,项目名称:trezor-plugin,代码行数:10,代码来源:hid.c


示例13: hid_get_product_string

int HID_API_EXPORT_CALL HID_API_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen)
{
	BOOL res;

	res = HidD_GetProductString(dev->device_handle, string, (ULONG)(sizeof(wchar_t) * MIN(maxlen, MAX_STRING_WCHARS)));
	if (!res) {
		register_error(dev, "HidD_GetProductString");
		return -1;
	}

	return 0;
}
开发者ID:GWRon,项目名称:sdl.mod,代码行数:12,代码来源:hid.c


示例14: hid_get_indexed_string

int HID_API_EXPORT_CALL HID_API_CALL hid_get_indexed_string(hid_device *dev, int string_index, wchar_t *string, size_t maxlen)
{
	BOOL res;

	res = HidD_GetIndexedString(dev->device_handle, string_index, string, sizeof(wchar_t) * maxlen);
	if (!res) {
		register_error(dev, "HidD_GetIndexedString");
		return -1;
	}

	return 0;
}
开发者ID:trezor,项目名称:trezor-plugin,代码行数:12,代码来源:hid.c


示例15: hid_get_product_string

int HID_API_EXPORT_CALL HID_API_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen)
{
	BOOL res;

	res = HidD_GetProductString(dev->device_handle, string, 2 * maxlen);
	if (!res) {
		register_error(dev, "HidD_GetProductString");
		return -1;
	}

	return 0;
}
开发者ID:hanshuebner,项目名称:hidapi,代码行数:12,代码来源:hid.cpp


示例16: hid_get_serial_number_string

int HID_API_EXPORT_CALL HID_API_CALL hid_get_serial_number_string(hid_device *dev, wchar_t *string, size_t maxlen)
{
	BOOL res;

	res = HidD_GetSerialNumberString(dev->device_handle, string, sizeof(wchar_t) * maxlen);
	if (!res) {
		register_error(dev, "HidD_GetSerialNumberString");
		return -1;
	}

	return 0;
}
开发者ID:trezor,项目名称:trezor-plugin,代码行数:12,代码来源:hid.c


示例17: qcomment2qorbpkt

int 
qcomment2qorbpkt (unsigned char *qdata_pkt,
			double *time, char *srcname,
			char **packet, int *nbytes, int *bufsize)

{
	int i, n;
	char network[32], station[32];
	char comment[512];
	char *ptr;
	unsigned char comment_length;
	int year, month, day, doy, hour, minute;
	double second;

	comment_length = qdata_pkt[14];
	memcpy (comment, &(qdata_pkt[15]), (int)comment_length);
	comment[comment_length] = '\0';

	ptr = (char *)qdata_pkt + 15 + comment_length;
	for (i=0; i<2; i++) if (ptr[4+i] != ' ' && ptr[4+i] != '\0') break;
	n = 2-i;
	memcpy (network, &(ptr[4+i]), n);
	for (i=0; i<n; i++) if (network[i] == ' ' || network[i] == '\0') break;
	network[i] = '\0';
	for (i=0; i<4; i++) if (ptr[i] != ' ' && ptr[i] != '\0') break;
	n = 4-i;
	memcpy (station, &(ptr[i]), n);
	for (i=0; i<n; i++) if (station[i] == ' ' || station[i] == '\0') break;
	station[i] = '\0';
	sprintf (srcname, "/log/%s_%s", network, station);

	year = qdata_pkt[8];
	month = qdata_pkt[9];
	day = qdata_pkt[10];
	hour = qdata_pkt[11];
	minute = qdata_pkt[12];
	second = qdata_pkt[13];
	if (year < 50) year += 2000; else year += 1900;
	doy = mday2doy (year, month, day);
	*time = h2e (year, doy, hour, minute, second);

	if (log2orbpkt (comment, packet, nbytes, bufsize) < 0) {
		register_error (0, "qcomment2qorbpkt: log2orbpkt() error.\n");
		return (-1);
	}

	/* normal exit */

	return (0);
}
开发者ID:battistuz,项目名称:antelope_contrib,代码行数:50,代码来源:quanterra_pkt.c


示例18: save_dbrecord

/* Special function used in orbgenloc for repeated task sending a db record 
to the orb.  It basicially implements a standard error message if this
fails.  

Arguments:
	db - input db pointer.  It is ASSUMED that db.record is dbSCRATCH
		and the relevant record has been copied onto the scratch
		record before calling this function. 
	orb - orb descriptor to send the scratch record of db to.  
Returns 0 if all worked.  Returns negative of number of failures 
otherwise with messages placed in error log.  
Author:  Gary L. Pavlis
Written:  May 1997
*/
int save_dbrecord(Dbptr db, int orb)
{
	char *table_name;
	int ret_code=0;


	if(db2orbpkt(db,orb)) 
	{
		dbquery(db,dbTABLE_NAME,table_name);
		register_error(0,"Error writing a record for table %s to orb\n",
			table_name);
		--ret_code;
	}
	return(ret_code);
}
开发者ID:battistuz,项目名称:antelope_contrib,代码行数:29,代码来源:orbgenloc.c


示例19: grdb_sc_getstachan

int grdb_sc_getstachan(Dbptr dbscgr, int record, char *sta, char *chan,
        int *nsegs, double *time, double *endtime)
{
	Dbptr db;
	long is, ie;

	if (record >= 0) dbscgr.record = record;
	if (dbgetv (dbscgr, 0, "sta", sta, "chan", chan, "bundle", &db, 0) == dbINVALID) {
        	register_error (0, "grdb_sc_getstachan: dbgetv() error.\n");
        	return (-1);
	}
        dbget_range (db, &is, &ie);
	*nsegs = (int)(ie - is);
        db.record = is;
	dbgetv (db, 0, "time", time, 0);
        db.record = ie-1;
	dbgetv (db, 0, "endtime", endtime, 0);

	/* Normal exit. */

	return (0);
}
开发者ID:ittaikurzon,项目名称:antelope_contrib,代码行数:22,代码来源:dsseis.c


示例20: autodrm_response


//.........这里部分代码省略.........
		dbstage.record = (long) gettbl (tbl, j);
		dbgetv (dbstage, 0,
			"sta", sta,
			"chan", chan,
			"time", &time,
			"endtime", &endtime,
			"stageid", &stageid,
			"decifac", &decifac,
			"samprate", &samprate,
			"gnom", &gnom,
			"gcalib", &gcalib,
			"dir", dir,
			"dfile", dfile,
			"gtype", gtype,
			"iunits", iunits,
			"ounits", ounits,
			NULL);

		if (gcalib > 0.0) {
		    gnom *= gcalib;
		} else if (gcalib < 0.0) {
		    complain (0, "gcalib = %10.3f < 0. is invalid for %s:%s @ %s.\n",
			      gcalib, sta, chan, s = strydtime (time));
		    free (s);
		    errors++;
		}
		if (*dir != '-' || *dfile != '-') {
		    long            mark;
		    dbextfile (dbstage, "stage", filename);
		    mark = elog_mark ();
		    elog_log (0, "response file is '%s'", filename);
		    if ((file = fopen (filename, "r")) == 0
			    || read_response (file, &response) < 0) {
			register_error (0,
			      "Can't read response file %s  for %s_%s @ %s",
				 filename, sta, chan, s = strydtime (time));
			free (s);
			fclose (file);
			errors++;
		    } else {
			fclose (file);
			if (response->ngroups > 1) {
			    register_error (0,
			      "stage response file %s has %d stages, not 1",
					    filename, response->ngroups);
			    errors++;
			} else {

			    group = response->groups;

			    switch (group->id) {

			      case PAZ:
				/* The normalization frequency chosen in the
				 * response file may not necessarily be the
				 * same as the one chosen by calibration
				 * table for insertion into the seed volumes.
				 * Consequently, we have to adjust the
				 * specified gnom to be correct for the seed
				 * normalization frequency.  Since the gain
				 * is
				 * 
				 * G(f) = gnom_db * A_response_file * P(f) =
				 * gnom_seed * A_seed * P(f)
				 * 
				 * We have
开发者ID:NVSeismoLab,项目名称:antelope_contrib,代码行数:67,代码来源:dbresp2autodrm.c



注:本文中的register_error函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ register_filesystem函数代码示例发布时间:2022-05-30
下一篇:
C++ register_early_suspend函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap