473,323 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Need help in understanding c code

Hi,

I see this code in vlc code. I have a question about this line:
net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs,
"Range: bytes="I64Fd"-\r\n", i_tell );

What is the meaning of "Range: bytes="I64Fd"-\r\n" ? especially I64Fd
(in double quotes)
static int Request( access_t *p_access, int64_t i_tell )
{
access_sys_t *p_sys = p_access->p_sys;
char *psz ;
v_socket_t *pvs = p_sys->p_vs;
//.....

net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs,
"Range: bytes="I64Fd"-\r\n", i_tell );

}

Jun 1 '07 #1
2 1254
He************@gmail.com said:
Hi,

I see this code in vlc code. I have a question about this line:
net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs,
"Range: bytes="I64Fd"-\r\n", i_tell );

What is the meaning of "Range: bytes="I64Fd"-\r\n" ? especially I64Fd
(in double quotes)
It's probably a #define for "whatever the heck net_Printf uses as a
format specifier for long long int". For example, it might be:

#define I64Fd "%I64d"

or it might be

#define I64Fd "%lld"

or something else.

The string literal concatenation rule makes it all join up properly for
the compiler.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Jun 1 '07 #2
On Fri, 01 Jun 2007 14:14:47 -0000, He************@gmail.com wrote:
>Hi,

I see this code in vlc code. I have a question about this line:
net_Printf( VLC_OBJECT(p_access), p_sys->fd, pvs,
"Range: bytes="I64Fd"-\r\n", i_tell );

What is the meaning of "Range: bytes="I64Fd"-\r\n" ? especially I64Fd
(in double quotes)

I64Fd is not in double quotes. The expression consists of three
parts:
1 - the string literal "Range: bytes="
2 - the "token" I64Fd
3 - the string literal "-\r\n"

As RH suggested, the token I64Fd is probably a #define that is set to
some string literal (for sake of discussion, assume the literal is
"%_"). Consequently, the entire expression consists of three string
literals. When string literals abut or are separated only by white
space, the compiler automatically concatenates them together. As a
result, when the line question is compiled, the expression will the
single string literal:
"Range: bytes=%_-\r\n"

As usual, the address of the literal will be the value passed to
net_Printf.
Remove del for email
Jun 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ali | last post by:
I am in great need of code that will make a dome. I would like the inputs to be similar to that of the sphere. ie: pos=(x0, y0, z0) radius = R color = (r,g,b) etc. I am using VPython of...
1
by: Cibulya Dmitriy | last post by:
Hi All, I want to catch the next MSSQL error in my SQL code with following continue calculations Server: Msg 17, Level 16, State 1, Line 1 SQL Server does not exist or access denied.
34
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
2
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. I need a code sample for exchange sort. Thank you. --Mark
2
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. I need a code sample for merge sort. Thank you. --Mark
1
by: Riyadh Hossain | last post by:
I am developing USPS shipping API for my site. All the work is going on testing phase. My site uses PHP/MySQL. Now I am working on USPS tracking/confirm. I can send request and get responses from...
0
by: ravibrl | last post by:
Hey I need c++ code to access a webpage and download some software. If I execute that it should download that software and it should install it in my system. Give suggestions how to write that code...
3
by: dee vee bee | last post by:
this is my project i need a code that will show like this.. "first number __" "second number ___" "choose operation: addition..subtraction..multiplication..division" "the answer is ___" the...
1
by: saravanatmm | last post by:
I need javascript code for validate the email address. Email address field cannot allowed the capital letters, special characters except '@' symbol. But can allowed the small letters, numeric...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.