Commit f98ab6d9 authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Substitude int with int32_t


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@199 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 4aa85e7d
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -114,16 +114,16 @@ typedef enum {
/*! \brief Body of ConnectRequest message*/
/*! \brief Body of ConnectRequest message*/
typedef struct {
typedef struct {
    char username[12];
    char username[12];
    uint32_t version;
    int32_t version;
    uint32_t connection_time;
    int32_t connection_time;
    uint32_t crc32;
    int32_t crc32;
} NMXP_CONNECT_REQUEST; 
} NMXP_CONNECT_REQUEST; 


/*! \brief Body of DataRequest message*/
/*! \brief Body of DataRequest message*/
typedef struct {
typedef struct {
    uint32_t chan_key;
    int32_t chan_key;
    uint32_t start_time;
    int32_t start_time;
    uint32_t end_time;
    int32_t end_time;
} NMXP_DATA_REQUEST;
} NMXP_DATA_REQUEST;




@@ -178,7 +178,7 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList);
 * \retval SOCKET_ERROR on error
 * \retval SOCKET_ERROR on error
 * 
 * 
 */
 */
int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST *channelList, int32_t shortTermCompletion, uint32_t out_format, NMXP_BUFFER_FLAG buffer_flag);
int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag);




/*! \brief Receive Compressed or Decompressed Data message from a socket and launch func_processData() on the extracted data
/*! \brief Receive Compressed or Decompressed Data message from a socket and launch func_processData() on the extracted data
@@ -205,7 +205,7 @@ NMXP_DATA_PROCESS *nmxp_receiveData(int isock, NMXP_CHAN_LIST *channelList, cons
 * \retval SOCKET_ERROR on error
 * \retval SOCKET_ERROR on error
 * 
 * 
 */
 */
int nmxp_sendConnectRequest(int isock, char *naqs_username, char *naqs_password, uint32_t connection_time);
int nmxp_sendConnectRequest(int isock, char *naqs_username, char *naqs_password, int32_t connection_time);




/*! \brief Read connection time from a socket
/*! \brief Read connection time from a socket
@@ -217,7 +217,7 @@ int nmxp_sendConnectRequest(int isock, char *naqs_username, char *naqs_password,
 * \retval SOCKET_ERROR on error
 * \retval SOCKET_ERROR on error
 * 
 * 
 */
 */
int nmxp_readConnectionTime(int isock, uint32_t *connection_time);
int nmxp_readConnectionTime(int isock, int32_t *connection_time);




/*! \brief Wait the message "Ready" from a socket
/*! \brief Wait the message "Ready" from a socket
@@ -242,7 +242,7 @@ int nmxp_waitReady(int isock);
 * \retval SOCKET_ERROR on error
 * \retval SOCKET_ERROR on error
 * 
 * 
 */
 */
int nmxp_sendDataRequest(int isock, uint32_t key, uint32_t start_time, uint32_t end_time);
int nmxp_sendDataRequest(int isock, int32_t key, int32_t start_time, int32_t end_time);




/*! \brief Get the list of available channels from a server 
/*! \brief Get the list of available channels from a server 
+4 −4
Original line number Original line Diff line number Diff line
@@ -87,7 +87,7 @@ int nmxp_recv_ctrl(int isock, void *buffer, int length);
 * \retval NMXP_SOCKET_ERROR on error
 * \retval NMXP_SOCKET_ERROR on error
 *
 *
 */
 */
int nmxp_sendHeader(int isock, NMXP_MSG_CLIENT type, uint32_t length);
int nmxp_sendHeader(int isock, NMXP_MSG_CLIENT type, int32_t length);




/*! \brief Receives header of a message.
/*! \brief Receives header of a message.
@@ -100,7 +100,7 @@ int nmxp_sendHeader(int isock, NMXP_MSG_CLIENT type, uint32_t length);
 * \retval NMXP_SOCKET_ERROR on error
 * \retval NMXP_SOCKET_ERROR on error
 *
 *
 */
 */
int nmxp_receiveHeader(int isock, NMXP_MSG_SERVER *type, uint32_t *length);
int nmxp_receiveHeader(int isock, NMXP_MSG_SERVER *type, int32_t *length);




/*! \brief Sends header and body of a message.
/*! \brief Sends header and body of a message.
@@ -114,7 +114,7 @@ int nmxp_receiveHeader(int isock, NMXP_MSG_SERVER *type, uint32_t *length);
 * \retval NMXP_SOCKET_ERROR on error
 * \retval NMXP_SOCKET_ERROR on error
 *
 *
 */
 */
int nmxp_sendMessage(int isock, NMXP_MSG_CLIENT type, void *buffer, uint32_t length);
int nmxp_sendMessage(int isock, NMXP_MSG_CLIENT type, void *buffer, int32_t length);




/*! \brief Receives header and body of a message.
/*! \brief Receives header and body of a message.
@@ -130,7 +130,7 @@ int nmxp_sendMessage(int isock, NMXP_MSG_CLIENT type, void *buffer, uint32_t len
 * \retval NMXP_SOCKET_ERROR on error
 * \retval NMXP_SOCKET_ERROR on error
 *
 *
 */
 */
int nmxp_receiveMessage(int isock, NMXP_MSG_SERVER *type, void **buffer, uint32_t *length);
int nmxp_receiveMessage(int isock, NMXP_MSG_SERVER *type, void **buffer, int32_t *length);




/*! \brief Process Compressed Data message by function func_processData().
/*! \brief Process Compressed Data message by function func_processData().
+4 −4
Original line number Original line Diff line number Diff line
@@ -43,7 +43,7 @@ typedef struct {


/*! \brief Channel list */
/*! \brief Channel list */
typedef struct {
typedef struct {
    uint32_t number;
    int32_t number;
    NMXP_CHAN_KEY channel[MAX_N_CHAN];
    NMXP_CHAN_KEY channel[MAX_N_CHAN];
} NMXP_CHAN_LIST;
} NMXP_CHAN_LIST;


@@ -51,13 +51,13 @@ typedef struct {
typedef struct {
typedef struct {
    int32_t key;
    int32_t key;
    char name[12];
    char name[12];
    uint32_t start_time;
    int32_t start_time;
    uint32_t end_time;
    int32_t end_time;
} NMXP_CHAN_PRECISITEM;
} NMXP_CHAN_PRECISITEM;


/*! \brief Precis Channel list */
/*! \brief Precis Channel list */
typedef struct {
typedef struct {
    uint32_t number;
    int32_t number;
    NMXP_CHAN_PRECISITEM channel[MAX_N_CHAN];
    NMXP_CHAN_PRECISITEM channel[MAX_N_CHAN];
} NMXP_CHAN_PRECISLIST;
} NMXP_CHAN_PRECISLIST;


+14 −14
Original line number Original line Diff line number Diff line
@@ -82,9 +82,9 @@ typedef enum {


/*! \brief Header for all messages. */
/*! \brief Header for all messages. */
typedef struct {
typedef struct {
    uint32_t signature;
    int32_t signature;
    uint32_t type;
    int32_t type;
    uint32_t length;
    int32_t length;
} NMXP_MESSAGE_HEADER;
} NMXP_MESSAGE_HEADER;




@@ -99,22 +99,22 @@ typedef struct {


/*! \brief Parameter structure for functions that process data */
/*! \brief Parameter structure for functions that process data */
typedef struct {
typedef struct {
    int key;				/*!< \brief Channel Key */
    int32_t key;			/*!< \brief Channel Key */
    char network[NETWORK_LENGTH];	/*!< \brief Network code */
    char network[NETWORK_LENGTH];	/*!< \brief Network code */
    char station[STATION_LENGTH];	/*!< \brief Station code */
    char station[STATION_LENGTH];	/*!< \brief Station code */
    char channel[CHANNEL_LENGTH];	/*!< \brief Channel code */
    char channel[CHANNEL_LENGTH];	/*!< \brief Channel code */
    int packet_type;			/*!< \brief Packet type */
    int32_t packet_type;			/*!< \brief Packet type */
    int x0;				/*!< \brief First sample. It is significant only if x0n_significant != 0 */
    int32_t x0;				/*!< \brief First sample. It is significant only if x0n_significant != 0 */
    int xn;				/*!< \brief Last sample. It is significant only if x0n_significant != 0 */
    int32_t xn;				/*!< \brief Last sample. It is significant only if x0n_significant != 0 */
    int x0n_significant;			/*!< \brief Declare if xn significant */
    int32_t x0n_significant;			/*!< \brief Declare if xn significant */
    int oldest_seq_no;			/*!< \brief Oldest Sequence number */
    int32_t oldest_seq_no;			/*!< \brief Oldest Sequence number */
    int seq_no;				/*!< \brief Sequence number */
    int32_t seq_no;				/*!< \brief Sequence number */
    double time;			/*!< \brief Time first sample. Epochs. */
    double time;			/*!< \brief Time first sample. Epochs. */
    void *buffer;			/*!< \brief Nanometrics packet data  */
    void *buffer;			/*!< \brief Nanometrics packet data  */
    int length;				/*!< \brief Packet length */
    int32_t length;				/*!< \brief Packet length */
    int *pDataPtr;			/*!< \brief Array of samples */
    int *pDataPtr;			/*!< \brief Array of samples */
    int nSamp;				/*!< \brief Number or samples */
    int32_t nSamp;				/*!< \brief Number or samples */
    int sampRate;			/*!< \brief Sample rate */
    int32_t sampRate;			/*!< \brief Sample rate */
} NMXP_DATA_PROCESS;
} NMXP_DATA_PROCESS;




@@ -146,7 +146,7 @@ int nmxp_data_init(NMXP_DATA_PROCESS *pd);
 *          doug@seismo.berkeley.edu
 *          doug@seismo.berkeley.edu
 *
 *
 */
 */
int nmxp_data_unpack_bundle (int *outdata, unsigned char *indata, int *prev);
int nmxp_data_unpack_bundle (int32_t *outdata, unsigned char *indata, int32_t *prev);




/* \brief Value for parameter exclude_bitmap in the function nmxp_data_trim() */
/* \brief Value for parameter exclude_bitmap in the function nmxp_data_trim() */
+10 −10
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList) {


    NMXP_MSG_SERVER type;
    NMXP_MSG_SERVER type;
    void *buffer;
    void *buffer;
    uint32_t length;
    int32_t length;


    *pchannelList = NULL;
    *pchannelList = NULL;


@@ -59,11 +59,11 @@ int nmxp_receiveChannelList(int isock, NMXP_CHAN_LIST **pchannelList) {
}
}




int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST *channelList, int32_t shortTermCompletion, uint32_t out_format, NMXP_BUFFER_FLAG buffer_flag) {
int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST *channelList, int32_t shortTermCompletion, int32_t out_format, NMXP_BUFFER_FLAG buffer_flag) {
    int ret;
    int ret;
    uint32_t buffer_length = 16 + (4 * channelList->number); 
    int32_t buffer_length = 16 + (4 * channelList->number); 
    char *buffer = malloc(buffer_length);
    char *buffer = malloc(buffer_length);
    uint32_t app, i, disp;
    int32_t app, i, disp;


    disp=0;
    disp=0;


@@ -101,7 +101,7 @@ int nmxp_sendAddTimeSeriesChannel(int isock, NMXP_CHAN_LIST *channelList, int32_
NMXP_DATA_PROCESS *nmxp_receiveData(int isock, NMXP_CHAN_LIST *channelList, const char *network_code) {
NMXP_DATA_PROCESS *nmxp_receiveData(int isock, NMXP_CHAN_LIST *channelList, const char *network_code) {
    NMXP_MSG_SERVER type;
    NMXP_MSG_SERVER type;
    void *buffer = NULL;
    void *buffer = NULL;
    uint32_t length;
    int32_t length;
    NMXP_DATA_PROCESS *pd = NULL;
    NMXP_DATA_PROCESS *pd = NULL;


    if(nmxp_receiveMessage(isock, &type, &buffer, &length) == NMXP_SOCKET_OK) {
    if(nmxp_receiveMessage(isock, &type, &buffer, &length) == NMXP_SOCKET_OK) {
@@ -120,7 +120,7 @@ NMXP_DATA_PROCESS *nmxp_receiveData(int isock, NMXP_CHAN_LIST *channelList, cons
}
}




int nmxp_sendConnectRequest(int isock, char *naqs_username, char *naqs_password, uint32_t connection_time) {
int nmxp_sendConnectRequest(int isock, char *naqs_username, char *naqs_password, int32_t connection_time) {
    int ret;
    int ret;
    char crc32buf[100];
    char crc32buf[100];
    NMXP_CONNECT_REQUEST connectRequest;
    NMXP_CONNECT_REQUEST connectRequest;
@@ -161,7 +161,7 @@ int nmxp_sendConnectRequest(int isock, char *naqs_username, char *naqs_password,
}
}




int nmxp_readConnectionTime(int isock, uint32_t *connection_time) {
int nmxp_readConnectionTime(int isock, int32_t *connection_time) {
    int ret;
    int ret;
    ret = nmxp_recv_ctrl(isock, connection_time, sizeof(connection_time));
    ret = nmxp_recv_ctrl(isock, connection_time, sizeof(connection_time));
    *connection_time = ntohl(*connection_time);
    *connection_time = ntohl(*connection_time);
@@ -239,7 +239,7 @@ int nmxp_waitReady(int isock) {
}
}




int nmxp_sendDataRequest(int isock, uint32_t key, uint32_t start_time, uint32_t end_time) {
int nmxp_sendDataRequest(int isock, int32_t key, int32_t start_time, int32_t end_time) {
    int ret;
    int ret;
    NMXP_DATA_REQUEST dataRequest;
    NMXP_DATA_REQUEST dataRequest;


@@ -318,14 +318,14 @@ NMXP_META_CHAN_LIST *nmxp_getMetaChannelList(char * hostname, int portnum, NMXP_
    NMXP_META_CHAN_LIST *chan_list = NULL;
    NMXP_META_CHAN_LIST *chan_list = NULL;
    NMXP_META_CHAN_LIST *iter = NULL;
    NMXP_META_CHAN_LIST *iter = NULL;
    int i = 0;
    int i = 0;
    uint32_t connection_time;
    int32_t connection_time;
    char *datas_username = NULL, *datas_password = NULL;
    char *datas_username = NULL, *datas_password = NULL;
    int ret_sock;
    int ret_sock;


    
    
    NMXP_MSG_SERVER type;
    NMXP_MSG_SERVER type;
    void *buffer = NULL;
    void *buffer = NULL;
    uint32_t length;
    int32_t length;
    NMXP_MSGBODY_PRECISLISTREQUEST precisListRequestBody;
    NMXP_MSGBODY_PRECISLISTREQUEST precisListRequestBody;
    NMXP_MSGBODY_CHANNELINFOREQUEST channelInfoRequestBody;
    NMXP_MSGBODY_CHANNELINFOREQUEST channelInfoRequestBody;
    NMXP_MSGBODY_CHANNELINFORESPONSE *channelInfo;
    NMXP_MSGBODY_CHANNELINFORESPONSE *channelInfo;
Loading